Page 2 of 2
Re: MMC1 failing on hw, working in emulators
Posted: Wed Oct 19, 2016 8:43 pm
by 3gengames
Yeah, they all showed initial boot state of the mapper like WRAM enabled, banks accessible, etc. Here's the ROM from archive, should be most recent AFAIK:
https://drive.google.com/open?id=0B1laU ... WxfMDg1MVk
It should give you the info you want. Turn power off for a little while, turn it on, and if it boots in random banks, it'll change. Like I said, IIRC MMC1B2 iss the only one I remember always booting in the last bank. MMC1 and MMC1A all boot randomly, if I remember correctly. If you want the source, I'll put it on Github.
Re: MMC1 failing on hw, working in emulators
Posted: Thu Oct 20, 2016 2:05 am
by calima
Thanks, will report back. Looks very useful, why not post it to a permanent location and link from the wiki?
Re: MMC1 failing on hw, working in emulators
Posted: Thu Oct 20, 2016 8:46 pm
by rainwarrior
calima wrote:Why not post it to a permanent location
This forum is a pretty good place to upload it.
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 6:54 am
by calima
It was a Retrostage board, and it consistently booted in 0f / the last bank.
Now I'm completely out of ideas. Why would a MMC1 ROM work in emulators but not in hw, if the init code is correctly reached?
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 9:30 am
by thefox
Have you made sure to initialize all mapper registers?
Is it possible that their MMC1 implementation is somehow incompatible? (There are some minor details that one might get wrong, like the ignoring of double-writes and the fact that only the address of the last write determines the target register. Whether this would be an issue depends on how your program uses MMC1, though.)
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 11:12 am
by 3gengames
Make sure the pointers for NMI and such in the last bank 0F point to the upper region and not the lower one? Maybe it's made to assume two boot banks in order and it is booting into the lower bank instead of the upper, which still fails. My test program there always boots to the upper bank and all the code is there, too.
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 11:38 am
by calima
Yes, the init code is in the upper bank, starting at 0xFEDA.
This is the MMC1 part:
Code: Select all
; MMC1 init
lda #$80
sta $8000
lda #$00
sta $e000
sta $e000
sta $e000
sta $e000
sta $e000
sta $8000
sta $8000
sta $8000
sta $8000
sta $8000
NMI shouldn't matter, since interrupts are disabled when in there.
edit: I wonder if Retrostage is a member here?
@3gengames
So the test ROM couldn't detect booting to an odd bank?
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 11:45 am
by Dwedit
One last dumb idea:
NES consoles are finicky in general about cartridges. Clean it and blow on it?
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 12:00 pm
by 3gengames
It will detect booting in an odd bank because the odd bank will appear in the last bank and be booted from. That's what the bank booted in will tell you, what bank appeared in the upper region at first.
Re: MMC1 failing on hw, working in emulators
Posted: Fri Oct 21, 2016 2:39 pm
by tepples
Try burning an appropriately sized Holy Diver Batman ROM to the cart.
Also put this in the last 15 bytes of all banks (starting at base + $3FF1):
Code: Select all
entry_fff1:
sei
lda #$FF
sta entry_fff1+2
jmp reset_handler
.assert reset_handler >= $C000, error, "reset handler must be in the fixed bank"
.addr nmi_handler, entry_fff1, irq_handler
"Why write $FF over $FF? I thought MMC1 didn't have bus conflicts."
It doesn't. I designed this code to work not only on MMC1 but also on AOROM, BNROM, and the mapper 180 variant of UNROM.
Re: MMC1 failing on hw, working in emulators
Posted: Mon Oct 24, 2016 8:24 am
by calima
Retrostage wrote:My mapper is based off of the MMC1B, which during power-on will default to a 16Kb banking and PRG-RAM enabled state. $C000-$FFFF is fixed on power-up.
Mystery continues as time allows.