JeffLudwig.com
GOG.com
Final Fantasy 1 GBA

Final Fantasy for GBA— Hacking Notes

First thoughts

As of February 23rd, 2010, I am planning the release my hacking notes in their entirety. Please check back every few days or so to see if new content has been posted. Thank you to those of you who requested this info, and for your patience with me.

As I have a number of other projects which I am currently working on, it is not looking like I will be writing a Hackster for FF1 GBA. However, some intrepid reader using the forthcoming notes could pull that off.

I spent a fair amount of time amassing these notes. They'll be of help for you to find some of the various data lists are stored in the ROM, and though my list is by no means comprehensive, the notes served as my brain as I waded through the hexidecimal code. I didn't use any tools other than a hex editor, and a debugging version of Game Boy Advance for stubborn little issues and hard-coded aspects of the game (like the 999-HP/MP limits). While I don't absolutely guarantee 100% veracity, I did create my mod in conjunction with the notes presented here, and they should be quite precise.

I hope these notes are of use to you, and to the greater modding community. Feel free to use any and all of it in your endeavors, however, if you do use this info to glean insight for your project, I would appreciate appropriate recognition for my original effort. Thank you.

First Steps

You'll need to have proper tools for these notes to be of any help. First, you'll need a hex editor. I recommend Hex Workshop 4.1, if you don't already have one. The link I provide is to a 35-day trial version of the software. To continue using it, you'll need to purchase it.

I also recommend getting a copy of the VBA Debugging Emulator I used, in case you plan to do your own testing and debugging on the ROM's code. The link provided also documents its features.

I assume that you understand basic hexidecimal theory here. When providing addresses in the ROM, I will precede the address by a "0x".

Decimal numbers will appear in this format: 4987.

Hexidecimal numbers will appear in this format: 137b.

Larger integers in the ROM are encoded in "Little Endian" format. In other words, the least significant bit is stored first. For example:

4987 (decimal) = 137b (hexadecimal). However, in the ROM, the number 4987 would be stored in Little Endian format, and so it would appear as 7b13.

Text

Every textual character in FF1 GBA (and in FF2, I assume) is encoded in the ROM in 2 bytes, and not one, as is common in many ROMs. The table below should help you decode the text in the ROM. This is not exhaustive; just my observations as I worked on my mod.

Textual encoding in hex

Letters

A =8260 a =8281 J =8269 j =828a S =8272 s =8293
B =8261 b =8282 K =826a k =828b T =8273 t =8294
C =8262 c =8283 L =826b l =828c U =8274 u =8295
D =8263 d =8284 M =826c m =828d V =8275 v =8296
E =8264 e =8285 N =826d n =828e W =8276 w =8297
F =8265 f =8286 O =826e o =828f X =8277 x =8298
G =8266 g =8287 P =826f p =8290 Y =8278 y =8299
H =8267 h =8288 Q =8270 q =8291 Z =8279 z =829a
I =8268 i =8289 R =8271 r =8292

Numbers

0 =824f 1 =8250 2 =8251 3 =8252 4 =8253 5 =8254
6 =8255 7 =8256 8 =8257 9 =8258

Symbols

<cr>810a ,8143 .8144 :8146 ;8147 ?8148
<sp>8140 !8149 _8151 /815e '8166 -817c
%8193 Sword8740 Knife8742 Nunchaku8743 Staff8746 Robe/Shirt8747
Armlet8749 Gloves874c White Magic874d Black Magic874e Potion874f Bag8750

Miscellaneous stuff

A simple 00 can end a string.

What this means

The name of the weapon "Rapier" is encoded in the ROM as shown below. You can fire up your hex editor, and search for the hex string below (without spaces) to find in in the ROM. For convenience, you can copy the string from the page here: 8740827182818290828982858292.

Sword R a p i e r
8740 8271 8281 8290 8289 8285 8292

String locations and pointers that I have identified

First of all, what is a pointer?

Simply put, it "points" to a particular place in the GBA ROM. Most of these pointers are 4 bytes in length, stored in Little Endian format. The last byte generally is 08... since the ROM is stored in GBA memory starting at location 0x08000000 when it is loaded into an emulator. For instance, if you searched for the string above, you found it at location 0x19a687. Following the rule above, the pointer would point to this place in the ROM by making that pointer 0x0819a687. However, since it would be stored 4 byte Little Endian format, that pointer would look like 87a61908 in the ROM itself. Are you following me? Good job!

String pointer locations in the ROM

Armed with this information, the string pointers at these locations will point you elsewhere in the ROM to find the actual strings that you may want to edit. Each actual string is of variable length, and each are terminated by a 00. If you need more space, you could actually edit the pointer to point to another location in the ROM (be careful that you don't overwrite actual code) and write your string there (obviously, terminating it with a 00). There appears to be extra room for your own strings beginning at ROM location 0xee1000 and all the way through the end of the file, at 0xffffff.

In almost every case, pointers in the ROM either directly precede or procede the data to which the point. But as I've pointed out, they don't necessarily have to.

If I don't provide an ending for the lists below, it was because I was too lazy to find its end. You can always email me with that info if you find it yourself. And lastly, as you'll see below, some information is in the ROM in multiple locations. For instance, to properly change a Class Name, you'll have to edit it in three separate locations.

Class Names: 0x1da85c — 0x1da937 0x1e08a4 — 0x1e097f 0x1e13b4 — 0x1e148f
Pointers to Class Names: 0x1da938 — 0x1da967 0x1e0980 — 0x1e09af 0x1e1390 — 0x1e13bf
Item Names: 0x19a261 — 0x19a659
Weapon Names: 0x19a65a — 0x19ac05
Armor Names: 0x19ac06 — 0x19b319
Quest Item Descriptions: 0x19ac1a — 0x19bc9e
Item Descriptions: 0x19bc9f — 0x19c40c
Weapon Descriptions: 0x19c40d — 0x19d454
Armor Descriptions: 0x19d455 — ??
Spell Names: 0x1a8668 — ?? 0x1a021d — ??
Spell Descriptions: 0x1a0787 — 0x1a164e
Monster Attacks: 0x1a05bb — 0x1a0786
Monster Names: 0x2257ac — ??
Pointers to Dialogue: 0x210370 — 0x21177f
Monster Attacks: 0x1a05bb — 0x1a0786 0x211780 — 0x212b7f