summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-02-28 05:49:33 +0100
committerTreeki <treeki@gmail.com>2013-02-28 05:49:33 +0100
commit9880d3e1e0fff5b30366ebb886676ca3251cf151 (patch)
tree59960dc97fc5b1359021d789bc9d34206e80793c
parentb8848b5f806addd48c20c0aa8606d281ec00d23f (diff)
downloadkamek-9880d3e1e0fff5b30366ebb886676ca3251cf151.tar.gz
kamek-9880d3e1e0fff5b30366ebb886676ca3251cf151.zip
finish the stupid hammer bro hack
-rw-r--r--kamek_pal.x4
-rw-r--r--spritetex.yaml68
-rwxr-xr-xsrc/spritetex.S131
3 files changed, 182 insertions, 21 deletions
diff --git a/kamek_pal.x b/kamek_pal.x
index c4bb1d6..c3ceadd 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -1,6 +1,8 @@
SECTIONS {
GetPosForLayoutEffect__FP7Point3db = 0x800B37E0;
+ ContinueFromJustOneBomb = 0x80A123AC;
+
SmoothRotation__FPsss = 0x8015F630;
KazanRock_OriginalCollisionCallback = 0x8081F420;
@@ -156,7 +158,7 @@ SECTIONS {
AlwaysDrawBranch = 0x80064544;
GenerateRandomNumber = 0x800B2EE0;
OneofManySoundPlayers = 0x800CE9B0;
- BombExplodeState = 0x80B12A48;
+ BombSleepState = 0x80B12A88;
NoFreezie = 0x800A0B08;
GameTimer = 0x8042A350;
GameTimerB = 0x80D25BF8;
diff --git a/spritetex.yaml b/spritetex.yaml
index c4d7e0d..3e1851e 100644
--- a/spritetex.yaml
+++ b/spritetex.yaml
@@ -540,31 +540,99 @@ hooks:
target_func: 'TEX_HuckitBallsInherit'
+ - name: BomheiForceFacingDirection
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x809C9020
+ target_func: 'BomheiForceFacingDirection'
+ - name: BomheiCollisionCallback
+ type: add_func_pointer
+ src_addr_pal: 0x80ACE5D0
+ target_func: 'BomheiCollisionCallback'
- name: HammerTime
type: branch_insn
branch_type: bl
+ src_addr_pal: 0x80A123F0
+ target_func: 'HammerTime'
+ - name: LiftHammerTime
+ type: branch_insn
+ branch_type: bl
src_addr_pal: 0x80A5BCB0
target_func: 'HammerTime'
- name: HammerLaunch
type: branch_insn
branch_type: bl
+ src_addr_pal: 0x80A11ED8
+ target_func: 'HammerLaunch'
+ - name: LiftHammerLaunch
+ type: branch_insn
+ branch_type: bl
src_addr_pal: 0x80A5BA68
target_func: 'HammerLaunch'
- name: HammerLeft
type: branch_insn
branch_type: bl
+ src_addr_pal: 0x80A11F14
+ target_func: 'HammerLeft'
+ - name: LiftHammerLeft
+ type: branch_insn
+ branch_type: bl
src_addr_pal: 0x80A5BAA4
target_func: 'HammerLeft'
+ - name: HammerDontTrashEn450
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A120D8
+ target_func: 'HammerDontTrashEn450'
+ - name: LiftHammerDontTrashEn450
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A5BC68
+ target_func: 'HammerDontTrashEn450'
+
+ - name: HammerDontTrashEn420
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A12024
+ target_func: 'HammerDontTrashEn420'
+ - name: LiftHammerDontTrashEn420
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A5BBB4
+ target_func: 'HammerDontTrashEn420'
+
+ - name: HammerIgnoreEn420
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A12074
+ target_func: 'HammerIgnoreEn420'
+ - name: LiftHammerIgnoreEn420
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80A5BC04
+ target_func: 'HammerIgnoreEn420'
+
- name: HammerSpin
type: branch_insn
branch_type: bl
+ src_addr_pal: 0x80A11F00
+ target_func: 'HammerSpin'
+ - name: LiftHammerSpin
+ type: branch_insn
+ branch_type: bl
src_addr_pal: 0x80A5BA90
target_func: 'HammerSpin'
+ - name: JustOneBomb
+ type: branch_insn
+ branch_type: b
+ src_addr_pal: 0x80A123A8
+ target_func: 'JustOneBomb'
+
- name: HammerColour
type: branch_insn
branch_type: bl
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