Hello, I'm coding an NES emulator in JavaScript, and currently I'm facing a problem that I can't overcome.
I've not implemented any mappers or scrolling, and toying with simplest games like donkey kong.
DK runs, just that its slow. I've made a forums post previously but I didn't bump it viewtopic.php?f=3&t=16293
The reason for slowness is that in a second, the game is only triggering 20-25 NMIs. MS Pac-man in particular doesn't trigger NMIs at all.
I debugged and compared instruction flow with fceux, and found out that in my emulator, bit 7 of PPUCTRL is being disabled, so the emulator can't do NMI. On further inspection I found out that PPUSTATUS is not being read sometimes by the games. MS pac man reads PPUSTATUS once or twice, then never reads it and as a result the NMI bit is not set and the game renders nothing.
My CPU implementation is good, as it matches the nintendulator nestest.log.
Do any of you guys have any idea that what wrong/missing implementation might be responsible for this?
I've not implemented any mappers or scrolling, and toying with simplest games like donkey kong.
DK runs, just that its slow. I've made a forums post previously but I didn't bump it viewtopic.php?f=3&t=16293
The reason for slowness is that in a second, the game is only triggering 20-25 NMIs. MS Pac-man in particular doesn't trigger NMIs at all.
I debugged and compared instruction flow with fceux, and found out that in my emulator, bit 7 of PPUCTRL is being disabled, so the emulator can't do NMI. On further inspection I found out that PPUSTATUS is not being read sometimes by the games. MS pac man reads PPUSTATUS once or twice, then never reads it and as a result the NMI bit is not set and the game renders nothing.
My CPU implementation is good, as it matches the nintendulator nestest.log.
Do any of you guys have any idea that what wrong/missing implementation might be responsible for this?