From 4dd473d8132d44f6d11e23fb682f419a4c2eab1e Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 7 Oct 2012 04:09:48 +0200 Subject: half assed fix for the hammer suit cap thing --- kamek_pal.x | 3 +++ poweruphax.yaml | 6 ++++++ src/poweruphax.S | 14 ++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/kamek_pal.x b/kamek_pal.x index 9d721ee..4a97bc6 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -1,6 +1,9 @@ SECTIONS { /* Scrolling is annoying, clown car goes here! */ + DrawTheFuckingHat = 0x800CA664; + DontDrawTheFuckingHat = 0x800CA698; + continueFromMpPauseFix1 = 0x8004E050; continueFromMpPauseFix2 = 0x801415A0; CheckIfSinglePlayer = 0x800FCAD0; diff --git a/poweruphax.yaml b/poweruphax.yaml index f6b6102..a9c8c97 100644 --- a/poweruphax.yaml +++ b/poweruphax.yaml @@ -163,6 +163,12 @@ hooks: - name: DisableHat99Thing type: nop_insn area_pal: 0x80089D48 + + - name: DisableHatForHammer + type: branch_insn + branch_type: b + src_addr_pal: 0x800CA658 + target_func: 'DisableHatForHammer' - name: LetPlayerGetHammerItem type: branch_insn diff --git a/src/poweruphax.S b/src/poweruphax.S index 34cca4b..7181b4d 100644 --- a/src/poweruphax.S +++ b/src/poweruphax.S @@ -29,6 +29,20 @@ .set f1,1; .set f30,30; .set f31,31 #endif +.global DisableHatForHammer +DisableHatForHammer: + lwz r0, 0x17C(r31) + clrlwi. r0, r0, 31 + beq DontDrawTheFuckingHat_ + lbz r0, 0x152(r31) + cmpwi r0, 7 + beq DontDrawTheFuckingHat_ + b DrawTheFuckingHat +DontDrawTheFuckingHat_: + b DontDrawTheFuckingHat # this is a hack to avoid implementing R_PPC_REL14 +.extern DontDrawTheFuckingHat +.extern DrawTheFuckingHat + .global GetInfoFromDumbTable GetInfoFromDumbTable: lis r3, SomeTable@h -- cgit v1.2.3