For example this code:
Code: Select all
RESET:
; ... basic init code is skipped
LDA #PPU_CTRL_NMI_ON
STA PPU_CTRL
@loop:
LDA PPU_STATUS
NOP
NOP
JMP @loop
My NMI does nothing but increment nmi_counter:
Code: Select all
NMI:
PHA
TXA
PHA
TYA
PHA
INC nmi_counter
PLA
TAY
PLA
TAX
PLA
RTI
1. Download this example: http://veg.by/files/nes/nonmibug.7z
2. Open Nintendulator, set Hybrid PPU mode, open demo.nes from the archive
3. Open debugger, press Add breakpoint, choose NMI, press Add
4. Press run.
You will see that NMI is called only 3 times. After it only infinite loop in the main code will be executed.
What's the cause of this?