Does anyone know the exact behavior of DMA and interrupts in relation to each other?
All the documentation I've seen says that a DMA read (or write?) keeps the CPU busy for 2 cycles (yeesh!). I would assume that if an interrupt happens during this time, the DMA transfer is scuttled until the interrupt is complete. Or does the interrupt wait until the DMA is complete?
Is this important to know/emulate in the instance when a scanline counter IRQ (or something similar) goes off during a sprite DMA tranfer?
(Yes, I'm one of those people who originally set out to write a "functional equivalence" NES emulator, but then was hit with the hard truth of "functional equivalence == perfect clock-cycle accuracy" in the NES emulation world. I'd assume this is the point where most would-be emulator writers get off this train, but I'm still here.)
All the documentation I've seen says that a DMA read (or write?) keeps the CPU busy for 2 cycles (yeesh!). I would assume that if an interrupt happens during this time, the DMA transfer is scuttled until the interrupt is complete. Or does the interrupt wait until the DMA is complete?
Is this important to know/emulate in the instance when a scanline counter IRQ (or something similar) goes off during a sprite DMA tranfer?
(Yes, I'm one of those people who originally set out to write a "functional equivalence" NES emulator, but then was hit with the hard truth of "functional equivalence == perfect clock-cycle accuracy" in the NES emulation world. I'd assume this is the point where most would-be emulator writers get off this train, but I'm still here.)