summaryrefslogtreecommitdiff
path: root/src/poweruphax.S
diff options
context:
space:
mode:
authorColin Noga <Tempus@Spectrum-Song.local>2011-08-14 13:38:04 -0500
committerColin Noga <Tempus@Spectrum-Song.local>2011-08-14 13:38:04 -0500
commit74a7d023469eb0a5a2dc713c74709b11e1815b8a (patch)
tree017199545fe6110e2e700907ea393a6654865cb8 /src/poweruphax.S
parentead037af2d2665e94ed8d804a1e220c47ba54db9 (diff)
parent4d482b80241de4512b68bc160dfc29b7e521134d (diff)
downloadkamek-74a7d023469eb0a5a2dc713c74709b11e1815b8a.tar.gz
kamek-74a7d023469eb0a5a2dc713c74709b11e1815b8a.zip
Merge branch 'level-select' of treeki:newergit/Kamek into level-select
Diffstat (limited to 'src/poweruphax.S')
-rw-r--r--src/poweruphax.S38
1 files changed, 28 insertions, 10 deletions
diff --git a/src/poweruphax.S b/src/poweruphax.S
index 9274b78..e028eb9 100644
--- a/src/poweruphax.S
+++ b/src/poweruphax.S
@@ -16,6 +16,7 @@
.extern continuePlumberSetPowerupTexture
.extern doneSettingThePowerupTexture
.extern doneSettingThePowerupTexture2
+.extern returnFromPowerupSoundChange
#ifndef __MWERKS__
.set r0,0; .set r1,1; .set r2,2; .set r3,3; .set r4,4
@@ -391,16 +392,30 @@ _not19:
.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
+ #lis r3, DBString@h
+ #ori r3, r3, DBString@l
+ #lwz r4, 0x1090(r29)
+ #crclr 4*cr1+eq
+ #bl OSReport
+
+ lwz r5, 0x14DC(r29) # Original powerup
+ lwz r0, 0x1090(r29) # New powerup
+ # if NEW is 1 (big) and OLD is not 0 or 3, then play 273 (powerdown)
+ cmpwi r0, 1
+ bne dontConsiderPowerdown
+
+ cmpwi r5, 0
+ beq dontConsiderPowerdown
+ cmpwi r5, 3
+ beq dontConsiderPowerdown
+ # If the player is here, he was downgraded from a higher powerup to Big Mario
+ # So play the powerdown sound
+ mr r3, r29
+ li r4, 273
+ li r5, 0
+ b returnFromPowerupSoundChange
- lwz r0, 0x1090(r29)
+dontConsiderPowerdown:
lis r3, PowerupSounds@h
ori r3, r3, PowerupSounds@l
slwi r4, r0, 2
@@ -408,7 +423,7 @@ FixPowerupSound:
mr r3, r29
li r5, 0
- blr
+ b returnFromPowerupSoundChange
.global WeirdAnimLoadHack
@@ -719,6 +734,9 @@ I_hammerModelName:
PowerupTexDebugStr:
.string "Plumber::SetPowerupTexture() called on class %p with texnum %d lr=%p\n"
+DBString:
+ .string "PW:%d\n"
+
#.global BrosModelFilename
#BrosModelFilename:
# .string "g3d/bros.brres"