summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/spritetex.S131
1 files changed, 111 insertions, 20 deletions
diff --git a/src/spritetex.S b/src/spritetex.S
index 7c342d8..7fa09ba 100755
--- a/src/spritetex.S
+++ b/src/spritetex.S
@@ -1,6 +1,6 @@
.extern sprintf
.extern GenerateRandomNumber
-.extern BombExplodeState
+.extern BombSleepState
.extern AbsValue
.extern Cloud_death_execute
.extern Cloud_execute
@@ -858,7 +858,40 @@ TEX_HuckitBallsInherit:
or r4, r4, r10
blr
+.global BomheiForceFacingDirection
+BomheiForceFacingDirection:
+ stb r3, 0x348(r30)
+ lwz r6, 4(r30)
+ clrlwi r6, r6, 28
+ cmpwi r6, 0
+ beqlr
+ subi r6, r6, 1
+ stb r6, 0x348(r30)
+ blr
+
+.global BomheiCollisionCallback
+.extern collisionCallback__5dEn_cFP13ActivePhysicsP13ActivePhysics
+BomheiCollisionCallback:
+ lwz r5, 4(r4)
+ lhz r5, 8(r5)
+ cmpwi r5, 0x70 #hammerbros
+ beqlr
+ cmpwi r5, 0x72 #lift hammerbros
+ beqlr
+ b collisionCallback__5dEn_cFP13ActivePhysicsP13ActivePhysics
+
+.global JustOneBomb
+.extern ContinueFromJustOneBomb
+JustOneBomb:
+ lwz r5, 4(r3)
+ extrwi r5, r5, 4, 20
+ cmpwi r5, 0
+ beq dontDoThis
+ li r0, 1
+dontDoThis:
+ stw r0, 0x6F0(r3)
+ b ContinueFromJustOneBomb
.global HammerTime
HammerTime:
@@ -882,13 +915,25 @@ HammerTime:
cmpwi r8, 5
beq ThrowLemmyBall
+ # Use the normal settings
+ lhz r8, 8(r31)
+ cmpwi r8, 0x70
+ beq isHammerBros
+ cmpwi r8, 0x72
+ beq isLiftHammerBros
+ blr
+isHammerBros:
+ oris r4, r0, 0xF
+ blr
+isLiftHammerBros:
+ ori r4, r0, 0x10
blr
ThrowBobomb:
li r3, 133
- lis r4, 0x3000
- ori r4, r4, 0x0041
+ lbz r4, 0x348(r31)
+ addi r4, r4, 1
blr
ThrowGoomba:
@@ -951,7 +996,7 @@ HammerLaunch:
# r30 is self, all others are volatile
lwz r5, 4(r30)
- lbz r8, 0x348(r30)
+ lbz r8, 0x348(r31)
srwi r5, r5, 8
andi. r5, r5, 0xF
@@ -977,8 +1022,8 @@ HammerLaunch:
cmpwi r5, 5
beq LemmyLaunch
-# cmpwi r5, 1
-# beq BombLaunch
+ cmpwi r5, 1
+ beq BombLaunch
li r6, 1
slwi r6, r6, 2 # size *= 4 (size of float)
@@ -1036,20 +1081,32 @@ BombLaunch:
stw r8, 0x34(sp)
stw r9, 0x30(sp)
+ li r0, 180
+ stw r0, 0x5EC(r31) # Burning time of the bomb
+
+ li r0, 0
+ stw r0, 0x38(sp)
+ lfs f1, 0x38(sp)
+ addi r3, r31, 0x5C0
+ li r4, 0
+.extern setFrameForEntry__Q23m3d8anmClrFfi
+ bl setFrameForEntry__Q23m3d8anmClrFfi
+
mr r3, r31
lwz r12, 0x60(r31)
lwz r12, 0xD4(r12)
mtctr r12
- lis r4, BombExplodeState@h
- ori r4, r4, BombExplodeState@l
-
- lwz r5, 4(r30)
- srwi r5, r5, 28
+ lis r4, BombSleepState@h
+ ori r4, r4, BombSleepState@l
- mulli r5, r5, 0x40
-
- add r4, r4, r5
+#What in the FUCK are you doing, Ancient Code
+# lwz r5, 4(r30)
+# srwi r5, r5, 28
+#
+# mulli r5, r5, 0x40
+#
+# add r4, r4, r5
bctrl
@@ -1071,7 +1128,7 @@ BombLaunch:
li r6, 0
slwi r6, r6, 2 # size *= 4 (size of float)
- lwz r8, 0x348(r30)
+ lbz r8, 0x348(r31)
cmpwi r8, 0
bne BombFacingLeft
@@ -1095,25 +1152,59 @@ BombFacingLeft:
blr
+.global HammerDontTrashEn450
+HammerDontTrashEn450:
+ lhz r5, 8(r3)
+ cmpwi r5, 0x73 #hammer
+ bnelr
+ #beq FUCK_THE_SHITTY_HAMMER
+ stw r4, 0x450(r3)
+ blr
+FUCK_THE_SHITTY_HAMMER:
+ lbz r4, 0x348(r31)
+ stb r4, 0x348(r3)
+ blr
+
+.global HammerDontTrashEn420
+HammerDontTrashEn420:
+ lhz r5, 8(r3)
+ cmpwi r5, 0x73 #hammer
+ bnelr
+ stw r0, 0x420(r3)
+ blr
+.global HammerIgnoreEn420
+HammerIgnoreEn420:
+ lwz r0, 0x420(r3)
+ lhz r5, 8(r3)
+ cmpwi r5, 0x73 #hammer
+ beqlr
+ li r0, 0
+ blr
.global HammerSpin
HammerSpin:
-# sth r3, 0x100(r31)
+ lwz r5, 4(r10)
+ extrwi r5, r5, 4,20
+ cmpwi r5, 1
+ beqlr # Don't set this rotation for bombs
+ sth r3, 0x100(r31)
blr
.global HammerLeft
HammerLeft:
+ sth r29, 0x104(r31)
+
lbz r8, 0x348(r10)
lha r7, 0x102(r31)
cmpwi r8, 0
bne GoingLeft
blr
-
-
+
+
GoingLeft:
li r8, 1
@@ -1583,10 +1674,10 @@ AddAmount:
.float 32.0
LaunchAngle:
- .float 4.0, 2.5, 1.5
+ .float 2.4, 3.0, 1.5
LaunchAngleLeft:
- .float -4.0, -2.5, -1.5
+ .float -2.4, -3.0, -1.5
.align 4