Translate teleport names

This commit is contained in:
jeffman 2018-12-14 00:50:56 -05:00
parent 973e63c669
commit 42bf108c76
5 changed files with 163 additions and 0 deletions

View File

@ -676,5 +676,16 @@ namespace ScriptTool
};
return table;
}
public static FixedStringCollection ReadTeleportNames(byte[] rom)
{
var table = ReadFixedStringTable(rom, 0xB2AD10, 0x10, 0x14);
table.TablePointers = new int[]
{
0xC5F54,
0xC6234
};
return table;
}
}
}

View File

@ -326,6 +326,10 @@ namespace ScriptTool
0xB1BA61,
0xB1BA6E,
0xB1BA7B);
// Teleport destinations
var teleportNames = M12TextTables.ReadTeleportNames(m12Rom);
DecompileFixedStringCollection(m12Decompiler, m12Rom, "m12-teleport-names", teleportNames);
}
static void DecompileM12MiscStringCollection(string name, MiscStringCollection miscStringCollection)
@ -504,6 +508,9 @@ namespace ScriptTool
// Other
CompileM12HardcodedStringCollection("m12-other", ref referenceAddress);
// Teleport destinations
CompileM12FixedStringCollection("m12-teleport-names", ref referenceAddress);
}
static void CompileM12MiscStringCollection(string name, ref int referenceAddress)

View File

@ -698,6 +698,43 @@ ldrh r3,[r3]
b 0x080C959A
.pool
//---------------------------------------------------------
// Teleport window hacks
//---------------------------------------------------------
// Note that the teleport table pointer has 6 instances in the ROM,
// but we are only changing two of them in m12-teleport-names.json.
// This is because the other four pointers are used for accessing
// the teleport flag/coord data in the table instead of the text.
// We need a couple hacks to make this work...
.org 0x80C5E8A :: ldr r7,[pc,0xC8] // This is used for text; load from one of the
// pointers that we DID change (previously it
// loaded from a pointer that we didn't change)
.org 0x80C5D8A
lsl r1,r0,4 // Text entries are now 16 bytes each, so multiply by 16
ldr r7,[pc,0x1C4] // ... to make room for loading r7 with the text pointer
add r1,r1,r7
ldrb r0,[r1]
ldr r7,[pc,0x13C] // The game uses r7 as the data pointer when looping back,
// so let's sneak the data pointer in here before it loops
.org 0x80C5E96
lsl r0,r1,4
nop
nop
.org 0x80C5F2C
lsl r0,r1,4
nop
nop
.org 0x80C620C
lsl r0,r1,4
nop
nop
//==============================================================================
// Data files
//==============================================================================

View File

@ -57,6 +57,7 @@ Hard-coded characters:
0x01: Teleport alpha
0x08: Teleport beta
0x3001FA4: Escargo Express items (36 of them)
0x3001FC8: event flags
0x30023D0: current cash balance
0x30023D4: current ATM balance
0x3002500: buttons being pressed

View File

@ -0,0 +1,107 @@
{
"StringsLocation": 11709712,
"TablePointers": [
810836,
811572
],
"NumEntries": 16,
"EntryLength": 16,
"StringRefs": [
{
"Index": 0,
"OldPointer": 11709712,
"Old": "ぁぁぁぁぁぁぁぁぁぁ[00 FF]",
"New": "[00 FF]"
},
{
"Index": 1,
"OldPointer": 11709732,
"Old": "オネット[00 FF]",
"New": "Onett[00 FF]"
},
{
"Index": 2,
"OldPointer": 11709752,
"Old": "ツ-ソン[00 FF]",
"New": "Twoson[00 FF]"
},
{
"Index": 3,
"OldPointer": 11709772,
"Old": "スリ-ク[00 FF]",
"New": "Threed[00 FF]"
},
{
"Index": 4,
"OldPointer": 11709792,
"Old": "サタ-ンバレ-[00 FF]",
"New": "Saturn Valley[00 FF]"
},
{
"Index": 5,
"OldPointer": 11709812,
"Old": "フォ-サイド[00 FF]",
"New": "Fourside[00 FF]"
},
{
"Index": 6,
"OldPointer": 11709832,
"Old": "ウィンタ-ズ[00 FF]",
"New": "Winters[00 FF]"
},
{
"Index": 7,
"OldPointer": 11709852,
"Old": "サマ-ズ[00 FF]",
"New": "Summers[00 FF]"
},
{
"Index": 8,
"OldPointer": 11709872,
"Old": "スカラビ[00 FF]",
"New": "Scaraba[00 FF]"
},
{
"Index": 9,
"OldPointer": 11709892,
"Old": "ランマ[00 FF]",
"New": "Dalaam[00 FF]"
},
{
"Index": 10,
"OldPointer": 11709912,
"Old": "まきょう[00 FF]",
"New": "Deep Darkness[00 FF]"
},
{
"Index": 11,
"OldPointer": 11709932,
"Old": "グミぞくのむら[00 FF]",
"New": "Tenda Village[00 FF]"
},
{
"Index": 12,
"OldPointer": 11709952,
"Old": "ちていたいりく[00 FF]",
"New": "Underworld[00 FF]"
},
{
"Index": 13,
"OldPointer": 11709972,
"Old": "ぁぁぁぁぁぁぁぁぁぁ[00 FF]",
"New": "[00 FF]"
},
{
"Index": 14,
"OldPointer": 11709992,
"Old": "ドコドコさばく[00 FF]",
"New": "Dusty Dunes[00 FF]"
},
{
"Index": 15,
"OldPointer": 11710012,
"Old": "ぁぁぁぁぁぁぁぁぁぁ[00 FF]",
"New": "[00 FF]"
}
]
}