tomaitheous wrote:
Disch wrote:
yes, it's a quirk in the real hardware.
Why do you call it a quirk though? Many systems hold the IRQ line active until a port is read (or sometimes written to) to acknowledge the interrupt.
On the NES, either there seems to be a significant delay between setting bit#7 of $2002 and pulling the NMI line (so that it can be cleared before), or reading $2002 sometimes prevents bit#7 to be set at all. Since this behaviour doesn't make any sense, it seems to be a hardware bug which Nintendo did not fix.
I really wonder if the designers were really sure what Sprite 0 hit detection was supposed to accomplish. For collision detection, it's quite useless. And for mid-screen changes, there are lots of factors which make it unnecessarily complex. For example, why doesn't Sprite 0 hit generate an NMI? It wouldn't have cost much extra logic. Or why does the Sprite pixel have to overlap with the background, instead of just setting the flag when Sprite 0 is in range?
They probably did implement this weird method because there are some patents from Commodore and Atari involved for methods of synchronizing the raster beam with the CPU.
Enough ranting.