News: 11 March 2016 - Forum Rules

Author Topic: [Translation Hack] Initial D - Gaiden (GB).  (Read 961 times)

Bunkai

  • Jr. Member
  • **
  • Posts: 49
    • View Profile
[Translation Hack] Initial D - Gaiden (GB).
« on: April 19, 2022, 08:27:03 pm »
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=゜

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

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]

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
Last bank with Graphics: 0x34000
« Last Edit: May 25, 2022, 11:53:37 am by Bunkai »
Curiosity leads to knowledge,
be curious.

Bunkai

  • Jr. Member
  • **
  • Posts: 49
    • View Profile
Re: [Translation Hack] Initial D - Gaiden (GB).
« Reply #1 on: May 16, 2022, 07:05:19 am »
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 + "?"



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.
« Last Edit: May 16, 2022, 09:37:41 am by Bunkai »
Curiosity leads to knowledge,
be curious.

abridgewater

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: [Translation Hack] Initial D - Gaiden (GB).
« Reply #2 on: May 16, 2022, 01:09:40 pm »

We discussed this in the Discord, but I figured I'd summarize here for posterity:
cd e0 0c (at $44a3) disassembles as
Code: [Select]
call $0ce0At $0ce0 is e1 cd 05 0d e5 c9, which is
Code: [Select]
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
Code: [Select]
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

  • Jr. Member
  • **
  • Posts: 49
    • View Profile
Re: [Translation Hack] Initial D - Gaiden (GB).
« Reply #3 on: May 25, 2022, 11:46:50 am »
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
« Last Edit: May 25, 2022, 01:15:52 pm by Bunkai »
Curiosity leads to knowledge,
be curious.