Saturday, February 5, 2011

Guide to NES Romhacking


Updated 4-10-2013. Well, it's pretty obvious that this guide is outdated, and was outdated from the start. If you want to do any NES romhacking, you should check out FCEUX, an excellent emulator that has all the functionality of the separate tools listed below. That said, I still made Proto Man 2, BLOCK, etc. without all the fancy new bells and whistles of FCEUX. Was I living in the past and out of touch? Seems so, but that's kind of the point, isn't it?

NES rom hacking is difficult, but not that difficult. It can be tedious, but with a little dedication and study you can break apart your childhood favorites and bend the code to your will. There are some utilities you can use to make your life easier.

First, the emulator Nesticle is essential. You can use it to look up the Hexidecimal values for palettes and graphics, which you can then change in Thingy or Hexposure. Press F4 for the palette, or F2 for the graphics tables.

For text editing, use Nesticle to see the graphics table. Find the alphabet and any other characters you are interested in editing in thingy.

Then, created a romname.tbl file that simply has the hex value, followed by the in-game value. For example, here is the Mega Man 2 Text HEX Value table:

C0=
C1=A
C2=B
C3=C
C4=D
C5=E
C6=F
C7=G
C8=H
C9=I
CA=J
CB=K
CC=L
CD=M
CE=N
CF=O
D0=P
D1=Q
D2=R
D3=S
D4=T
D5=U
D6=V
D7=W
D8=X
D9=Y
DA=Z
DB=r
DC=.
DD=,
DE='
DF=!

Sweet. Now, I've saved this file as protoman2.tbl, and put it in a C:\DOS\Thingy directory. I mount my C:\DOS folder in dosbox and run thingy. Now I can edit the text, and search for strings. Keep a backup of your file with HEX editing...there is no save function, all changed are just applied instantly.

You can download Thingy here.

And Hexposure, another Hex Editor. Hexposure was useful when I messed up some text by making the strings too long. I could look at the code for an old version of the file and use them to replace the hex values in the current file. It was a tedious process, but it worked!

But, you might just want to edit the graphics to a game, nothing major. Well, changing even 1 detailed sprite can be a tedious task, but Tile Layer Pro is the best editor around.

If you want to change the palette, however, that will take more work. Unless your game has an editor which can accomplish palette changing (Like MegaManFLE, for example) you need to run the ROM is Nesticle and hit F4 to see the palettes. Mega Man's palette might be 0F 0F 21 11 for example (Transparent, Black, Light and Dark Blue). Downloaded NES Palette Editor, and be sure to grab the 2007 release.

You'll probably need to download DOSBox, a DOS emulator to run all of these programs correctly. They have a main page you can check out.

Generally you should check romhacking.net and zophar.net for any special utilties for the games your working on. DOSBox is a DOS emulator which can easily run DOS programs in Windows XP, Vista, 7, etc. I think it works for MACs and 'Nix users, but maybe not. You'll want to put any program you wish to use in DOSBox in its own c:\dos\ directory. Then, run DOSBox. In the console, type

mount c: c:\dos

and this will create a virtual drive C:, in the emulator, which contains everything in C:\DOS\ Now you can just navigate around like you would 20 years ago. Type C: to get to your drive, the cd hexposure (just as an example). If I have a C:\DOS\Hexposure folder on my computer, in DOSBox I'll see the files under C:\Hexposure.

Finally, check out this much more in-depth tutorial that provided me with tons of useful information over the past years. Click here for NES Player's Beginner's Guide to Romhacking.

4 comments:

  1. I remember doing this around the 00's, good times! :)

    ReplyDelete
  2. Is it possible to hack Castlevania to make totally new levels and art? I kind of want to do this, but don't know how hard it is.

    ReplyDelete
  3. It's always possible, and it's always hard :D

    There is an editor for Castlevania called "Stake" that might be good. Otherwise you have to get into hex editing randomly. Basically you'd mess up the code, then see what changed, then figure out what those bits did.

    Changing the graphics is a lot easier. Tile Layer Pro is your first and only line of defense there.

    ReplyDelete
  4. Is it possible to edit Capcom's gold medal Challenge '92?

    ReplyDelete