12-06-2017, 11:59 PM
|
Posts: 177
Threads: 14
Joined: Feb 2015
|
David recently noticed that segment 02 in the European SM64 ROM was significantly smaller than the other ROMS. From his notes:
ROM Offset Decompressed
US 0x108A40-0x114750 0x18A0E
Europe 0x0DE190-0x0E49F0 0x0E0CE
Japan 0x1076D0-0x112B50 0x15BAE
Shindou 0x0E42F0-0x0EF770 0x15BAE
I looked into it and it turns out that since the European ROM contains translations for English, French, and German, the encoded dialog text is broken into three additional MIO0 blocks instead of being included in segment 02. Those blocks are:
Language Offset Decompressed
English 0x0E49F0 0x9D24
French 0x0E9F50 0xB12C
German 0x0EF960 0xAD80
Looking at the segmented addresses contained within these blocks, it looks like they are loaded into segment 0x19.
It looks like the function at 8026B05C returns the selected language (halfword stored at 0x802030d2) and this is used to determine the correct base address of the dialog tables in segment 0x19. This is done many places throughout the code. One example, which uses 0x19009b9c for English, 0x1900a120 for French, or 0x19009cbc for Deutsch:
Code:
// 802B00DC / 06F8DC
proc_802B00DC:
addiu $sp, $sp, -0x38
sw $ra, 0x1c($sp)
jal GetLanguage // 8026B05C
sw $s0, 0x18($sp)
lui $a0, 0x8030
addiu $a0, $a0, -0x29b0
beqz $v0, @@IsEnglish
sw $v0, ($a0)
addiu $at, $zero, 1
beq $v0, $at, @@IsFrench
lui $a0, 0x1901
addiu $at, $zero, 2
beq $v0, $at, @@IsGerman
lui $a0, 0x1901
b @@LangSet
nop
@@IsEnglish:
lui $a0, 0x1901
jal SegmentedToVirtual // 802692F0
addiu $a0, $a0, -0x7328
b @@LangSet
sw $v0, 0x30($sp)
@@IsFrench:
jal SegmentedToVirtual // 802692F0
addiu $a0, $a0, -0x5ee0
b @@LangSet
sw $v0, 0x30($sp)
@@IsGerman:
jal SegmentedToVirtual // 802692F0
addiu $a0, $a0, -0x6344
sw $v0, 0x30($sp)
@@LangSet:
...
|