From b8848b5f806addd48c20c0aa8606d281ec00d23f Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 28 Feb 2013 05:49:03 +0100 Subject: stuff for the big renga block --- spritetex.yaml | 15 +++++++++++++++ src/spritetex.S | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/spritetex.yaml b/spritetex.yaml index a2139f2..c4d7e0d 100644 --- a/spritetex.yaml +++ b/spritetex.yaml @@ -1,6 +1,21 @@ --- source_files: [../src/spritetex.S] hooks: + - name: BigBlockSound1 + type: branch_insn + branch_type: bl + src_addr_pal: 0x809B8EBC + target_func: 'BigBlockSound' + - name: BigBlockSound2 + type: branch_insn + branch_type: bl + src_addr_pal: 0x809B9040 + target_func: 'BigBlockSound' + - name: BigBlockLeapingItem + type: branch_insn + branch_type: bl + src_addr_pal: 0x809B91A4 + target_func: 'BigBlockLeapingItem' # - name: BlackClouds # type: patch diff --git a/src/spritetex.S b/src/spritetex.S index f5d5ee5..7c342d8 100755 --- a/src/spritetex.S +++ b/src/spritetex.S @@ -21,6 +21,47 @@ .set sp, 1 +.global BigBlockSound +.extern Delete__7fBase_cFv +.extern PlaySoundWithFunctionB4 +.extern SoundRelatedClass +.extern DetachSound__Q34nw4r3snd11SoundHandleFv +BigBlockSound: + stwu r1, -0x10(r1) + mflr r0 + stw r0, 0x14(r1) + stw r31, 8(r1) + mr r31, r3 + + # create a SoundHandle + li r3, 0 + stw r3, 0xC(r1) + + # call PSWFB4 + lis r3, SoundRelatedClass@h + ori r3, r3, SoundRelatedClass@l + lwz r3, 0(r3) + addi r4, r1, 0xC + li r5, 510 + li r6, 1 + bl PlaySoundWithFunctionB4 + + # destroy SoundHandle + addi r3, r1, 0xC + bl DetachSound__Q34nw4r3snd11SoundHandleFv + + mr r3, r31 + lwz r31, 8(r1) + lwz r0, 0x14(r1) + mtlr r0 + addi r1, r1, 0x10 + b Delete__7fBase_cFv + +.global BigBlockLeapingItem +BigBlockLeapingItem: + oris r0, r0, 0xD00 + blr + .global BooZOrder BooZOrder: mr r3, r30 -- cgit v1.2.3