11 March 2016 - Forum Rules

Main Menu

Curious about a problem with the MMC3 IRQ.

Started by w7n, September 29, 2013, 08:54:32 AM

Previous topic - Next topic


Some time ago I was reverse engineering ATA's 'vertical' patch for the game Super Mario Bros. The patched game works on VNES, but it doesn't work on FCEUX or Nestopia. I used the FCEUX's debugging function, and I found that the game got stuck in the IRQ routine.

So here's the code:
;IRQ Routine
LDA #$00
STA $C000
STA $C001
STA $E000

And the result: the IRQ routine gets executed immediately after the RTI, creating an infinite loop. Seemingly the IRQ isn't acknowledged at all--although this part of code ALWAYS gets executed.

So... Is there any problem with the code? Or, in what cases can this glitch occur?


Not much experience in IRQ issues (Gideon will probably agree on that! :P ), but this doc seems to stress "do not write 0 to $C000" (seems the behavior should best be considered undefined).
"My watch says 30 chickens" Google, 2018