MC-ACC (again)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

MC-ACC (again)

Post by posit »

It may be worth bringing up the topic of correct emulation for the Acclaim MMC3-like chip again.

The information in the wiki is based on these 2 posts:
1. viewtopic.php?p=116691#p116691
...falling edge of A12 instead of the rising edge, so it occurs 4 PPU cycles later compared to MMC3
...in my emulator and the game is working correctly now
My interpretation could be totally wrong, but this seems to indicate emulator experimentation relative to understanding of MMC3, rather than hardware evaluation of some kind.

2. viewtopic.php?p=242427#p242427
Acclaim mapper counts every A12 pulse instead of waiting for long phase in low state. Counter clocking happens once per 8 A12 cycles at first cycle. Writing to $C001 resets pulse counter.
This is based on oscilloscope readings. In that post, prior to the oscilloscope test, the same theory was made about falling edge. However, the oscilloscope shows, from what I can tell, rising edge.

Now, the emulator I'm working on is perfectly cycle-edge accurate according to every test I can find, and this is what I've found:
1. Implementing the MC-ACC falling edge behaviour fails, in all cases
2. Implementing rising edge succeeds, IF
2a. 8-clocks-divider is reset immediately on writes to $C001
2b. IRQ counter is clocked on first divider clock at A12 (rising) edge as mentioned in the oscilloscope findings (though not shown in the posted images), not the 8th. Divider is reset on 8th A12 (rising) edge, of course.

This gives correct behaviour in Letterland, both on the goofy sequence getting into the truck, as well as the correct number of scanlines in the status bar during game play with no jumps at any time. It also matches the 2 glitchy far right hand side scanline at the top of the status bar as which is also seen in the recording from a front-loader here:
https://www.youtube.com/watch?v=qHQK1jpwY_I
This also correctly runs Crash Dummies and any other MC-ACC I've tried.

I suspect the wiki information/conclusion on falling edges is incorrect, and it also misses the details about $C001 and clocking on the first of 8 rather than the last from the divider.

A lot of emulators still get this wrong - usually with the scanline, or at least in Mesen's case I see the pre-level hop-in-the-truck sequence is faulty.

Do we have any actual evidence of a decapping or reading the signals aside from the oscilliscope tests in the link above to confirm? Can we/should we update the wiki?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: MC-ACC (again)

Post by lidnariq »

posit wrote: Wed Nov 09, 2022 12:22 pm However, the oscilloscope shows, from what I can tell, rising edge.
Nope, that's a falling edge. /IRQ falls in that linked picture at the same time that PPU A12 falls.
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

Re: MC-ACC (again)

Post by posit »

Ha right. IRQ goes low! Still, there is the matter of $C001 resets the divider, and the matter of irq clock on the first divider clock not the last. Also, interestingly, by clocking on high-to-low, the scanlines are still correct but the goofy sequency exhibits the same problem as Mesen. (need a "thinking" smily)
AND why does irq clocking low to high produce precisely the output that the frontloader video does? How curious.
User avatar
James
Posts: 431
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Re: MC-ACC (again)

Post by James »

posit wrote: Wed Nov 09, 2022 12:22 pm this seems to indicate emulator experimentation relative to understanding of MMC3, rather than hardware evaluation of some kind.
This was based off of logic analyzer measurements. I don't know why the image doesn't show up in the original post anymore, but here it is: http://nemulator.com/images/MC-ACC_IRQ.png
get nemulator
http://nemulator.com
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

Re: MC-ACC (again)

Post by posit »

Sweeeet thank you. That also potentially demonstrates the irq trigger on "first clock divider cycle".
If I clock the divider on low-to-high, and clock the irq on high-to-low, then I get good behaviour. Now I just wonder where the rest of the issue is and if that's right/wrong. Also that youtube video has other glitches on Letterland such as here https://youtu.be/qHQK1jpwY_I?t=725 so I'm curious about that - probably time to finally order an NES and the Mickey cart. I do wish analyzer or oscilloscope was cheaper.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: MC-ACC (again)

Post by lidnariq »

You should be able to use an inexpensive fx2lp=cy7c68013 for this - it "only" can do logic analyzer things at 24MSa/sec but that's probably ok for this.
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

Re: MC-ACC (again)

Post by posit »

Sweet. Just got the NES, and waiting for the logic analyzer to be delivered. Super, super surprised at that $15 price - in my experience this kind of thing is hundreds of dollars at least. Didn't occur to me to even look for something like this. Thank you for the suggestion!
posit
Posts: 15
Joined: Tue Oct 11, 2022 11:40 pm

Re: MC-ACC (again)

Post by posit »

This is thing is so tiny and and dare I say cute! Not what I expected at all - thanks again for the recommendation.
Post Reply