ROM Hack How to make a table file for a rom (gba/nds)?

MegaStarforce

New Member
OP
Newbie
Joined
May 11, 2012
Messages
4
Trophies
0
XP
1
Country
Well I searched the web about how making a table file so that I can edit the text of a gba game.

I found a tutorial on Romhacking but the way they typed it in notepad, the letters are like jumbled and I there are no line spaces which makes my head ache.

And I think I don't understand quite well the step they are saying (I think because of the format of how they typed it).


Wondering if anyone could share how to do it through giving me a link or just type it here in this topic (through replying of course).

I want a tutorial that is straight to the point, and easy to understand cuz you know im still a newb.


Thanks in advance!
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
A table file is just a list of hex numbers and the letters they correspond to*, there are a few different standards out there (the main ones right now are thingy and what crystaltile2 calls a table) and a proper standard has been drafted which has yet to be implemented http://transcorp.parodius.com/scratchpad/Table%20File%20Format.txt

*my usual example here is as a kid you probably made a code along the lines of a=01, b=02 , c=03 (a=01, b=02 , k=03?). The only things to change here are you can use various amounts of numbers in hexadecimal to represent letters and represent whole words or fractions of them with single hex digits if you want to.

Tools like http://www.romhacking.net/utilities/55/ can output a table and you can use a rom hacking hex editor or crystaltile2 to display it. More on hex editors http://gbatemp.net/topic/326873-rom-hacking-hex-editors-mid-2012-discussion/

That is not the whole story though as you have to figure out the encodings and games developers will not necessarily try to make it hard but the things they do can add complexity to the situation (custom symbols, most of the time bold letters will just be another letter in the code as opposed to something to tell it to be bold and such). These processes however encompasses a large amount of rom hacking and there are loads of techniques you can try.

I am presently rewriting the rom hacking docs and naturally I have a chapter on it but I am not quite prepared to release the new version yet even though the text section is largely completed. In the meantime though the three basic techniques which I encourage you to combine in various ways to figure things out are

First compression troubles all of these techniques so make sure you are working with uncompressed files ( http://code.google.com/p/dsdecmp/ and http://gbatemp.net/topic/313278-nintendo-dsgba-compressors/ for DS and sometimes for GBA, crystaltile2 can handle some GBA and poke around romhacking.net for some more GBA compression tools).

1) Check the game to see if it uses ASCII ( http://www.asciitable.com/ ), unicode (or something related to it http://www.joelonsoftware.com/articles/Unicode.html ), shiftJIS (more for Japanese but not always http://www.rikai.com/library/kanjitables/kanji_codes.sjis.shtml ), eucJP (also Japanese http://www.rikai.com/library/kanjitables/kanji_codes.euc.shtml ) or something similar. GBA games did occasionally use known encodings (advance wars for instance used ASCII) and DS roms do it frequently. Sidenote- NFTR fonts in DS games contain the encodings they use and crystaltile2 can dump them to a table and http://gbatemp.net/topic/105060-nftr-editor/ can also tell you what goes.

2) Relative search.
http://www.romhacking.net/utilities/513/ is my usual tool although crystaltile2 has abilities here as well
http://filetrip.net/f23649-CrystalTile2-2010-09-06.html (hex window, click the tools pulldown menu).
In English and most languages that use the Roman character set there is a defined order of letters (abcdef...) and although games are not obliged to use it they quite often do. The idea then is you find a word, phrase or large chunk of a sentence used in the game (or if you live dangerously guess that a word like "the" which appears in most English paragraphs and almost certainly in a script or a character trait/series staple- final fantasy probably has the word moogle in there for instance) and search for it. If the encoding is relative searching for a word like bad will search for something with one value, a value lower than that and a value two higher than the original one which then means you have most of the rest of the encoding if it finds something (e will be one value up from d and it carries on from there).
Japanese on the other hand does not really have an order so relatively searching is quite hard to get anything from (you can occasionally get something from Kana but that is not foolproof). Equally there are things you can do to help the relative search (character names if they are user editable should not be used, if there is a variable (it costs [insert price] to buy) do not use it, if you have a capital letter do not use it in the initial search, if the phrase is likely to wrap around to another area shorten it or do not use it and the list goes on).

3) Corruption and alteration.
Corruption is a technique rom hackers use where they mess up part of the rom (I tend to invert things) and run it, assuming it does not crash right away wherever something has an error that was not there in the original that is what the part you corrupted deals with.
Alteration is a bit more like guided corruption. Here you will edit things you know to be text and run the game to have it display what you have edited- I like to put a run of characters* so when in a game it pops up with that long run I know what has been done). Also quite useful if you have some stuff thanks to relative searching and you need to fill in the rest.

*either the same character, characters always increasing by one or a pattern like abbcccdddeeeefffff and then matching up where the pattern starts with what goes.

After this we get into edge cases, things like language analysis (the space character is probably the most common character, English has a vowel in almost every word and if it does not the word will tend to contain a y character.......), hex analysis and programming level techniques (assembly, memory viewing, name input memory viewing, save analysis, pointer searching and so forth) most of which are not that hard to learn but are not something I wish to dump on you right now if you are just getting the hang of things.

Do not launch right into an ultra complex Japanese RPG and even if you see the text in ASCII or something try the techniques out anyway as it will let you get a feeling for them (not to mention games might only use part of the ASCII encoding). If you want a nice demo or a not ascii but still easy enough to get working try Megaman ZX

Re line spaces- make sure it is not unix (0A) or apple style (0D) line spaces compares to windows ones (0D0A). A proper text editor should be able to handle this ( http://notepad-plus-plus.org/ if you need a suggestion) but the windows standard stuff is poor at it at best and usually fails to appreciate it.
 
  • Like
Reactions: swosho

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
I didn't either :P
But if you are really interested in rom hacking, FAST always have good informations and reading his posts are always a good sources of knowledge.

I didn't know there were a proper table standard in the work.
Too bad it's less used now with recent consoles hacking, it would have boost the release of that standard in hacking tools.
I remember using thingy and SearchR for SNES games.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: The mutated Axolotl was awesome