Scanline register in NTSC mode is not behaving like in the documentation. 240p is not interlaced. Adding +1 to the current scanline register for the next IRQ LINE interrupt shouldn't work since bit 0 is ignored, still every other frame it does work, and the other frame it does just the same as when adding +2 to the scanline register.
I have known this for the last 6 months. I almost got VGA to work like I want. The issue will always be that when you get a chance to touch the VERA scroll registers, the current scanline is already well into the rendering of that scanline, but the next scanline will still have a chance to take effect, ONLY, there is very little time there as well. So many have said you need to make changes that will happen 2 scanlines later, only to realize that some scroll register Y for some layer will be updated the next scanline (+1) while scroll register X of that same layer will be updated the 'next next' scanline (+2).Wavicle wrote: ↑Thu May 15, 2025 7:37 am The CPU and VERA run asynchronously to one another. If you are attempting to do scanline effects in both VGA and NTSC, you need to understand the timing differences between the two, and you need to understand that some things, like palette changes, happen while the current line is being scanned out, but changes to how the line is rendered will not be seen until the rendered line is being scanned out, which happens one line after the change is made.
Once I release my game, I will make sure that every hardware revision and MHz setting of the CPU (and 16-bit or 8-bit variant) will require backward compatibility with the timings I have magically dialed in (we are not talking about a few hours here, weeks of work, first in emulators just to fail on real hardware, then again on real hardware moving SD cards for hours on end). That's what the "compatibility with existing software" is all about, right? But I am giving the hardware team a chance to fix these issues talked about in this thread before committing to almost random undocumented or unproven behavior.
Back to the NTSC problem: I did some further testing by setting the start scanline to an odd value, and then EOR that with 1 every vblank to try to sync with the 60 Hz swapping of fields for 240p (I know, that shouldn't happen, that is interlaced behavior). I was unsuccessful, and it just looked the same as the screenshots above, flickering with one correct output, and one wrong, every frame.