Acmlm's Board - I2 Archive - Rom Hacking - Need Help With This - ROM Expansion/Mapper Changes
User | Post |
Rockman
Posts: 223/250 |
Thanks a lot guys. Very appreciated. I will try to apply this when I try again later. |
dan
Posts: 564/782 |
Marat's website has a document on the iNES format. |
Dish
Posts: 395/596 |
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 |
Rockman
Posts: 220/250 |
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? |
|