From 8102791c2222c31d80858cd1d12b208dcd4ecbc3 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 16 Sep 2012 04:31:01 +0200 Subject: added an untested world name thing --- fileselect.yaml | 1 + src/fileselect.S | 28 ++++++++++++++++++++++++++++ src/newer.cpp | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/fileselect.yaml b/fileselect.yaml index 7b22520..5b2ac2c 100644 --- a/fileselect.yaml +++ b/fileselect.yaml @@ -145,5 +145,6 @@ hooks: - {name: DFNiceTitle, type: branch_insn, branch_type: bl, src_addr_pal: 0x8077D044, target_func: 'DFNiceTitle'} + - {name: DFNiceWorldName, type: branch_insn, branch_type: bl, src_addr_pal: 0x8077DA10, target_func: 'DFNiceWorldName'} diff --git a/src/fileselect.S b/src/fileselect.S index b243e7f..0c1590c 100644 --- a/src/fileselect.S +++ b/src/fileselect.S @@ -51,6 +51,34 @@ DFNiceTitle: mtctr r12 bctr +.extern NewerWorldNames +.global DFNiceWorldName +DFNiceWorldName: + stwu r1, -0x10(r1) + mflr r0 + stw r0, 0x14(r1) + stw r20, 0xC(r1) + mr r20, r4 + + # get Newer map number + lbz r6, 0x6FC(r31) + slwi r6, r6, 4 + lis r7, NewerWorldNames@h + ori r7, r7, NewerWorldNames@l + lwzx r4, r7, r6 + + mr r3, r20 + lwz r12, 0(r3) + lwz r12, 0x7C(r12) + mtctr r12 + bctrl + + lwz r20, 0xC(r1) + lwz r0, 0x14(r1) + mtlr r0 + addi r1, r1, 0x10 + blr + .align 4 .data diff --git a/src/newer.cpp b/src/newer.cpp index 314b50f..215dfeb 100644 --- a/src/newer.cpp +++ b/src/newer.cpp @@ -44,7 +44,7 @@ NWRWorld NewerWorldForLevelID(int w, int l) { } -static const wchar_t *NewerWorldNames[] = { +const wchar_t *NewerWorldNames[] = { L"Yoshi's Island", L"Rubble Ruins", L"Soggy Sewers", -- cgit v1.2.3