View Full Version : Research: Hex codes in Advance Text

June 20th, 2013, 1:10 PM
Hi all! I'm not sure how to get a thread approved by mods so here goes.

I was messing around with hex codes in Advance Text yesterday and discovered some peculiar things that I was hoping some people here could help me with. Specifically, I was trying to change text colors when I noticed the colors didn't match up to what everyone else was saying.

So I did some investigating, and that led me to this.

Hex "FC" (appears as "\c") is supposed to be the color modifier, right? Well, it does more. Look here:
FC calls for formatting (\c)
FC01xx text colors
FC02xx text highlight colors
FC03xx shadow colors
FC04xxxxxx –-
FC05xx –-
FC06xx font modifier
FC07 –-
FC08 –-
FC09 hides the rest of this line until you press A
FC0A --
FC0Bxxxx --
FC0Cxx replace xx with next character in text
FC0Dxx --
FC0E ? skips over text box too fast for me to tell
FC0F skips over previous line
FC10xxxx --
FC11xx --
FC12xx --
FC13xx --
FC14xx --
FC15 switches to Japanese font (from Latin)
FC16 switches to Latin font (from Japanese)
FC17 –-
FC18 –-The "--" means I couldn't find any visible effect. The xx at the end of the hex code is how many bytes the function calls on.

FC 00 and 19 onwards, no effect. So FC19 would give you index 19 on the character map (ç in English font, の Hiragana “no” in Japanese font). The ones I couldn't figure out I left as “--” but they could have some effect. If anybody wants to study this, please let me know what you find.

Here are the modifiers from the previous list:
Color modifier:
x0 no color
x1 no color
x2 black
x3 gray?
x4 red
x5 orange
x6 green
x7 light green
x8 [blue] blue
x9 light blue
xA no color
xB steel blue
xC steel blue
xD steel blue
xE light blue
xF blue

Font modifier:
00 small Latin characters (this font can be used to fit more text in small space)
01 –-
02 same as [small] in Advance-Text, not sure what it does in English version
03 onwards apparently no effect I don't know if anyone else has dicovered that you can not only change text colors, but also highlight and shadow colors.

We all know that 3rd generation games are compatible with international trades, right? Well, in order for that compatibility to happen, both the Latin and Japanese fonts need to exist in the game code. Apparently HEX FC15 and FC16 switches between both of them. I'm sure there's a way this can be useful for more than just translation.

I'm going to experiment some more the next few days, especially with the Japanese font now that I know how to access it.

This might be really useful for ROM translators (I want to try translating Pokémon Altair, Sirius, Vega, Deneb and Procyon). I think people working on Pokémon Debug Ruby might also want to take a look at this.

Here's the character table for the fonts:
Character Map for fonts
Hex EN font JP font
00 (space) (space)
01 À あ a (hiragana)
02 Á い i
03 Â う u
04 Ç え e
05 È お o
06 É か ka
07 Ê き ki
08 Ë く ku
09 Ì け ke
0A nothing? こ ko
0B Î さ sa
0C Ï し si
0D Ò す su
0E Ó せ se
0F Ô そ so

10 Æ た ta
11 Ù ち ti
12 Ú つ tu
13 Û て te
14 Ñ と to
15 ß な na
16 à に ni
17 á ぬ nu
18 nothing? ね ne
19 ç の no
1A è は ha
1B é ひ hi
1C ê ふ hu (?)
1D ë へ he
1E ì ほ ho
1F nothing? ま ma

20 î み mi
21 ï む mu
22 ò め me
23 ó も mo
24 ô や ya
25 æ ゆ yu
26 ù よ yo
27 ú ら ra
28 û り ri
29 ñ る ru
2A °(degree) れ re
2B ª ろ ro
2C · (dot) わ wa
2D & を wo
2E + ん n
2F nothing? ぁ a small

30 nothing? ぃ i small
31 nothing? ぅ u small
32 nothing? ぇ e small
33 nothing? ぉ o small
34 [LV] ゃ ya small
35 = ゅ yu small
36 ; ょ yo small
37 nothing? が ga
38 nothing? ぎ gi
39 nothing? ぐ gu
3A nothing? げ ge
3B nothing? ご go
3C nothing? ざ za
3D nothing? じ zi
3E nothing? ず zu
3F nothing? ぜ ze

40 nothing? ぞ zo
41 nothing? だ da
42 nothing? ぢ di
43 nothing? づ du
44 nothing? で de
45 nothing? ど do
46 nothing? ば ba
47 nothing? び bi
48 nothing? ぶ bu
49 nothing? べ be
4A nothing? ぼ bo
4B nothing? ぱ pa
4C nothing? ぴ pi
4D nothing? ぷ pu
4E nothing? ぺ pe
4F nothing? ぽ po

50 nothing? っ tu small?
51 ¿ ア a (katakana)
52 ¡ イ I
53 [PK] ウ u
54 [MN] エ e
55 [PO] オ o
56 [Ke] カ ka
57 [BL] キ ki
58 [OC] ク ku
59 [K] ケ ke
5A Í コ ko
5B % サ sa
5C ( シ si
5D ) ス su
5E nothing? セ se
5F nothing? ソ so

60 nothing? タ ta
61 nothing? チ ti
62 nothing? ツ tu
63 nothing? テ te
64 nothing? ト to
65 nothing? ナ na
66 nothing? ニ ni
67 nothing? ヌ nu
68 â ネ ne
69 nothing? ノ no
6A nothing? ハ ha
6B nothing? ヒ hi
6C nothing? フ hu
6D nothing? ヘ he
6E nothing? ホ ho
6F î マ ma

70 nothing? ミ mi
71 nothing? ム mu
72 nothing? メ me
73 nothing? モ mo
74 nothing? ヤ ya
75 nothing? ユ yu
76 nothing? ヨ yo
77 nothing? ラ ra
78 nothing? リ ri
79 U arrow ル ru
7A D arrow レ re
7B L arrow ロ ro
7C R arrow ワ wa
7D nothing? ヲ wo
7E nothing? ン n
7F nothing? ァ a small

80 nothing? ィ i small
81 nothing? ゥ u small
82 nothing? ェ e small
83 nothing? ォ o small
84 nothing? ャ ya small
85 nothing? ュ yu small
86 nothing? ョ yo small
87 nothing? ガ ga
88 nothing? ギ gi
89 nothing? グ gu
8A nothing? ゲ ge
8B nothing? ゴ go
8C nothing? ザ za
8D nothing? ジ zi
8E nothing? ズ zu
8F nothing? ゼ ze

90 nothing? ゾ zo
91 nothing? ダ da
92 nothing? ヂ di
93 nothing? ヅ du
94 nothing? デ de
95 nothing? ド do
96 nothing? バ ba
97 nothing? ビ bi
98 nothing? ブ bu
99 nothing? ベ be
9A nothing? ボ bo
9B nothing? パ pa
9C nothing? ピ pi
9D nothing? プ pu
9E nothing? ペ pe
9F nothing? ポ po

A0 nothing? ッ tu small
A1 0 0
A2 1 1
A3 2 2
A4 3 3
A5 4 4
A6 5 5
A7 6 6
A8 7 7
A9 8 8
AA 9 9
AB ! !
AC ? ?
AD . .
AE - -
AF · dot · dot

B0 [...] [···] raised
B1 " "open
B2 " "open
B3 ' 'open
B4 ' 'close
B5 [m] [m]
B6 [f] [f]
B7 $ $
B8 , .
B9 [x] [x]
BA / /

C0 F F
C1 G G
C2 H H
C3 I I
C4 J J
C5 K K
C6 L L
C7 M M
C8 N N
C9 O O

D0 V V
D1 W W
D2 X X
D3 Y Y
D4 Z Z
D5 a a
D6 b b
D7 c c
D8 d d
D9 e e
DA f f
DB g g
DC h h
DD i I
DE j j
DF k k

E0 l l
E1 m m
E2 n n
E3 o o
E4 p p
E5 q q
E6 r r
E7 s s
E8 t t
E9 u u
EA v v
EB w w
EC x x
ED y y
EE z z
EF [>] [>]

F0 : :
F1 Ä Ä
F2 Ö Ö
F3 Ü Ü
F4 ä ä
F5 ö ö
F6 ü ü
F7 [u] nothing?
F8 [d] nothing?
F9 [l] big space?
FA line break
FB page break
FC \c
FD \v
FE line break?
FF end of textIf it says "nothing?" it's not actually nothing. Looking at how the hex codes are used elsewhere, they call on certain commands or texts (like ____ gained ____ EXP. Points). I'll post any new information as I get it.

I'm wondering if in the ROM, for something like a move name, you could just replace the name of the move "Scratch" with \c (format hex FC,japanese font hex 15, text "ひっかく hikaku" with the hex values from the Japanese character map) and if that would appear correctly.

Just an FYI, you CAN load English save states of Fire Red into Japanese and vice versa. Everything appears correctly, which shows that both versions use the same RAM data structure. There's some kind of flag built into the ROM that sets the region and the Pokémon's nickname. Maybe the Name Rater's script has some clue?

An up to date version of my findings can be found on Google Docs.

Team Fail
June 27th, 2013, 7:38 AM
You mentioned that save states are compatible in terms of language, does that apply to save files as well? I know that 4th and 5th gen games are compatible that way (Korean being the exception in the 4th gen games), but is GBA the same too?

Oh and シ and し are "shi", not "si", and つ and ツ are "tsu", and チ and ち are "chi".

June 28th, 2013, 12:41 AM
Yes it works but you need to change the ROM header to load a different save state. Not sure yet about battery files. I couldn't find a separate Latin font in the Japanese ROM but I'm sure it exists somewhere. I need to spend some time hacking the Name Rater scripts in both languages. So far the US and Europe releases appear interchangeable but with different offsets for some things.

The 5 character limit in Japanese games is built in. There should be a way to repoint all of them (at the offset is just a list of all 386 names) without messing the data. Then you can have 13 spaces per Pokémon (3 characters to call on small font plus 10 for name). Not sure yet how that will work because the Pokémon names display only 6 characters and nicknames only 5.

Shiny Quagsire
June 30th, 2013, 5:52 PM
Nice find! I haven't actually seen a real, thorough text code documentary yet besides HackMew's short one in his XSE help guide, but this one gives a bit more detail on how it works.

July 5th, 2013, 10:12 AM
Nice find! I haven't actually seen a real, thorough text code documentary yet besides HackMew's short one in his XSE help guide, but this one gives a bit more detail on how it works.

Thanks, I appreciate the input.

I haven't been able to find HackMew's guide. Can someone show me?