diff options
-rw-r--r-- | kamek_pal.x | 4 | ||||
-rw-r--r-- | poweruphax.yaml | 44 | ||||
-rw-r--r-- | src/poweruphax.S | 69 |
3 files changed, 117 insertions, 0 deletions
diff --git a/kamek_pal.x b/kamek_pal.x index ef3947b..bfe01d5 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -4,6 +4,10 @@ SECTIONS { search__7fBase_cFUi = 0x80162E40; search__7fBase_cF6ActorsP7fBase_c = 0x80162E90; + AddStockPowerup = 0x800BB330; + continueFromStrongBox2 = 0x808AAFD0; + continueFromStrongBox = 0x808AA4D8; + _8042A788 = 0x8042A788; somethingAboutSound__FPv = 0x8019CB30; diff --git a/poweruphax.yaml b/poweruphax.yaml index d4a1f1d..c46cb5f 100644 --- a/poweruphax.yaml +++ b/poweruphax.yaml @@ -688,3 +688,47 @@ hooks: src_addr_pal: 0x808C5910 branch_type: b + + + - name: AddHSToBattleItem_AddArcName + type: add_func_pointer + target_func: 'I_hammerArcFilename' + src_addr_pal: 0x80951A48 + - name: AddHSToBattleItem_FixKinokoBrres1 + type: add_func_pointer + target_func: 'g3d_I_kinoko_brres' + src_addr_pal: 0x80951ACC + - name: AddHSToBattleItem_FixKinokoBrres2 + type: add_func_pointer + target_func: 'g3d_I_kinoko_brres' + src_addr_pal: 0x80951ADC + - name: AddHSToBattleItem_AddBrres + type: add_func_pointer + target_func: 'I_hammerResFile' + src_addr_pal: 0x80951AE8 + - name: AddHSToBattleItem_FixPropellerModel + type: add_func_pointer + target_func: 'I_propeller_model' + src_addr_pal: 0x80951B04 + - name: AddHSToBattleItem_AddModel + type: add_func_pointer + target_func: 'I_hammerModelName' + src_addr_pal: 0x80951B18 + - name: AddHSToBattleItem_FixWait2Anim + type: branch_insn + branch_type: bl + src_addr_pal: 0x807BA4A8 + target_func: 'AddHSToBattleItem_FixWait2Anim' + + - name: StrongboxInit + type: branch_insn + branch_type: b + src_addr_pal: 0x808AA450 + target_func: 'StrongboxInit' + + - name: StrongboxGiveBattleItem + type: branch_insn + branch_type: b + src_addr_pal: 0x808AAF90 + target_func: 'StrongboxGiveBattleItem' + diff --git a/src/poweruphax.S b/src/poweruphax.S index a4c7f14..16576c1 100644 --- a/src/poweruphax.S +++ b/src/poweruphax.S @@ -955,6 +955,20 @@ I_hammerModelName: # .string "I_hammer" .string "I_fireflower" +.global g3d_I_kinoko_brres +g3d_I_kinoko_brres: .string "g3d/I_kinoko.brres" + +.global I_propeller_model +I_propeller_model: .string "I_propeller_model" + +.text +.global AddHSToBattleItem_FixWait2Anim +AddHSToBattleItem_FixWait2Anim: + lis r4, wait2@h + ori r4, r4, wait2@l + blr +.data +wait2: .string "wait2" #PowerupTexDebugStr: # .string "Plumber::SetPowerupTexture() called on class %p with texnum %d lr=%p\n" @@ -969,3 +983,58 @@ I_hammerModelName: #.global HammerModelName #HammerModelName: # .string "bros_hammer" + +.text +.extern continueFromStrongBox +.global StrongboxInit +StrongboxInit: + # MODE + li r4, 2 + stw r4, 0x8E0(r30) + # ITEM COUNT (nybble 8) + extrwi r4, r7, 4, 12 + stw r4, 0x8E8(r30) + b continueFromStrongBox + +.extern continueFromStrongBox2 +.extern AddStockPowerup +.extern create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc +.global StrongboxGiveBattleItem +StrongboxGiveBattleItem: + # save a reg we can use + stw r29, 0x24(r1) + + # get number of current item + lhz r6, 0x8FA(r30) + # create a shift amount... + slwi r6, r6, 2 + lwz r7, 4(r30) + # ..and use it to get the item + srw r7, r7, r6 + clrlwi r29, r7, 28 + + # now give it + mr r4, r29 + bl AddStockPowerup + + # and then copy the position + lfs f1, 0xAC(r30) + stfs f1, 0x10(r1) + lfs f1, 0xB0(r30) + lfs f2, 0x8D8(r30) + fsubs f1, f1, f2 + stfs f1, 0x14(r1) + lfs f1, 0xB4(r30) + stfs f1, 0x18(r1) + + li r3, 0x25 + or r4, r4, r7 + addi r5, r1, 0x10 + li r6, 0 + li r7, 0 + bl create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc + + # restore our reg + lwz r29, 0x24(r1) + b continueFromStrongBox2 + |