write FF to MMC1

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

Moderator: Moderators

Post Reply
peste
Posts: 5
Joined: Thu Mar 10, 2011 9:57 pm

write FF to MMC1

Post by peste »

Hi -- I'm trying to get the MMC1 mapper working in my emulator.

It looks like the game I'm testing with (Metroid) starts by sending FF to all four registers. I am not 100% sure what state the mapper is supposed to be in after that point. In my emulator, for example, the reset bit resets all the bits associated with the control register to 0 so the MMC1 thinks it is in 32kb prg-rom switching mode and 8kb chr-rom switching mode.

Can someone verify if that is correct or set me straight?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Writing 1 to the high bit of any of the four registers makes these two changes to the mapper's state:
  • PRG ROM bankswitching mode set to fixed-$C000, as opposed to fixed-$8000 or 32 KiB mode
  • Shift register ready to accept a first write
This happens no matter where in $8000-$FFFF the write occurs. If Metroid is resetting four times, that's no different in effect from resetting once.
peste
Posts: 5
Joined: Thu Mar 10, 2011 9:57 pm

Post by peste »

I am confused by some of the language in the MMC1.txt document from this site. It says:
The "reset" signal is generated by writing a byte value whose high bit is a 1 to any of the four MMC1 registers. This signal affects the bits of reg0 as
follows:

bit 0 - unknown
bit 1 - unknown
bit 2 - reset to logic 1
bit 3 - reset to logic 1
bit 4 - unaffected
What does it mean by "reset to logic 1"? I was understanding it to mean that the mapper was set to 16kb prg-rom mode, as though 1 had been written to bit 2 and 3 of reg0.
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Post by doppelganger »

Precisely. And fixing $c000-$ffff to the last bank.
Be whatever the situation demands.
Post Reply