Stable interrupt discussion
Posted: Thu Dec 10, 2009 6:02 pm
I come from the C64 where stabilizing the raster IRQ is paramount to doing any high-end VIC effects (since being just one cycle off can be the difference between a routine working or failing). The typical method for doing this on the C64 is to use a double interrupt - you set an interrupt for the line before you actually want to do anything, then you busywait until just before the end of the line using NOPs, after setting the IRQ for the next line. Thus, instead of having up to 7 cycles of jitter before the code for your IRQ is actually running, you have one cycle of jitter which can be handled with a simple CMP/BNE combo that uses one more cycle if you're not actually on the desired scanline - hence from that point the IRQ will trigger on the exact same cycle each line.
Has anyone made any effort to try and duplicate this on the Genesis? Many of the C64's VIC quirks are based on register-banging on specific cycles of the scanline, and I'm thinking the VDP might have a few unlockable "secrets" if we could bang it at just the right time on each scanline. For example, C64 sprite stretching is done by twiddling the Y-expand bit at just the right time on each line. I'm not saying we'd be able to stretch sprites, because the Genesis has no sprite enlargement functionality. I'm merely saying that I would bet on there being a few things the VDP could do if we raped it in such a manner.
At the very least, a stable interrupt would allow mid-line backdrop changes without jitter, which could potentially increase color resolution in properly-designed cases (giving an effective resolution of 16 colors for said cases instead of 15 plus background). One could use black for the border region then change the backdrop shortly within the addressable screen, then change it back to black shortly before the right border. I know there are only so many "slots" for writing to the VDP, but there is still massive jitter.
Has anyone made any effort to try and duplicate this on the Genesis? Many of the C64's VIC quirks are based on register-banging on specific cycles of the scanline, and I'm thinking the VDP might have a few unlockable "secrets" if we could bang it at just the right time on each scanline. For example, C64 sprite stretching is done by twiddling the Y-expand bit at just the right time on each line. I'm not saying we'd be able to stretch sprites, because the Genesis has no sprite enlargement functionality. I'm merely saying that I would bet on there being a few things the VDP could do if we raped it in such a manner.
At the very least, a stable interrupt would allow mid-line backdrop changes without jitter, which could potentially increase color resolution in properly-designed cases (giving an effective resolution of 16 colors for said cases instead of 15 plus background). One could use black for the border region then change the backdrop shortly within the addressable screen, then change it back to black shortly before the right border. I know there are only so many "slots" for writing to the VDP, but there is still massive jitter.