commanderx16 / x16-rom

Other
153 stars 43 forks source link

implement FB_set_palette #362

Closed irmen closed 1 year ago

irmen commented 1 year ago

Implements the FB_set_palette kernal routine.

A few remarks/questions:

mooinglemur commented 1 year ago

I think the offset should be into the VRAM palette data, not an index into the source ptr r0. Perhaps .A should be a color index rather than a byte index so you can reach all 512 palette data bytes with one register for the offset?

I honestly don't know whether it's okay to use ADDR0/DATA0 and then leave it undefined for the next thing to use it to sort out. My hunch is yes.

irmen commented 1 year ago

I changed the implementation according to mooinglemur's comment.

Pass : r0 pointer to color palette data a VERA palette start color index x number of colors to set (0=256)

here is the PR for the documentation change: https://github.com/commanderx16/x16-docs/pull/109