Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - Need Help With This - ROM Expansion/Mapper Changes | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Rockman

Flurry
Level: 26

Posts: 220/250
EXP: 96387
For next: 5888

Since: 03-17-04

Since last post: 18 days
Last activity: 16 days
Posted on 05-07-05 11:18 AM Link | Quote
I decided to put up a picture. Maybe this can help anyone understand what I need help with.



GOAL: To add a MMC3 Mapper to Super Mario Bros., and expand the ROM to have more space.

Something has pulled me back in. I need to understand how this stuff works. How many 16K banks do I have to add, and where exactly do you add these. I just don't get this...............

I need clarification on what I have circled above.

Also, the second digit of the Mapper byte, what does that stand for, how many 16K banks there are?
Dish

Spiny
Level: 38

Posts: 395/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 05-07-05 11:51 AM Link | Quote
Offset $00004 = Number of 16k PRG banks. (keep a power of 2 value!)
Offset $00005 = Number of 8k CHR banks (0 implies 8k of CHR RAM -- no CHR ROM in the .nes file) (keep a power of 2 value!)
High 4 bits of Offset $00006 = Low 4 bits of mapper number
High 4 bits of Offset $00007 = High 4 bits of mapper number

The Low 4 bits of Offset $00006 specifies hardwired mirroring mode (if mirroring is hardwired), and has the SRAM flag (whether or not the ROM uses a .sav file):

Bit 3: If on, game uses 4-screen mirroring
Bit 2: If on, 512-byte trainer exists before PRG data (don't bother with this)
Bit 1: If on, game uses a .sav file to save SRAM
Bit 0: 0 = Horizontal Mirroring. 1 = Vertical Mirroring (assuming bit 3 is off)

Note 4 screen mirroring should only be used on mappers which support it (only one I know of is MMC3)


Following that 16 byte header is the 512 byte trainer (if it exists -- it usually doesn't). After that is all the PRG pages, followed by all the CHR pages.


Typically mappers need a nice even power-of-2 value for PRG/CHR sizes, so if you expand PRG/CHR, the minimum you can add is doubling what's there. So in SMB, to expand you'd have to bump it up to 64k PRG. Be sure not to go over the maximum the mapper allows (this won't be a problem for you though -- MMC3 can hold plenty more than 64k PRG and however many CHR pages you want to add [within reason])

Where to add the extra PRG depends on the mapper. MMC3 has the last 8k "hardwired" to $E000-$FFFF -- you'll probably want to keep this here (this is where the Reset/NMI/IRQ vectors are -- they need to be at $FFFA), so if you add PRG, you want to add it before that bank. Typically your best best is to squeeze in your extra PRG right before the last 16k of PRG. So if you double SMB's PRG, squeeze in the extra 32k at offset $04010


(edited by Disch on 05-06-05 07:12 PM)
dan

Snap Dragon
Level: 43

Posts: 564/782
EXP: 534516
For next: 30530

Since: 03-15-04

Since last post: 20 hours
Last activity: 14 hours
Posted on 05-07-05 04:07 PM Link | Quote
Marat's website has a document on the iNES format.
Rockman

Flurry
Level: 26

Posts: 223/250
EXP: 96387
For next: 5888

Since: 03-17-04

Since last post: 18 days
Last activity: 16 days
Posted on 05-08-05 12:23 AM Link | Quote
Thanks a lot guys. Very appreciated. I will try to apply this when I try again later.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - Need Help With This - ROM Expansion/Mapper Changes | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.017 seconds.