News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Curious about a problem with the MMC3 IRQ.  (Read 2161 times)

w7n

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Curious about a problem with the MMC3 IRQ.
« on: September 29, 2013, 08:54:32 am »
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
...
RTI

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?
« Last Edit: September 30, 2013, 10:11:20 am by w7n »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7098
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Curious about a problem with the MMC3 IRQ.
« Reply #1 on: September 30, 2013, 08:40:29 pm »
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