summaryrefslogtreecommitdiff
path: root/src/bossPlayerClown.S
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-02-22 00:26:14 +0100
committerTreeki <treeki@gmail.com>2013-02-22 00:26:14 +0100
commit457a40644f0a492ed8acf8dbf66888bee9035100 (patch)
tree759ceec3d2d7a8ecaad6d60ed682284441678db7 /src/bossPlayerClown.S
parent1aa3c19834f16d5153fba34c7ef9dc5a66be9466 (diff)
downloadkamek-457a40644f0a492ed8acf8dbf66888bee9035100.tar.gz
kamek-457a40644f0a492ed8acf8dbf66888bee9035100.zip
more updates and fixes to the final boss than I can count
Diffstat (limited to '')
-rw-r--r--src/bossPlayerClown.S46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/bossPlayerClown.S b/src/bossPlayerClown.S
new file mode 100644
index 0000000..b1d00a5
--- /dev/null
+++ b/src/bossPlayerClown.S
@@ -0,0 +1,46 @@
+.text
+.align 4
+.extern ContinueFromClownCarDetectAdjacent
+.extern calculateAdjacentCollision__14collisionMgr_cFPf
+.global ClownCarDetectAdjacents
+ClownCarDetectAdjacents:
+ addi r3, r30, 0x1EC
+ li r4, 0
+ bl calculateAdjacentCollision__14collisionMgr_cFPf
+ cmpwi r3, 0
+ beq notAdjacent
+
+ # what direction are we in?
+ lfs f1, 0xE8(r30) # x speed
+ lis r4, zeroFloat@h
+ ori r4, r4, zeroFloat@l
+ lfs f2, 0(r4)
+
+ lbz r4, 0x348(r30)
+
+ cmpwi r4, 1
+ beq isLeft
+
+ # RIGHT
+ fcmpo cr0, f1, f2 # xspeed > 0
+ blt notAdjacent
+ stfs f2, 0xE8(r30)
+ b notAdjacent
+
+isLeft:
+ # LEFT
+ fcmpo cr0, f1, f2 # xspeed < 0
+ bgt notAdjacent
+ stfs f2, 0xE8(r30)
+
+notAdjacent:
+ # END HERE
+
+ mr r3, r30
+ b ContinueFromClownCarDetectAdjacent
+
+
+.data
+.align 4
+zeroFloat: .float 0.0
+