3 ms·
NES does not have a true scanline interrupt, but it had this weird sprite #0 hit flag. The flag is set if the sprite #0 contains non-transparent pixels, and it
by Kaali 14y ago
NES does not have a true scanline interrupt, but it had this weird sprite #0 hit flag. The flag is set if the sprite #0 contains non-transparent pixels, and it overlaps something on the background. When the PPU hits the first pixel where those conditions are true, it sets a bit and fires an non-maskable interrupt. This way you could do once per frame scanline detection for split screen effects, but you still have to time your code correctly, as NMI handling is not clock accurate, and neither is the actual sprite #0 hit detection.
For more advanced effects, Nintendo developed mappers for their cartridges, calles memory management controllers, which increased cartridge memory with banking, and also added custom interrupts and features. MMC3 contained a scanline counter which makes it possible to do fun effects with NES. Megaman 3 to 6 used MMC3.
I'm really just a beginner with NES programming, so I hope there is no significant factual errors in that.