03-10-2016, 04:08 PM
|
Posts: 177
Threads: 14
Joined: Feb 2015
|
I would say that it is possible to add language options in the (U) ROM, but quite difficult. I took a stab at disassembling the SM64 (E) ROM and found that it had the exact same level commands as (U), but its assembly and text storage is vastly different. It looks like for the (E) ROM, they used different compiler optimizations than (J) or (U) ROMs. This means that the code is much shorter and harder to read and match up with the (U) ROM. That said, I was still able to identify similar menu functions and some language specific settings.
If you want to start digging into the ROM, I have a lot of notes in an n64split config file for SM64 (E). Here are some pertinent notes:
Code:
Functions:
(U) RAM / ROM (E) RAM / ROM Name
--------/------ 8026B05C/02A85C GetLanguage
801764E0/2269A0 801756A4/206744 MenuSelect
801758A0/225D60 801748D4/205974 SoundSelect(and language)
802D7B84/092B84 802ADC18/06D418 PutString(A3=string ptr)
Variables:
801A6D84(byte) Language in Menu (00 = English, 01 = Françias, 02 = Deutsch)
802030D2(half) Global Language returned from GetLanguage()
I have only looked at how the large text strings are stored for the menu. Each time PutString is called in the menus, it performs a lookup on the string. In this "Sound Select"/"Son"/"Sound" example, it is indexing into the String at 0x801A714C, where 0xB bytes are allocated for each string.
Code:
lb $t4, 0x801A6D84 # Load menu language (00=EN, 01=FR, 02=DE)
la $t6, 0x801A714C # String pointers for "Sound Select"
sll $t5, $t4, 2
subu $t5, $t5, $t4
sll $t5, $t5, 2
addu $t5, $t5, $t4 # t5 = 0xB * t4
addu $a3, $t5, $t6
addiu $a0, $zero, 2
addiu $a1, $zero, 0x2f
jal PutString
addiu $a2, $zero, 0x20
|