Rom programming, editing

Started by nurd, February 28, 2014, 11:04:02 am

Previous topic - Next topic

nurd

February 28, 2014, 11:04:02 am Last Edit: March 10, 2014, 02:36:42 pm by nurd
i have a chip i'd like to have a gameboy rom written to :pacman:

does anybody on this forum within the united states have the required device to do this?  :help:

i'd pay a lil fee and shipping charges of course

the only online service like this i've seen was based out of the UK, and would end up costing a silly amount with shipping

nurd

Also wondering if i can get any tips on gameboy text editing.

There's a mario land hack called Pika Land, but it's not quite complete.

Whoever started it never got around to editing the word "MARIO" in the upper left corner, where they changed it to say "ASH" in another hack of theirs, Pokemon Land.

I'd like to change this to say "PIKA"

I've looked at the game through tile and hex editors and i still cant figure out just where to make these changes

L___E___T

My for Sale / Trade thread
http://www.famicomworld.com/forum/index.php?topic=9423.msg133828#msg133828
大事なのは、オチに至るまでの積み重ねなのです。

UglyJoe

March 10, 2014, 07:43:02 pm #3 Last Edit: March 10, 2014, 07:48:54 pm by UglyJoe
Step 1: Determine which byte equals "A"
  • Open ROM in WindHex
  • WindHex is a good hex editor for rom hacking, since it has some features that most hex editors do not have (of note: relative searching and table file support).  The view is pretty much what you'd get in any hex editor.  The left column shows addresses -- these addresses are the starting offset of each line.  The middle column is the hex view.  Every file is made up of bytes, and each byte is 8 bits.  Hex editors display each byte in hexidecimal format (for a number of reasons, one of which being that it makes things line up nice and evenly without taking up a lot of space per byte).  The right column is the ASCII view.  Hex values of 20 through 7E make up the standard alphabet in ASCII (letters, numbers, punctuation), so these values are displayed here.  Any other value are displayed as dots, so it's easier to spot text at a glance.
  • Search -> Relative Search (I usually check "Ignore Case" and "Start Search From the Begining")
  • Type in "mario" and hit search
  • You'll get three results.  If you double click each of the results, the cursor will jump to the beginning of the search result.  In each case, you'll see that it finds "16 0A 1B 12 18".  This corresponds to "M A R I O", therefore 0A is "A".
  • The basic theory here is that most games will store their alphabet in a logical fashion.  Some byte will be "A".  That byte plus one will be "B", plus two will be "C", etc.  So, looking at our search string "mario", we know that we'll find some series of bytes with values "? -12 +17 -9 +6".  If we convert our hex result into decimal we get "22 10 27 18 24".  22 -12 is 10. 10 + 17 is 27. 27 - 9 is 18. 18 + 6 is 24.  Make sense?  You're not searching for "mario", you're searching for the value of "a" relative to "m", then the value of "r" relative to "a", and so on.

    .



    Step 2: Build a table file
  • Leave WindHex open, but also open up TBLater.
  • Since we determined that 0A is "A", click on the 0A cell and type "A".
  • Go to the "Automation" menu, and choose "Auto ALPHABET".  This will fill in the rest of the letters for you.
  • Save the table file as "marioland.tbl" or whatever.  (The "tbl" extension is commonly used for table files).
  • Open up the table file in notepad, if you're curious (it's better if you are).  It's just a simple map of 0A=A, 0B=B, etc.  Very, very simple.

    .



    Step 3: Load the table file and find your text
  • Switch back to WindHex.
  • Go to File -> Open Table File -> Table #1, and select the table file you just saved.
  • What that just did is modify the viewer so that the ASCII column shows the table value for any corresponding hex values.
  • Now you can view and edit the game's text pretty easily.  Go to Search -> Text Search.  In addition to the two checkboxes from before, I also like to check the "Save Finds in a Search List" option.  Search for "MARIO" (it'll make you type in caps since that's all you have in your table).
  • You'll have three results in your list (these are the same as earlier!).  This time, though, you can see the text instead of just the hex.  The first two results are "THANK YOU MARIO", which isn't the "MARIO" we're looking for.  The last one, though, has the words "WORLD" and "TIME" nearby, just like the top of the game screen.  This is the MARIO you want.

    .



    Step 4: Edit your text
  • So now that you know where MARIO is, it's just a task of editing it.  We'll keep things simple by assuming the following is true: you can't make a word shorter or longer.  Since MARIO is five characters, and you want to replace it with PIKA, which is four characters, you'll have to pad the final character with a space.  We don't actually know which character is space right now, but we can see between "WORLD" and "TIME" that there is a dot, and that this dot corresponds to a 2C value in hex (if you click that dot, the cursor will move in both the middle and right panels).  We'll assume that's a space for now, even though we don't know for sure.
  • First, click on the "M" in "MARIO".  The cursor will be set in both panels, but only blinking in one or the other.  The panel with the blinking cursor is the one you're currently editing.  To switch between panels, press the Tab key.  Press tab until the cursor is blinking in the right panel (on the M).  Now, just type "PIKA" (all CAPS).
  • Now we need to get rid of that final "O".  Press the tab key again to edit the hex panel.  Now just type "2C".
  • Your edit should be complete now.  As a general rule, though, you should be constantly backing up your files when rom hacking.  So, before you save your changes, make sure you have an extra copy of the original ROM.  Once you have that, go ahead and save (or Save As, if you want to give your hack a meaningful filename).

    .



    Step 5: Test
  • Open up the ROM you just saved in you emulator of choice (I prefer BGB).  It may yell at you about a failed checksum, but you can ignore that.
  • Start up a game see the fruits of your labor!

    .

nurd

ahhh thank you! this is exactly what i needed!  :'(