Super Mario Bros on MMC3

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Gameon
Posts: 2
Joined: Fri Nov 09, 2012 9:14 am

Super Mario Bros on MMC3

Post by Gameon »

Super Mario Bros 2 and 3 and the Japanese Super Mario Bros 2 FD conversion all run on the MMC3

I know with a simple counter 74 chip and a large EPROM it is possible to cycle running these games on a MMC3 board just by pressing the reset button.

For an video games exhibition I want to have all the Super Mario Games running on a NES, however the original SMB doesn't use a mapper and I was wondering if there would be any way to get SMB to work on a MMC3 mapper.

There may be other ways to do what I need but I would prefer a simple reset to select the next game.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Super Mario Bros on MMC3

Post by tepples »

SMB1 can run on the same sort of MMC3 board as the MMC3 version of SMB2 (J) if you hack it to set all the banks first.

I forget: does the MMC3 version of SMB2 (J) use CHR ROM or CHR RAM?
User avatar
Roni
Posts: 114
Joined: Fri Sep 26, 2008 7:55 pm
Location: Montreal
Contact:

Re: Super Mario Bros on MMC3

Post by Roni »

I suppose you could have an version of SMB that has its program duplicated in every bank that could be accessed so that it could run regardless of the state of the mapper, precluding the need for a init code. Or write an mapper init routine into one of the unused banks to run right before SMB starts running. I'm sure there are many other possibilities i'm not thinking of.

I don't think it's really something I could test out right now, I think it would require programming some new mapper into a emulator involving your 74 chip and big ROM, added to the TSROM or whatever board.


Tepples: SMB2(J) doesn't appear to be on bootgod's site. Is it an bootleg?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Super Mario Bros on MMC3

Post by tepples »

The MMC3 version of SMB2 (J) is a mapper hack (by the homebrew community) of a bootleg (by Chinese pirates).

MMC3 fixes only $E000-$FFFF, and I think SMB1's reset vector is in $8000-$9FFF. Any bank, including the last fixed bank, could in theory be switched into $8000-$9FFF at power on. At least some of the mapper init would have to be in $E000-$FFFF, but armed with doppelganger's SMBDis, it should be straightforward to patch in any mapper init you need.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Super Mario Bros on MMC3

Post by lidnariq »

There is a version of SMB1 in the NWC/SMB/Tetris multicart that runs on an MMC3, and a little bit of effort with a debugger will let you extract the right slices.
Gameon
Posts: 2
Joined: Fri Nov 09, 2012 9:14 am

Re: Super Mario Bros on MMC3

Post by Gameon »

Glad I was not asking an insane question then. :)

I will point the information you guys have given me to the person who will be making me the multicart, as I also need him to put back in the (C) Nintendo message in the SMB2(J) hack, so that Nintendo will be happy.

Thanks again.
flagoss
Posts: 71
Joined: Tue May 05, 2009 8:44 pm

Re: Super Mario Bros on MMC3

Post by flagoss »

Someone have found a way to make Super mario Bros works on MMC3 ?
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Re: Super Mario Bros on MMC3

Post by doppelganger »

Running SMB in MMC3 is easy. All you need to do is move the reset routine to $E000-$FFFF, add some code to switch in the proper banks, pad the binary to fit the ROM if you plan on burning it to an E/EPROM (best thing to do is duplicate the banks), and reassemble.
Be whatever the situation demands.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Super Mario Bros on MMC3

Post by tepples »

But where in $E000-$FFFF would the reset stub fit? Wouldn't the music engine need moved?
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Super Mario Bros on MMC3

Post by MottZilla »

SMB is packed pretty full of code and data. However if you had a menu that runs to select your game, you could have the menu do your register setup for SMB.
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Re: Super Mario Bros on MMC3

Post by doppelganger »

tepples wrote:But where in $E000-$FFFF would the reset stub fit? Wouldn't the music engine need moved?
I assume you're referring to the stub needed for the MMC3.

It is true that SMB is tight on code and data. But it's also true that portions of the code are redundant or unreachable, that is, either they never execute, or they execute but accomplish nothing.

Two examples: the routine ResidualMiscObjectCode at $e392-$e39b is never executed. The JSR instructions at $90bf-$90c4 jump to two separate points in the routine DoNothing at $92aa-$92af, which writes to a variable that is never used.

Those two examples alone, plus the 13 unused $ff bytes, give 35 bytes, which should be enough to write a short MMC3 bank init routine.
Be whatever the situation demands.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Super Mario Bros on MMC3

Post by MottZilla »

Then write it and you'll know. You need to setup the 6 CHR registers and two PRG registers. Mirroring register too.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Super Mario Bros on MMC3

Post by tepples »

Let's play 6502 golf.

Code: Select all

  ; 28 object code bytes
  ldx #$07
loop:
  stx $8000
  lda mmc3tbl,x
  sta $8001
  dex
  bpl loop
  sta $A000  ; set vertical mirroring, or use stx for horizontal
  jmp rest_of_reset
  ; A=$00 and X=$FF at end, so ready for $2000/$2001 writes and TXS
mmc3tbl:
  .byt 0,2,4,5,6,7,0,1
There are also 16 bytes to be had by overlapping BrickShatterEnvData with BowserFlameEnvData.
GameMachineJames
Posts: 45
Joined: Mon Feb 04, 2013 8:48 am

Re: Super Mario Bros on MMC3

Post by GameMachineJames »

Ohhh, Mario MMC3 conversions. my faaaaavorite subject! Haha!

If there's one ting left I wish I had, it'd be a menu.
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Re: Super Mario Bros on MMC3

Post by doppelganger »

tepples wrote:Let's play 6502 golf.
Super Mario Bros code is full of rough and sandtraps, but you managed to pitch it onto the green with plenty of strokes under par. Good job.
Be whatever the situation demands.
Post Reply