MMC3 IRQ disable ($E000-$FFFE, even)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
colinvella
Posts: 74
Joined: Sun Jun 05, 2016 1:41 pm

MMC3 IRQ disable ($E000-$FFFE, even)

Post by colinvella » Wed Jun 29, 2016 3:13 am

My IRQ counter code for MMC3 seems to be working well. For instance, the screen splits nicely in Super Mario 3 to allow for the game stats HUD at the bottom to be rendered independently of the scrolling level. I have not encountered any issues per se (I've yet to test MMC3 extensively on this), but I do have a question concerning the phrase "acknowledge any pending interrupts" as in the case of the IRQ disable register in MMC3

Code: Select all

IRQ disable ($E000-$FFFE, even)
7  bit  0
---- ----
xxxx xxxx
Writing any value to this register will disable MMC3 interrupts AND acknowledge any pending interrupts.
What does "acknowledge any pending interrupts" really mean? Should the MMC3 signal the CPU to do the interrupt at this point?

Thanks
Tile IDE and tile engine for XNA: http://tide.codeplex.com/
Fancy Fish Mod - Minecraft Mod: http://fancyfishmod.weebly.com/

User avatar
Dwedit
Posts: 4246
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: MMC3 IRQ disable ($E000-$FFFE, even)

Post by Dwedit » Wed Jun 29, 2016 3:15 am

Acknowledge means that it TURNS OFF the IRQ pin. Otherwise it would keep triggering interrupts over and over again.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
Quietust
Posts: 1500
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: MMC3 IRQ disable ($E000-$FFFE, even)

Post by Quietust » Wed Jun 29, 2016 4:43 am

Dwedit wrote:Acknowledge means that it TURNS OFF the IRQ pin. Otherwise it would keep triggering interrupts over and over again.
To clarify, the IRQ signal is level-sensitive (compared to NMI, which is edge-triggered) - once the timer expires, the IRQ signal is activated, and the CPU will jump to the IRQ handler at every possible opportunity (i.e. whenever the "I" flag is clear). To prevent the CPU from getting stuck in a loop rerunning the IRQ handler over and over, it needs to tell the hardware that generated the interrupt that it's done handling it and that it can deactivate the signal, and for the MMC3 this involves writing any value to $E000.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

Post Reply