Open fnuecke opened 8 years ago
Will we use direct VRAM writes, or will we send commands to the GPU instead? I have ideas for both.
I can see advantages for both, the first being nice for low-level archs, the latter for high-level ones. The latter would presumably more compact networking (that's why that's what OC does anyway). Not sure if a "hybrid" would be a good idea? Would allow saving some cycles, but that in turn could increase bandwidth use for syncing quite a bit... I have no strong preference right now, tbh, tho I'm leaning towards VRAM writes.
@asiekierka offered to work on this a while ago, tho I'm not sure what his schedule looks like currently, given fabric is a thing now?
Considering that the Sega Master System accesses VRAM via a couple of I/O ports, and that's a Z80-based system, I don't see how a command-based system would be out of place.
Let's get some examples up.
Put string onto screen at given position
LD a, GPU_MSG_PUTSTR LD de, (ypos<<8)|xpos LD hl, str_hello LD b, str_hello_end - str_hello OUT (c), a OUT (c), e OUT (c), d OUT (c), b OTIR
Draw a rectangle
LD a, GPU_MSG_RECTFILL_C4 LD hl, (y<<8)|x LD de, (h<<8)|w LD b, color OUT (c), a OUT (c), l OUT (c), h OUT (c), e OUT (c), d OUT (c), b
Actually, just draw a damn thing
LD hl, a_damn_thing LD b, a_damn_thing_end - a_damn_thing OTIR
Implement some sort of GPU, probably with VRAM mapped to general address space for access speeds.
All further details TBD.