I have been trying to pass Blargg's cpu interrupts test.
My question is about NMI hijacking an IRQ. Is the NMI flip-flop cleared when the CPU is on an IRQ sequence and jumps to the NMI vector??
What i did was simple, i have a flag -> "on_irq" and at the beggining of my runcpu() fn it checks if this flag is set, if it is set my emu calls an IRQ() fn that does cycle by cycle what IRQ does and in the 6th and 7th checks if my other flag "nmi_pending" is set and lad PCL and PCH with NMI vectors respectivly.
I ask if it clears the NMI flip-flop, becouse if it doesn't it would jump NMI vector (since i check NMI at the beggining of my code too)
The thing i cannot pass the NMI hijacking an IRQ test.
My question is about NMI hijacking an IRQ. Is the NMI flip-flop cleared when the CPU is on an IRQ sequence and jumps to the NMI vector??
What i did was simple, i have a flag -> "on_irq" and at the beggining of my runcpu() fn it checks if this flag is set, if it is set my emu calls an IRQ() fn that does cycle by cycle what IRQ does and in the 6th and 7th checks if my other flag "nmi_pending" is set and lad PCL and PCH with NMI vectors respectivly.
I ask if it clears the NMI flip-flop, becouse if it doesn't it would jump NMI vector (since i check NMI at the beggining of my code too)
The thing i cannot pass the NMI hijacking an IRQ test.