From ac061cb9e98351805c25c461bcb70b7bde272dc3 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 2 Aug 2011 01:14:59 +0200 Subject: Hammer Suit fixed --- poweruphax.yaml | 13 +++++++++++++ src/poweruphax.S | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/poweruphax.yaml b/poweruphax.yaml index 8e23c10..951d14c 100644 --- a/poweruphax.yaml +++ b/poweruphax.yaml @@ -172,6 +172,12 @@ hooks: src_addr_pal: 0x80AF117C target_func: 'SetHammerToEnItemDCA' + - name: SetHammerToEnItemDCASpecial + type: branch_insn + branch_type: b + src_addr_pal: 0x80A2C0B4 + target_func: 'SetHammerToEnItemDCASpecial' + - name: PlumberSetPowerupFix type: branch_insn branch_type: b @@ -243,3 +249,10 @@ hooks: branch_type: bl src_addr_pal: 0x80143884 target_func: 'GetPowerupScaleFloatAddr_r8_trash_r0_valshl2_r7_dest' + + - name: FixPowerupSound + type: branch_insn + branch_type: bl + src_addr_pal: 0x80141334 + target_func: 'FixPowerupSound' + diff --git a/src/poweruphax.S b/src/poweruphax.S index bfd8c83..9a334f6 100644 --- a/src/poweruphax.S +++ b/src/poweruphax.S @@ -367,6 +367,20 @@ DontSetHammer: blr +.global SetHammerToEnItemDCASpecial +SetHammerToEnItemDCASpecial: + cmplwi r4, 0x19 + b _not19 + li r0, 0xD + sth r0, 0xDCA(r3) +_not19: + cmplwi r4, 6 + bnelr + li r0, 5 + sth r0, 0xDCA(r3) + blr + + #.global EnItem_BindAnimation_Fix #EnItem_BindAnimation_Fix: # lhz r0, 0xDCA(r3) @@ -593,11 +607,36 @@ gotHammerStatus: +.global FixPowerupSound +FixPowerupSound: + # WARNING! This is a bad, bad, bad hack. + # I was too lazy to add anything to the linker script, so... + + # We branch at 80141334, so our LR is 80141338 + # We need to jump to 80141384 + mflr r3 + addi r3, r3, 0x4C + mtlr r3 + + lwz r0, 0x1090(r29) + lis r3, PowerupSounds@h + ori r3, r3, PowerupSounds@l + slwi r4, r0, 2 + lwzx r4, r3, r4 + mr r3, r29 + li r5, 0 + + blr + + .data +PowerupSounds: + .long 273, 274, 274, 275, 276, 277, 274, 274 + SomeTable: .long SomeTable_802F5580 .long SomeTable_802F56C0 -- cgit v1.2.3