Expanding MMC1 from 256kb to 512kb

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
Pennywise
Posts: 67
Joined: Tue Jul 14, 2009 11:04 am

Expanding MMC1 from 256kb to 512kb

Post by Pennywise » Fri May 22, 2020 7:42 am

So, I'm translating a Famicom game that was originally a 256kb MMC1 game and I've expanded it to 512kb to whatever the variant is that swaps 256kb PRG blocks. So, I initially switched blocks whenever the pointer table read is past a certain value and then switch back out when the text is done being read. It worked fine, except that there seemed to be some cases where the game would inexplicably switch out the 256kb blocks. So, then I thought what if I just set a flag and run the block switch routine every time a text byte is read. For other reasons that didn't work as well.

I guess my question is if it's generally ok to make that conversion? I did the same thing with another MMC1 game years back and didn't encounter any issues.

Ice Man
Posts: 526
Joined: Fri Jul 04, 2014 2:34 pm

Re: Expanding MMC1 from 256kb to 512kb

Post by Ice Man » Fri May 22, 2020 8:33 am

Afaik, MMC1 can run 512KB just fine (SUROM and SXROM for example).
Both have 512KB PRG ROM and 8KB CHR RAM.

As long as tests prove it's working I don't see why it shouldn't be okay.

Pennywise
Posts: 67
Joined: Tue Jul 14, 2009 11:04 am

Re: Expanding MMC1 from 256kb to 512kb

Post by Pennywise » Fri May 22, 2020 1:09 pm

Yes, I already know all that.

I've decided to return to my first idea and try to isolate what's going wrong. It seems my hack fails whenever there's an interrupt and one of the writes to the registers resets the PRG block. So, I'm thinking there's some sort of conflict which perplexes me because I'm under the impression that the hack to access the additional 256kb would be unique to the MMC1 variant I changed the game to.

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

Re: Expanding MMC1 from 256kb to 512kb

Post by Dwedit » Fri May 22, 2020 10:34 pm

Watch out for writes that reset the MMC1, or writes that change the CHR banking.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

Fiskbit
Posts: 113
Joined: Sat Nov 18, 2017 9:15 pm

Re: Expanding MMC1 from 256kb to 512kb

Post by Fiskbit » Sat May 23, 2020 5:58 am

Yeah, if you don't know why it's switching, set a breakpoint for writes to $A000-BFFF and see what's writing to it before you intentionally switch back to the old half. I used SXROM for the Zelda 1 / Metroid 1 combo randomizer and didn't have any particular issues with it outside of emulator & flash cart compatibility problems (mostly with the SRAM banking) and the typical difficulties with MMC1's clunky serial register system. You might want to make sure your NMI isn't interrupting MMC1 register writes such that it messes up later writes, though I'd expect this sort of issue to cause a crash.

Resetting MMC1 is fine if you use it correctly, since it doesn't reset the CHR state used here for selecting the ROM half. If you're trying to deal with the NMI interrupting MMC1 writes, you'll likely need to make use of MMC1 reset to clear the shift register.

Post Reply