News:

11 March 2016 - Forum Rules

Main Menu

[Translation Hack] Initial D - Gaiden (GB).

Started by Bunkai, April 19, 2022, 08:27:03 PM

Previous topic - Next topic

Bunkai

I decided to try my own documents and see what I can get.
{I need to explain better how to calculate the pointer table end.
However, thanks to the help from 343 and abridgewater in the RHDN discord
I got a proper dump}

All the info to make a translation for it is here.
[Besides most images seem uncompressed. If not all]

    Game rom: Initial D Gaiden (Japan) (SGB Enhanced)
    CRC-32: 6CC56612
       

Japanese Info on the game and menus
https://ameblo.jp/dorikin86/entry-12477025728.html


    Full script in txt
    https://pastebin.com/L5euGeir
    Menus texts are graphic assets.

Font + Address



Pointer Table + Address


Script text + Address


Proper dump proof



Batch link for the images
https://imgur.com/a/UJTcRvm

Table created by 343 and fixed by me
Spoiler
20=
21=!
22="
23=#
24=$
25=%
26=&
27='
28=(
29=)
2A=*
2B=+
2D=ー
30=0
31=1
32=2
33=3
34=4
35=5
36=6
37=7
38=8
39=9
3A=:
3B=;
3C=<
3D==
3E=>
3F=?
40=@
41=A
42=B
43=C
44=D
45=E
46=F
47=G
48=H
49=I
4A=J
4B=K
4C=L
4D=M
4E=N
4F=O
50=P
51=Q
52=R
53=S
54=T
55=U
56=V
57=W
58=X
59=Y
5A=Z
5B=[
5D=]
5E=.
5F=_
62=[TEXT]
6C=[BRK]
7463=[CHAR]
/7465=[END]
A1=。
A2=「
A3=」
A4=、
A5=.
A6=を
A7=ぁ
A8=ぃ
A9=ぅ
AA=ぇ
AB=ぉ
AC=ゃ
AD=ゅ
AE=ょ
AF=っ
B0=‐
B1=あ
B2=い
B3=う
B4=え
B5=お
B6=か
B7=き
B8=く
B9=け
BA=こ
BB=さ
BC=し
BD=す
BE=せ
BF=そ
C0=た
C1=ち
C2=つ
C3=て
C4=と
C5=な
C6=に
C7=ぬ
C8=ね
C9=の
CA=は
CB=ひ
CC=ふ
CD=へ
CE=ほ
CF=ま
D0=み
D1=む
D2=め
D3=も
D4=や
D5=ゆ
D6=よ
D7=ら
D8=り
D9=る
DA=れ
DB=ろ
DC=わ
DD=ん
DE=゛
DF=゜
[close]

Command.txt for a proper dump with cartographer
Spoiler
#BLOCK NAME: InitialD (SGB)
#TYPE: NORMAL
#METHOD: POINTER_RELATIVE
#POINTER ENDIAN: LITTLE
#POINTER TABLE START: $9600
#POINTER TABLE STOP: $97bf
#POINTER SIZE: $02
#POINTER SPACE: $00
#ATLAS PTRS: Yes
#BASE POINTER: $4000
#TABLE: InitialD.tbl
#COMMENTS: No
#END BLOCK
[close]

Insertion test / proof


Reused the same font and copied the table with utf-8 format to check.
A new font will/should be made.

Atlas code for insertion,
Actual text will require pointer adjustment since it gives overflowed warnings.
But insertion works.
Spoiler
//GAME NAME:       

//BLOCK #000 NAME:        InitialD (SGB)

//POINTER #0 @ $9600 - STRING #0 @ $97C0

#VAR(Table, TABLE)
#ADDTBL("InitialD_ENG.tbl", Table)
#ACTIVETBL(Table)
#HDR($4000)
#JMP($97C0, $BFFF)

#W16($9600)
[TEXT]
BUNKAI HERE[BRK]
TESTING INSERTION[BRK]
PLEASE WAIT[END]
[close]

All Graphic Assets:
Start with the font, and follow through.
Spoiler
Font offset, 0x14000
Main Screen offset, 0x16000 (Includes Main Menu)
Moving Screen 外伝 offset, 0x22000
Race Maps, 0x24000
[close]
Last bank with Graphics: 0x34000
Curiosity leads to knowledge,
be curious.

Bunkai

#1
I was doing a second search to be sure i didn't leave any text and I found, in bank 0x1:

Credits, 2 Character Names' list, some JPN & ENG text menus.

* I believe one of this Character Names list is for the default name records.

Credits text + Address


Link with batch of screenshots for any new text found
https://imgur.com/a/PjSYGtD

The text on this post is undumped, the post will be updated when this text is dumped

This table works in a different way with more bytes, explanation in the spoiler:
Spoiler

First:
The credit pointer ini is [New] = 0E09CDE00C

Second:
The credit pointer "next" is [New2] = 6506 + "?" ;
Where "?" is a hex value with what seems the position for each subtitle within the menu
The pointer for "next char" is [Char2] = 65C906 + "?"
[close]



A couple more of graphic assets
https://imgur.com/a/Y2LS0Hr

PS: I have to review all graphic assets yet, but mainly English titles like "RECORDS" or "SOUND CHECK" are the only ones eluding my searchs.
Curiosity leads to knowledge,
be curious.

abridgewater

Quote from: Bunkai on May 16, 2022, 07:05:19 AM

We discussed this in the Discord, but I figured I'd summarize here for posterity:
cd e0 0c (at $44a3) disassembles as call $0ce0
At $0ce0 is e1 cd 05 0d e5 c9, which is
pop hl
call $0d05
push hl
ret

What we have is a code stream with inline literal strings.  The strings are variable-length, so either the length is loaded ahead of time or there's a terminator, and 65 is a good bet for the terminator, especially given the "Credits text" image.

From there, we see (at $44b6) a sequence 06 xx 0e yy cd e0 0c which appears a few times again further down.  This is
ld b, $xx
ld c, $yy
call $0ce0

and the values used strongly suggest display coordinates rather than a text length.

Sometimes there just aren't manipulable pointers.  Sometimes it's a matter of asm hacking no matter what.

Bunkai

#3
Currently examining the sound code

This is the i/o map:


This is the routine to load the wave pattern:


The game seems to use ASM code to initiate and update the sound channels, not literal strings
More to come
Curiosity leads to knowledge,
be curious.

Bunkai

Curiosity leads to knowledge,
be curious.

Bunkai

#5
Progress, I guess

Some locations (like the first " or the ]) couldn't be used for the ! character because they somehow printed other memory tiles.

So after a few attempts to add the spanish characters to the font, here's the result


Spanish Font + table:

Spoiler
20=
21=¡
22=ç
23=#
24=$
25=%
26=&
27==
28=(
29=)
2A=*
2B=+
2D=ー
30=0
31=1
32=2
33=3
34=4
35=5
36=6
37=7
38=8
39=9
3A=:
3B=;
3C=<
3D=>
3E=¿
3F=?
40=@
41=A
41DE=Á
42=B
43=C
44=D
45=E
45DE=É
46=F
47=G
48=H
49=I
49DE=Í
4A=J
4B=K
4C=L
4D=M
4E=N
4F=Ñ
50=O
50DE=Ó
51=P
52=Q
53=R
54=S
55=T
56=U
56DE=Ú
56DF=Ü
57=V
58=W
59=X
5A=Y
5B=Z
5D=.
5E=」
5F=_
62=[TEXT]
65=[CRD]
6C=

7463=[CHAR]
/7465=[END]
A1=!
A2=[
A3=]
A4=,
A5=.
A6=を
A7=ぁ
A8=ぃ
A9=ぅ
AA=ぇ
AB=ぉ
AC=ゃ
AD=ゅ
AE=ょ
AF=っ
B0=‐
B1=あ
B2=い
B3=う
B4=え
B5=お
B6=か
B7=き
B8=く
B9=け
BA=こ
BB=さ
BC=し
BD=す
BE=せ
BF=そ
C0=た
C1=ち
C2=つ
C3=て
C4=と
C5=な
C6=に
C7=ぬ
C8=ね
C9=の
CA=は
CB=ひ
CC=ふ
CD=へ
CE=ほ
CF=ま
D0=み
D1=む
D2=め
D3=も
D4=や
D5=ゆ
D6=よ
D7=ら
D8=り
D9=る
DA=れ
DB=ろ
DC=わ
DD=ん
DE=´
DF=¨
 
[close]

PS: It doesn't have caps off because without WVF and other wizardies the display was awuful, besides the letters became an exercise of guessing instead of actual reading.
Curiosity leads to knowledge,
be curious.

Bunkai

I'm going to add this here before I lose it or forget it




0x52F0 some race weather and road conditions
0x5A30 Looks like the titles for some stages or races.

I find no more text in the ROM. Other menu words like "PUSH START" and "RECORDS" are using compressions with specifics graphics for those letters (those graphics are already in images above, no need to add them again). Next step will be actual translation and see how everything goes.
Curiosity leads to knowledge,
be curious.