ROM Hack NDS text pointers

  • Thread starter Deleted User
  • Start date
  • Views 3,502
  • Replies 12
D

Deleted User

Guest
OP
(The game is Tingle's Love Balloon Trip)

Most of the text of this game is in lang.bin (there may be some in the various .olz files as well). The resLib files contain graphics (3d and 2d) and each has a .viw file (lists the files) and a .inf file (lists the sizes of the files). The .olz files do things like loading music, graphics and other game mechanics that don't need to be modified for translation.

So I'm thinking that the pointers for the text are most likely in lang.bin. I'm looking for a way to make room for more text. The lines end with FF FF, which seems to indicate its end. However, simply moving this a byte forward causes the text to glitch and sometimes the game won't even boot. Does anyone know how I could find the pointers and modify them to repoint the text somewhere else (There's a lot of free space in lang.bin)?
 

Kelebek

Well-Known Member
Member
Joined
May 25, 2012
Messages
165
Trophies
0
XP
156
Country
Firstly, how did you even get the text to work? It's not SJIS, but there seems to be some ASCII with the first character being wrong. it seems to be a like a font map instead. Did you figure out how to get at the real text?

Either way, so far this is what I found:

There's 6 tables inside the file, a header of length 0x10, short table count, long entry count in the first table, and 0xA blank bytes.

Then each table has a 0x10 byte entry after that. Each entry is: long table number, long table start position (absolute), long text entry start (absolute), long table length. A blank 0x10 bytes after the tables.

So our first table starts at 0x80, its text begins at 0x01fe00, and the table is 0x1091c0 long.

Each string entry in the tables are 8 bytes, short unknown, short unknown, short unknown (character code?), short length.

The variables are really strange, but I added 0x10 bytes to the first string, changed the length from 0a to 1a, as well as fixed all the other tables positions, and I'm not getting any text corruption. I tried again without editing the length of the string and made the string 2 bytes longer, and *all* the text disappeared, just to make sure editing the length worked.

So yeah, it seems all you need to edit is that length variable, there doesn't seem to be any sort of pointer though which seems weird. The first 2 shorts seem like it, but I can't figure out how it works though. The first 5 entries just go up in 1s, then all of a sudden it jumps to 35 on the 6th entry. When the first variable goes up 1, the second variable resets. Maybe different scenes or something? Even the empty tables go up in weird amounts. Ah well, maybe you can figure it out. Hopefully just editing the length should let you do what you want though.
 
D

Deleted User

Guest
OP
Firstly, how did you even get the text to work? It's not SJIS, but there seems to be some ASCII with the first character being wrong. it seems to be a like a font map instead. Did you figure out how to get at the real text?

Yes, its custom encoded.

Here's the table-

2000=
0100=!
2200="
23=#
24=$
25=%
2600=&
27='
28=(
29=)
2A=*
0B00=+
0C00=,
0D00=-
0E00=.
2F=/
1000=0
1100=1
1200=2
1300=3
1400=4
1500=5
1600=6
1700=7
1800=8
1900=9
1A00=:
1B00=;
1C00=<
1D00==
1E00=>
1F00=?
2000=@
2100=A
2200=B
2300=C
2400=D
2500=E
2600=F
2700=G
2800=H
2900=I
2A00=J
2B00=K
2C00=L
2D00=M
2E00=N
2F00=O
3000=P
3100=Q
3200=R
3300=S
3400=T
3500=U
3600=V
3700=W
3800=X
3900=Y
3A00=Z
3B00=[
3C00=
3D00=]
3E00=^
3F00=`
4100=a
4200=b
4300=c
4400=d
4500=e
4600=f
4700=g
4800=h
4900=i
4A00=j
4B00=k
4C00=l
4D00=m
4E00=n
4F00=o
5000=p
5100=q
5200=r
5300=s
5400=t
5500=u
5600=v
5700=w
5800=x
5900=y
5A00=z
7B={
7C=|
7D=
'7d
7E=
8140= 
E100=
8142=
8143=
8144=
8145=
8146=
8147=
8148=
8149=
814A=
814B=
814C=´
814D=
814E=¨
814F=
8150=
8151=_
8152=
8153=
8154=
8155=
8156=
8157=
8158=
8159=
815A=
FB00=
815C=
815D=
815E=
815F=
8160=
8161=
8162=
8163=
8164=
8165=
8166=
8167=
8168=
8169=
816A=
816B=
816C=
816D=
816E=
816F=
8170=
8171=
8172=
8173=
8174=
8175=
8176=
8177=
8178=
8179=
817A=
817B=
817C=
817D=±
817E=×
8180=÷
8181=
8182=
8183=
8184=
8185=
8186=
8187=
8188=
8189=
818A=
818B=°
818C=
818D=
818E=
818F=
8190=
8191=
8192=
8193=
8194=
8195=
8196=
8197=
8198=§
8199=
819A=
819B=
819C=
819D=
819E=
81A0=
81A1=
81A2=
81A3=
81A4=
81A5=
81A6=
81A7=
81A8=
81A9=
81AA=
81AB=
81AC=
0302=
5101=
5201=
5301=
5401=
5501=
5601=
5701=
5801=
5901=
5A01=
5B01=
5C01=
5D01=
5E01=
5F01=
6001=
6101=
6201=
6301=
6401=
6501=
6601=
6701=
6801=
6901=
6A01=
6B01=
6C01=
6D01=
6E01=
6F01=
7001=
7101=
7201=
7301=
7401=
7501=
7601=
7701=
7801=
7901=
7A01=
7B01=
7C01=
7D01=
7E01=
7F01=
8001=
8101=
8201=
8301=
8401=
8501=
8601=
8701=
8801=
8901=
8A01=
8B01=
8C01=
8D01=
8E01=
8F01=
9001=
9101=
9201=
9301=
9401=
9501=
9601=
9701=
9801=
9901=
9A01=
9B01=
9C01=
9D01=
9E01=
9F01=
A001=
A101=
A201=
A301=
B101=
B201=
B301=
B401=
B501=
B601=
B701=
B801=
B901=
BA01=
BB01=
BC01=
BD01=
BE01=
BF01=
C001=
C101=
C201=
C301=
C401=
C501=
C601=
C701=
C801=
C901=
CA01=
CB01=
CC01=
CD01=
CE01=
CF01=
D001=
D101=
D201=
D301=
D401=
D501=
D601=
D701=
D801=
D901=
DA01=
DB01=
DC01=
DD01=
DE01=
DF01=
E001=
E101=
E201=
E301=
E401=
E501=
E601=
E701=
E801=
E901=
EA01=
EB01=
EC01=
ED01=
EE01=
EF01=
F001=
F101=
F201=
F301=
F401=
F501=
F601=
F701=
F801=
F901=
FA01=
FB01=
FC01=
FD01=
FE01=
FF01=
8390=
8391=
0202=
0302=
8394=
8395=

8396=



Anyways, thanks I'll take a look at it.
 
D

Deleted User

Guest
OP
Sorry for asking again, but how do you know which length goes to what string?
 

Kelebek

Well-Known Member
Member
Joined
May 25, 2012
Messages
165
Trophies
0
XP
156
Country
It's in order. The first entry at 0x80 will be the first string at 0x01fe00, the second entry at 0x88 will be the second string (so it'll be at 0x0a + 0x01fe00) and so on.
 
D

Deleted User

Guest
OP
So, say I wanted to edit the text at 55D16, I would have to count all the way to that?
 

Kelebek

Well-Known Member
Member
Joined
May 25, 2012
Messages
165
Trophies
0
XP
156
Country
As far as I can see, yeah... Since there doesn't seem to be any actual pointers to text location. You should make some tools to dump the text out to edit, and recompile the file for you.
 

Kelebek

Well-Known Member
Member
Joined
May 25, 2012
Messages
165
Trophies
0
XP
156
Country
Yeah, they're all defined in the first 0x80 bytes as I said. Table 0 is at 0x10, table 1 is 0x20, table 2 is 0x30 etc down to 0x60. The start position of the table is just 4 bytes after that, so first table location is at 0x14, second at 0x24, third 0x34 etc.

Here I made a little graphic for you, but it's sorta hard to see, I quickly ran out of colours and it's over the top of other text. Hope you can see it though. The actual table is the whole line (0x10 bytes), not just the little bit I covered, I'm just pointing out where the numbers are from, and where the start positions are. After the 4 bytes of the start positions, the next 4 is where the text starts for that table, and the final 4 after that are the length of the table.

You'll need to edit all of those if you change text. You'll need to change the length of the first table, and also change the start positions of the tables below it as well.

8JlXgUD.jpg
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    HiradeGirl @ HiradeGirl: :discuss: