I was just now having my ass kicked by the MMC3, I couldn't get it to fire a single IRQ, no matter what I tried.
Out of desperation, I tried something that fixed the thing: I enabled interrupts (with the CLI instruction) before entering the main loop that is interrupted by the NMI that sets the IRQ.
I was now hoping that someone could explain to me what just happened here... Every single game I looked at had a CLI instruction after the setting up of the IRQ (the writes to $C000, $C001 and $E001). In my startup routine, I have a SEI instruction, and I wasn't messing with the I flag anymore until the CLI that comes after setting up the IRQ. That wasn't working.
It only worked when I removed that CLI and placed it outside of the NMI routine, before the NMI routine runs for the first time.
Now, I really can't imagine why this is happening, can anyone help me out please?
Out of desperation, I tried something that fixed the thing: I enabled interrupts (with the CLI instruction) before entering the main loop that is interrupted by the NMI that sets the IRQ.
I was now hoping that someone could explain to me what just happened here... Every single game I looked at had a CLI instruction after the setting up of the IRQ (the writes to $C000, $C001 and $E001). In my startup routine, I have a SEI instruction, and I wasn't messing with the I flag anymore until the CLI that comes after setting up the IRQ. That wasn't working.
It only worked when I removed that CLI and placed it outside of the NMI routine, before the NMI routine runs for the first time.
Now, I really can't imagine why this is happening, can anyone help me out please?