First of all, I'm new here. But I have read quite a lot of posts already and lots of other Genesis info. I'm currently starting to port an existing iPhone retro game to the Genesis. It's not very far yet, just some level scrolling code and a couple music prototypes using Echo and sgdk. Nothing to show yet.
What I'm currently trying to do is simply creating a background gradient by simply changing color 0 every 16 lines. However, the problem is that the color doesn't switch fast enough. The old color is still drawn for about half of the next line.
The way I implemented it is the naive approach of setting a HInt handler
that does nothing except setting the one color, like this:
Code: Select all
void handleHBlank()
{
VDP_setPaletteColor(0, 0, gradientTestColor);
gradientTestColor -= 0x100;
}
1. Changed the VDP_setPaletteColor to macro to make sure it gets unrolled
2. bypassed the sgdk HInt handler and directly called my own.
What could I be doing wrong? I have read a couple threads that touched this topic, but I couldn't quite figure out what I'm supposed to do. Is it generally not possible to switch colors using this approach? Do I have to use DMA? It seemed overkill to me to use DMA to transmit just one value.
Your help is much appreciated.