News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Could someone help me learn how to translate an original GameBoy ROM?  (Read 1796 times)

Novantico

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hi there. As above, I'm looking to make a translation for an original GameBoy game. Specifically, Final Fantasy Adventure. It's one of my favorite games of all time, and the first video game I ever played as a child (which took me years of on and off play to beat because of how young I was). And so I've been learning Esperanto on and off for over a year, and I think it would be cool to make an Eo translation of the game. I've tried doing searching on how to accomplish this, but either I'm doing a terrible job of searching or it's just not that easy to find answers.

I'm hoping someone would be able to maybe point me towards some tools and/or guides on how to accomplish this, and also how I might add the few letters in the language that are accented.

Thanks.

hackfleisch

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #1 on: March 25, 2016, 11:20:59 am »
Welcom on board ;-)

As i'm trying to do the same thing for another game, i can tell you that it is not that easy! First i thought there must be text strings inside the game ROMs and it would be enough for overwrite them. But it's much more complicated than that. I'll try to explain:

Text inside the game (this may differ from ROM to ROM) was made of character graphics (=font). Each char ist made by one tile, a 8x8 dotmatrix image. Tiles are placed on screen using tilemaps. They tell where, which tile should be shown. So making a text like "GAME OVER" will require 7 individual tiles for the chararcters "G", "A", "M", "E", "O", "V", "R". The tilemap then tells to place "E" twice, in "GAME" and "OVER". Also the space between both chars may not be a tile, so there is no need for a character here.

As you can see, there is no chance to find text which is coded like that. There may be games using ASCII-Texts for displaying the font-characters on the screen, so you can simply change it. Check this by using an HEX-Editor like https://mh-nexus.de/de/hxd/ (HxD) and look for it.


Novantico

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #2 on: March 25, 2016, 11:32:09 am »
Hey there.

Thanks for the response! That's helpful information. So what you're saying is that if they're simply in ASCII, I could search via hex editor for the word "chicken"? Or would it be the word "chicken" in some hex format?

And then for the tile sets, how would I figure out what thing corresponds to what, and how to view/edit them?

Thanks again.

hackfleisch

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #3 on: March 25, 2016, 11:58:02 am »
When using an Hex-Editor like HxD, each byte is shown with as HEX value and corresponding ASCII char. When searching the data, HxD let you choose how to find the entered searchvalues. Just click "as text" here.

How to find the tilemaps is something that i don't know (for now). It may be everywhere in the code. In this early consoles there are no data-signatures which can help identifying those maps. I try to find the maps of my game by reverse engeneering the whole code.

Kurt91

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #4 on: March 26, 2016, 02:03:17 am »
I've been curious about translating stuff as well, mind if I ask a question too?

How does a hex editor know what values correspond to the appropriate letter? Is it the same across games? For instance, if I were to open Phoenix Wright and Mega Man ZX in a hex editor, the value representing a letter will be the same in both?

If it isn't, is it possible to automate the process on determining which letters correspond to various values? If I were to open a game and copy what I saw in a textbox into a program, would it be able to automatically look at the pattern of letters (let's say "Chicken" would be evaluated as values "1,2,3,1,4,5,6") and look for a sequence of hex values that change according to the same pattern? It seems like a tool that could do that would make translating text much easier.

FAST6191

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #5 on: March 26, 2016, 05:06:10 am »
A hex editor knows nothing beyond the hex the file contains, and maybe some ways it has been programmed to show said data (look down the bottom of the screen for the better ones and they will probably tell you what that value is if it is signed, a float, a DOS style date....).
ROM hackers however have hex editors made specially to take table files which are files that contain lists of what hex characters correspond to what decodings, some normal hex editors have limited capability here but you will want a hacking focused one eventually http://www.romhacking.net/forum/index.php/topic,21323.0.html
The main reason for the hacking focused ones are although some conventional editors will have basic encoding support then I have not seen one that easily mixes 8 and 16 bit encodings, allows for variable length decodings (see dual tile or multi tile encodings -- one value comes back as more than one character) and even wildcards, new lines and variable names can be tricky in them.
Same across games? Hah -- it can be different within a game, even within a passage, though such things are rare and for the most part you will probably only be finding one encoding if you are not hacking NES games, though I think Phoenix Wright might be one of those and menus can often be different to the game proper. That said there are encodings that some games share with the rest of the world (many DS games will use a least part of the shiftJIS or EUC-jp encodings), with other things from the dev (Capcom did this on the DS if memory serves) and for megaman ZX then I did that as an example hack in my GBA/DS docs http://www.romhacking.net/forum/index.php/topic,14708.0.html

Automate it? For languages with a set alphabet and order in it (most European languages) then there is a powerful tool called relative search. For languages without it (so Japanese which has no real order for anything, though some mildly enforced orders for the kana at times) then the only way you are not spending time is if the order is copied from something else (shiftJIS and eucjp were already mentioned and popular choices, other games also happen here) or is determined mathematically/logically (some games might use frequency of appearance, order in the script or something like that).

Even with a table the editor is not going to know what is text, it will just blindly decode like it always does.

Anyway all this is covered in the introductions to text hacking so I will leave it there. http://www.romhacking.net/start/

VicVergil

  • Hero Member
  • *****
  • Posts: 716
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #6 on: March 26, 2016, 06:52:44 am »
First you search for the font in a tile editor (Crystaltile2) to see what order is used for letters.
It should be at 0x22700.
It goes 0-9 then A-Z then a-z.
The order doesn't respect ASCII for sure (you can look up ASCII and see what I mean) so the text won't appear by default on hex editors, and you'd need to make a table file with the custom letter values used in this game.
On the bright side, it follows the correct alphabet order (meaning, without interruptions or other symbols in between messing up the order).

By the way, see those blank tiles in the two lines before the armor symbols?
Those were actually used for letters in the JP version, and you should be able to use them in your translation for custom accents if you find their hex values (by experimenting). Official French/German localizations for this game weren't as smart.

Then you open a relative search tool. I suggest monkeymoore.
Correct alphabet order > no need to define custom character set.
You search for a word, preferably mixing upper and lower case characters, and the program builds up a table for you and gives you a sample sentence from the ROM for you to check if it's the table with the right values.
This game's script is compressed with a light dictionnary scheme, so I'd recommend trying with different words if search fails.

You open the ROM and load the table with Windhex (CT2 supposedly supports tables, but said support sucks).
You should find the text.
But some characters are missing (space, punctuation, numbers, icons...).
You add them with the table editor feature (or if you're feeling adventurous, editing the tbl file with notepad directly).
Some values replace multiple characters, so add those too to the table.
And try to find the values for the blank characters too. (you can edit them with the tile editor to host your accents).


henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #7 on: March 26, 2016, 04:51:57 pm »
I think I read somewhere that Phoenix Wright and Megaman use the same table.

stuffgnome

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Could someone help me learn how to translate an original GameBoy ROM?
« Reply #8 on: March 26, 2016, 05:10:38 pm »
I put together a table that should atleast get you started. I used * and @ for what I believe are some sort of control characters (line breaks and what not) and the terms Boy and Girl for the hero and heroine. Again, it is not complete and might(99.99% likely) have errors that need correcting but it should be enough to get you going, or maybe someone else could finish/correct it.

Spoiler:
1A=*
20=e
21=ou
22= t
23=th
24=yo
25=d
26=s
27=er
28=t
29=an
2A=he
2B=nd
2D= a
2E=ar
2F=in
30=at
31=is
32=ea
33=to
36=o
37= i
38=re
39=ed
3A=ll
3B=ha
3C=or
3D= s
3E= o
3F=te
40= h
41=us
42= m
43= w
45=st
46=ow
47=on
48=it
49= I
4A=n
4B=as
4D=ve
4E=en
4F=ng
50=of
51= M
52= f
53=f
54=es
56=al
57=y
59= y
5A=av
5B=I
5C=hi
5D=le
5E=oo
5F=ro
61=e.
63=ma
64=om
65=l
66=el
67=ur
68= T
6A= W
6B=se
6C='s
6E=li
6F= b
80=,
82=wa
83=il
84=ut
85=Th
86=da
87= c
88=gh
89=ca
8B=ir
8C=m
8D=le
8E=rd
8F=ig
90=ul
91=ht
92=ba
93= l
95=no
96=ta
97= H
98=et
99=we
9A= S
9B=e!
9C=wi
9E=ck
9F=nt
BA=A
BB=B
BC=C
BD=D
BE=E
BF=F
C0=G
C1=H
C2=I
C3=J
C4=K
C5=L
C6=M
C7=N
C8=O
C9=P
CA=Q
CB=R
CC=S
CD=T
CE=U
CF=V
D0=W
D1=X
D2=Y
D3=Z
D4=a
D5=b
D6=c
D7=d
D8=e
D9=f
DA=g
DB=h
DC=i
DD=j
DE=k
DF=l
E0=m
E1=n
E2=o
E3=p
E4=q
E5=r
E6=s
E7=t
E8=u
E9=v
EA=w
EB=x
EC=y
ED=z
EE='
F1=..
F3=!
F4=?
F5=:
FF=@
62=Ma
8A=ai
4C=r
58=a
F0=.
94= G
60= g
81=u
14=Boy
15=Girl
6D=E
9D=HE