From 96911438b1f4bf525c38bb548349d75f82e5fd3f Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 21 Oct 2012 21:13:54 +0200 Subject: generic corse clear thingy --- NewerProjectKP.yaml | 1 + corseClear.yaml | 8 ++++++ src/corseClear.S | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 corseClear.yaml create mode 100644 src/corseClear.S diff --git a/NewerProjectKP.yaml b/NewerProjectKP.yaml index 5058432..024e6cb 100644 --- a/NewerProjectKP.yaml +++ b/NewerProjectKP.yaml @@ -2,6 +2,7 @@ output_dir: "NewerASM" code_address: 0x808D9000 modules: - processed/prolog.yaml + - processed/corseClear.yaml # - processed/apDebug.yaml # - processed/layoutDebug.yaml - processed/flipblock.yaml diff --git a/corseClear.yaml b/corseClear.yaml new file mode 100644 index 0000000..f4298ff --- /dev/null +++ b/corseClear.yaml @@ -0,0 +1,8 @@ +--- +source_files: [../src/corseClear.S] +hooks: + - name: GenericCorseClear + type: branch_insn + branch_type: bl + src_addr_pal: 0x80779A28 + target_func: 'GenericCorseClear' diff --git a/src/corseClear.S b/src/corseClear.S new file mode 100644 index 0000000..5ea8336 --- /dev/null +++ b/src/corseClear.S @@ -0,0 +1,81 @@ +.text +.extern loadArc__Q23m2d13EmbedLayout_cFPCcb +.extern loadAnimations__Q23m2d13EmbedLayout_cFPPCci +.extern loadGroups__Q23m2d13EmbedLayout_cFPPCcPii +.extern getPanes__Q23m2d13EmbedLayout_cCFPPCcPPQ34nw4r3lyt4Panei + +.global GenericCorseClear +GenericCorseClear: + stwu r1, -0x10(r1) + mflr r0 + stw r0, 0x14(r1) + stw r31, 0xC(r1) + mr r31, r3 + + addi r3, r31, 0x70 + lis r4, CorseClearArcName@h + ori r4, r4, CorseClearArcName@l + li r5, 0 + bl loadArc__Q23m2d13EmbedLayout_cFPCcb + + cmpwi r3, 0 + bne didLoad + li r3, 0 + b return +didLoad: + addi r3, r31, 0x70 + lis r4, CorseClearBrlytName@h + ori r4, r4, CorseClearBrlytName@l + li r5, 0 + lwz r12, 8(r3) + lwz r12, 0x14(r12) + mtctr r12 + bctrl + + addi r3, r31, 0x70 + lis r4, CorseClearAnims@h + ori r4, r4, CorseClearAnims@l + li r5, 3 + bl loadAnimations__Q23m2d13EmbedLayout_cFPPCci + + addi r3, r31, 0x70 + lis r4, CorseClearGroups@h + ori r4, r4, CorseClearGroups@l + lis r5, CorseClearGroupAnimIDs@h + ori r5, r5, CorseClearGroupAnimIDs@l + li r6, 3 + bl loadGroups__Q23m2d13EmbedLayout_cFPPCcPii + + lwz r3, 0x90(r31) + stw r3, 0x36C(r31) + + addi r3, r31, 0x70 + lis r4, CorseClearPaneNames@h + ori r4, r4, CorseClearPaneNames@l + addi r5, r31, 0x370 + li r6, 1 + + li r3, 1 +return: + lwz r0, 0x14(r1) + lwz r31, 0xC(r1) + mtlr r0 + addi r1, r1, 0x10 + blr + +.data +CorseClearArcName: .string "corseClear.arc" +CorseClearBrlytName: .string "corseClear_EngEU_00.brlyt" +CCInText: .string "corseClear_EngEU_00_inText.brlan" +CCLoopText: .string "corseClear_EngEU_00_loopText.brlan" +CCOutText: .string "corseClear_EngEU_00_outText.brlan" +A00_inText: .string "A00_inText" +A02_loopText: .string "A02_loopText" +A01_outText: .string "A01_outText" +N_marioClear_00: .string "N_marioClear_00" +.align 4 +CorseClearGroupAnimIDs: .long 0, 1, 2 +CorseClearAnims: .long CCInText, CCLoopText, CCOutText +CorseClearGroups: .long A00_inText, A02_loopText, A01_outText +CorseClearPaneNames: .long N_marioClear_00 + -- cgit v1.2.3