Points of Required Attention™
Smaghetti, a new Super Mario Advance 4 editor, is currently in development! Check out the thread HERE!

Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,318,735
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 03-29-24 11:42 AM
Guest: Register | Login

0 users currently in ROM Hacking | 4 guests | 1 bot

Main - ROM Hacking - Expanding a NES ROM? New thread | New reply


Jimmy52905
Posted on 05-05-10 06:16 AM Link | Quote | ID: 130900


Paratroopa
Level: 29

Posts: 151/152
EXP: 144044
Next: 3841

Since: 01-25-08

Last post: 5076 days
Last view: 4132 days
Well...figured I'd ask since I have no idea how to do this.
Basically, as the title says, I would like to know what exactly I have to do in order to expand a NES ROM. I am working on a hack of Mega Man 1, which is a ridiculous 128 KB in ROM size. With such limited size and freespace, it's pretty much impossible to do any heavy ASM hacking. Expanding the ROM would definitely help a lot. However, I have been told that expanding a NES ROM would be extremely difficult, and that it's more than just simply adding a bunch of 00s after the end of the data (much like expanding a SNES ROM.) Regardless of this, I would like to know what exactly I would have to do in order to achieve this.

Would anyone here be willing to explain to me how I would go about doing this?

____________________
Come join my IRC channel, #Megahax for Mega Man hacking related discussions.

Matrixz
Posted on 05-05-10 03:59 PM (rev. 2 of 05-05-10 04:43 PM) Link | Quote | ID: 130923


Ninji
Level: 35

Posts: 90/225
EXP: 265777
Next: 14159

Since: 04-07-07
From: Norway

Last post: 3078 days
Last view: 1755 days
There is PRG-ROM and CHR-ROM. CHR-ROM is always graphics but its not always used, in which case graphics are a part of PRG-ROM. Disregard all this, becouse Megaman 1 doesn't use CHR-ROM, which simplifies things.

Step 1: Modify NES header.
The 5th byte in the ROM tells the number of PRG-ROM banks. (One bank is $4000 bytes). When adding more banks, i think it always needs to be twice as much as the old amount. Change it to 10 (hex).

Step 2: Add the new pages.
The last PRG-ROM bank needs to remain as the last one. (Its kind of the boot sector of the NES rom, so it must be at a fixed location). In MM1, it starts at 1C010. You will insert the new banks here. Insert $20000 bytes (with any value), the same amount of bytes the ROM originally was. Save.

VoilĂ .

(edit: corrected mistakes.)

Kawa
Posted on 05-05-10 04:04 PM Link | Quote | ID: 130926


CHIKKN NI A BAAZZKIT!!!
80's Cheerilee is best pony
Level: 138

Posts: 3649/5344
EXP: 30875930
Next: 787051

Since: 02-20-07
From: The Netherlands

Last post: 4470 days
Last view: 2605 days
Posted by Matrixz
The 4th byte in the ROM tells the number of CHR-ROM banks. (One bank is $4000 bytes). When adding more banks, i think it always needs to be twice as much as the old amount. Change it to 10 (hex).
Considering MM1 doesn't use CHR-ROM, as you stated, don't you mean "the 4th byte in the ROM tells the number of PRG-ROM banks"?

____________________
Wife make lunch - Shampoo
Opera - give it a spin
Spare some of your free time?
<GreyMaria> I walked around the Lake so many goddamn times that my sex drive was brutally murdered
Kawa rocks — byuu

Matrixz
Posted on 05-05-10 04:39 PM Link | Quote | ID: 130932


Ninji
Level: 35

Posts: 91/225
EXP: 265777
Next: 14159

Since: 04-07-07
From: Norway

Last post: 3078 days
Last view: 1755 days
Sorry, im not concentrated today Yes i meant PRG-ROM. Also its the 5th byte of the ROM (when counting from 1), not the 4th. I will add it to my testimony..

Jimmy52905
Posted on 05-06-10 01:06 AM Link | Quote | ID: 130942


Paratroopa
Level: 29

Posts: 152/152
EXP: 144044
Next: 3841

Since: 01-25-08

Last post: 5076 days
Last view: 4132 days
Well thanks for the info guys. However, there is a slight problem...I went to 0x1C010 in a hex editor to add the new banks, but...

1C010: 00 01 02 03 04 05 06 07 78 A9 01 8D 00 20 A9 06

I assume that in the bolded part is where I would write the values 08 - 0F for the new banks. But as you can see, instead of freespace in those last 8 bytes, there is code there. Adding those 8 bytes could be disastrous to the ROM. Is there some way around this or something?

____________________
Come join my IRC channel, #Megahax for Mega Man hacking related discussions.

KP9000
Posted on 05-06-10 01:35 AM Link | Quote | ID: 130943


Boomboom

Level: 90

Posts: 1304/1975
EXP: 6937864
Next: 250745

Since: 02-19-07

Last post: 3552 days
Last view: 3176 days


I keep seeing this everywhere; but why does everyone insist that "freespace" is one word? It's free space, no matter how you look at it. It's the correct terminology and anything else is not logically sound.

And I wish I could get back on topic but all I know about expanding is that usually there are mappers involved. I know DD has expanded SMB3 ROMs for Reuben and his own hacks (and SMB1) but I know nothing else.

My theory is that your code issue here is a limitation of the mapper. Just a very uneducated guess though.

____________________

JaSp
Posted on 05-06-10 10:57 PM Link | Quote | ID: 130961


Shyguy
Level: 24

Posts: 76/95
EXP: 73124
Next: 5001

Since: 03-02-07
From: Paris, France

Last post: 4322 days
Last view: 4117 days
Posted by Jimmy52905
Well thanks for the info guys. However, there is a slight problem...I went to 0x1C010 in a hex editor to add the new banks, but...

1C010: 00 01 02 03 04 05 06 07 78 A9 01 8D 00 20 A9 06

I assume that in the bolded part is where I would write the values 08 - 0F for the new banks. But as you can see, instead of freespace in those last 8 bytes, there is code there. Adding those 8 bytes could be disastrous to the ROM. Is there some way around this or something?
Actually, there should be code here. As the last PRG-ROM, it's where the first code executed when you boot the game is located; so since you want to add PRG-ROM banks, the last bank needs to be moved so that the game doesn't boot into your new expanded blank bank (since you probably won't need all the banks you add). The preceding bytes (00 to 07) are actually the end of the previous bank and seem to be some data of some sort and are irrelevant to your ROM expansion problem (not sure though,correct me if I'm wrong).
I believe you can find some tutorials on Romhacking.net that might help you to better understand the process.

Now, this is the first part to get the technical expansion, but then comes the usage of these new banks - meaning getting to know bank switching and all. I've only worked on MMC3 for Super Mario Bros 3 so I can't be of any help about MMC1. This document may help however (mapper 001.txt).

Pikachumanson
Posted on 03-07-13 08:55 AM Link | Quote | ID: 153512

Newcomer
Level: 7

Posts: 2/6
EXP: 934
Next: 514

Since: 03-04-13

Last post: 3945 days
Last view: 3924 days
Sorry to Necrothread, but i am also having the exact same problem with the reset routine. Except, the nes game is Outlanders. Anyone have any new info on this? Like is there a way to split the reset routine up so i can put my expanded bank there? I have thirteen bytes free from optimizing the controller routine.

Main - ROM Hacking - Expanding a NES ROM? New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.022 seconds. (340KB of memory used)
MySQL - queries: 67, rows: 95/95, time: 0.016 seconds.