Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a GPU #8

Open
1 task
fnuecke opened this issue Aug 21, 2016 · 3 comments
Open
1 task

Add a GPU #8

fnuecke opened this issue Aug 21, 2016 · 3 comments

Comments

@fnuecke
Copy link
Owner

fnuecke commented Aug 21, 2016

Implement some sort of GPU, probably with VRAM mapped to general address space for access speeds.

All further details TBD.

@iamgreaser
Copy link
Collaborator

Will we use direct VRAM writes, or will we send commands to the GPU instead? I have ideas for both.

@fnuecke
Copy link
Owner Author

fnuecke commented Aug 31, 2016

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?

@iamgreaser
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants