Padding a rom? Will it work with carts?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
Tormenter
Posts: 303
Joined: Sat Jun 03, 2006 9:17 pm

Padding a rom? Will it work with carts?

Post by Tormenter » Wed Sep 10, 2008 1:59 pm

There is a rom of a game that I want to throw on cart, but the actual size of the rom is a 1.5 meg file, instead of a standard 1 or 2 meg. Is there a way to pad the file to like 2 megs? (Or split the file into A/B and just pad those files up to 1 meg size) would the game still work? Thanks!

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Wed Sep 10, 2008 3:17 pm

Yes, there are a few ways to pad the file depending on how the game expects the board to map ROM:

-The mirrored memory way: this is caused by both ROMs being selected from the same decoder. Because the second ROM is smaller than the first ROM, but is still selected in the same size window as the first ROM, it will ignore the more significant address lines and appear mirrored. To fill the 0.5MB with mirrored data, just copy the last 0.5MB from the 1.5MB file and paste it at the end. Likewise if you have a 12M (1.25MB) game, copy the last 2M four times until it fills up 16M (2MB). On the few SNES boards I've seen, this is how they handle unmatched ROMs.

-The open bus way: this is caused by one ROM being selected by a memory decoder, and the second (smaller) ROM being selected by another decoder. From 1.5Mb onwards (probably until 2MB) the values will be "open bus" as a result of nothing responding to that address range. To fill the last 0.5MB with open bus, you'll have to ask a SNES expert who knows what to fill this with. I believe very few games use this method, and do so as a form of copy protection.

-The don't care way: most games just won't care what memory beyond 1.5MB will be, you can fill it with whatever you want because they never access it.

Tormenter
Posts: 303
Joined: Sat Jun 03, 2006 9:17 pm

Post by Tormenter » Thu Sep 11, 2008 12:22 pm

How would I do this? There a game I am trying to make, and the rom is a 1.5 meg file, if I split this file to .75 megs, would I just fill those up to the full meg? 1024 ?

Or could I pad the file to 2 megs, and then split the rom and burn the chips that way?

What program/how would I do this? Thanks

shadowkn55
Posts: 31
Joined: Tue Aug 14, 2007 7:02 am

Post by shadowkn55 » Thu Sep 11, 2008 12:36 pm

If you want to pad your rom with zero's. You can use ucon64 to do it and then split it into two 8mbit files.

ucon64 -p rom.smc (do this 4 times)

ucon64 -s rom.smc (do this after the desired size is reached)


If you want to mirror the last chunk of the rom, use snestool to split the rom (8mbit split size). You'll get two files: rom.1 (8mbit) and rom.2 (4mbit). Make sure you use "delete header" on rom.1 before exiting. It will also automatically delete the header on rom.2 as well. Finally do this in command prompt:

copy /b rom.2 + rom.2 rom.2+2

Rom.1 and rom.2+2 should be suitable for burning onto 8mbit eproms.

User avatar
TmEE
Posts: 753
Joined: Wed Feb 13, 2008 9:10 am
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
Contact:

Post by TmEE » Fri Oct 10, 2008 12:11 pm

I don't see any reason to pad ROMs for use on real HW unless game wants something from the area beyond ROM as pointed out before... if it works in emulator, it will do so on real HW, unless there's some bugs (in case of homebrew). Emulators don't usually emulate address wrapping and such... at least not MD emulators.

Near
Founder of higan project
Posts: 1550
Joined: Mon Mar 27, 2006 5:23 pm

Post by Near » Fri Oct 10, 2008 3:30 pm

Emulators don't usually emulate address wrapping and such... at least not MD emulators
All but ZSNES do for the SNES. It's left out there as a speed optimization.

bsnes and SNEeSe also emulate the odd quirks like the new instruction stack wrapping bug in emulation mode.

Anyway, older emulators had copy protection issues in games like MMX. Pad with the last 4mbits doubled. This is what all emulators do now, and I've not heard of any games not working as a result.

User avatar
TmEE
Posts: 753
Joined: Wed Feb 13, 2008 9:10 am
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
Contact:

Post by TmEE » Sat Oct 11, 2008 5:24 pm

Ok, good to know... it seems I've got to do some padding on some games as I intend to use my MD flashcart (with an adaptor) on SNES... and its full 4MBytes.... I hate padding ROMs, makes flashing so much longer :P

cybertron
Posts: 57
Joined: Sat Sep 20, 2008 8:50 pm
Location: Canada

Post by cybertron » Sat Oct 11, 2008 7:57 pm

By all accounts your game should work without any extra padding

But if you are using a 2MB chip anyways, you might as well duplicate the last 512k, it wont hurt

I am curious, which games DO need mirroring?

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sat Oct 11, 2008 8:26 pm

For sure Mega Man X. Probably other 10,12,20,24M games with copy protection.

cybertron
Posts: 57
Joined: Sat Sep 20, 2008 8:50 pm
Location: Canada

Post by cybertron » Sun Oct 12, 2008 7:13 pm

I put Mega Man X on my flash cart, and it seemed to work fine playing through the first level with only 1.5 MB

Some games display a nasty message when you start it up with the wrong SaveRAM size. Maybe this is the only thing they look for, since it depends on hardware only and ROM mirroring is easy to fake.

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sun Oct 12, 2008 10:00 pm

It's easy to fake but very few copiers do it, and none have options to model mirroring after actual game boards.

User avatar
TmEE
Posts: 753
Joined: Wed Feb 13, 2008 9:10 am
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
Contact:

Post by TmEE » Mon Oct 13, 2008 2:02 am

In my case, mirroring gets a bit difficult as I have 2x 16Mbit 8-wide chip in parallel for MD... 8MBit games could have mirroring done easily (just one address line gets disconnected) but not above 8Mbit... ROM padding makes things easier in this case.

Post Reply