sverx / devkitSMS

development kit and libraries for SEGA Master System / SEGA Game Gear / SEGA SG-1000 / SEGA SC-3000 homebrew programming using C language (and the SDCC compiler)
224 stars 34 forks source link

SG/SC -> SG_byte_brief_array_to_VDP_data #51

Closed siriokds closed 6 months ago

siriokds commented 1 year ago

Hi, I read the content of SG_byte_brief_array_to_VDP_data function and I found it copies data from a ram buffer to SAT. I wonder if you can insert a reverse-copy function in order manage the sprites-on-a-line limit (4 on SC/SG). Usually I copy SAT buffer to vram SAT in normal mode on even frames and copy SAT buffer to vram SAT in reverse mode on odd frames. Probably (if I didn't see it) could be useful a "SG_byte_reverse_array_to_VDP_data" function.

Times ago I built it by myself in ASM but I put it in CRT function as standard/fast function.

What do you think about it?

Cheers, Saverio

sverx commented 1 year ago

If you want to reverse the order of the sprites you can't simply copy the bytes to SAT in reverse order, you need a specific function to perform a reversed SAT copy.

But I wonder if simply reversing the order of the sprites is a sufficient workaround anyway. For instance, if you place 9 sprites on the same line you won't ever get the 5th of them to appear in any screen frame, as it will be the 5th again on the reversed SAT. :thinking: