summaryrefslogtreecommitdiff
path: root/src/growup.s
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/growup.s165
1 files changed, 127 insertions, 38 deletions
diff --git a/src/growup.s b/src/growup.s
index 903b766..91576f9 100644
--- a/src/growup.s
+++ b/src/growup.s
@@ -18,13 +18,8 @@
.align 4
-.global ModifyGlobalSizes
-ModifyGlobalSizes:
-
-# lhz r10, 8(r3)
-# cmpwi r10, 60
-# beq dontDoAnything
+LoadFromSettings:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
lwz r10, 4(r3) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
@@ -34,23 +29,65 @@ ModifyGlobalSizes:
lis r11, LookupTable@h
ori r11, r11, LookupTable@l
slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f5, r11, r10 # get it from the array
+ lfsx f8, r11, r10 # get it from the array
+ blr
+
+
+ModelNoChanges:
+ lwz r4, 0x47C(r3)
+ lfs f0, 0xDC(r4)
+ stfs f0, 0xDC(r3)
+ stfs f0, 0x464(r4)
+ lfs f0, 0xE0(r4)
+ stfs f0, 0xE0(r3)
+ stfs f0, 0x468(r4)
+ lfs f0, 0xE4(r4)
+ stfs f0, 0xE4(r3)
+ stfs f0, 0x46C(r4)
+ blr
+
+
+.global ModifyGlobalSizes
+ModifyGlobalSizes:
+
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq ModelNoChanges
+
+ # Load 1
+ lis r10, One@h
+ ori r10, r10, One@l
+ lfs f7, 0(r10)
+
+ # Load Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ # If Global == 1.0,
+ fcmpu cr0, f7, f8
+ mflr r9
+ beql cr0, LoadFromSettings
+ mtlr r9
# Modify the actor
lwz r4, 0x47C(r3)
lfs f0, 0xDC(r4)
- fmuls f0, f0, f5
+ fmuls f0, f0, f8
stfs f0, 0xDC(r3)
stfs f0, 0x464(r4)
lfs f0, 0xE0(r4)
- fmuls f0, f0, f5
+ fmuls f0, f0, f8
stfs f0, 0xE0(r3)
stfs f0, 0x468(r4)
lfs f0, 0xE4(r4)
- fmuls f0, f0, f5
+ fmuls f0, f0, f8
stfs f0, 0xE4(r3)
stfs f0, 0x46C(r4)
@@ -87,25 +124,58 @@ ModifyGlobalSizes:
-
-#dontDoAnything:
-# blr
-
+CollisionNoChanges:
+ stw r4, 4(r3)
+ li r0, 0
+ lfs f0, 0(r5)
+ stfs f0, 0x1C(r3)
+ lfs f0, 4(r5)
+ stfs f0, 0x20(r3)
+ lfs f0, 8(r5)
+ stfs f0, 0x24(r3)
+ lfs f0, 0xC(r5)
+ stfs f0, 0x28(r3)
+ lbz r4, 0x10(r5)
+ stb r4, 0x2C(r3)
+ lbz r4, 0x11(r5)
+ stb r4, 0x2D(r3)
+ lwz r4, 0x14(r5)
+ stw r4, 0x30(r3)
+ lwz r4, 0x18(r5)
+ stw r4, 0x34(r3)
+ lhz r4, 0x1C(r5)
+ sth r4, 0x38(r3)
+ lwz r4, 0x20(r5)
+ stw r4, 0x3C(r3)
+ stb r0, 0xA1(r3)
+ blr
.global ModifyCollision
ModifyCollision:
- # we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
- srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
- andi. r10, r10, 0xF
-
- # first off, get the value from the lookup table
- lis r11, LookupTable@h
- ori r11, r11, LookupTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f8, r11, r10 # get it from the array
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq CollisionNoChanges
+
+ # Load 1
+ lis r10, One@h
+ ori r10, r10, One@l
+ lfs f7, 0(r10)
+
+ # Load Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ # If Global == 1.0,
+ fcmpu cr0, f7, f8
+ mflr r9
+ beql cr0, LoadFromSettings
+ mtlr r9
#This is the old ActivePhysics_InitWithStruct function.
stw r4, 4(r3)
@@ -153,7 +223,8 @@ ModifyCollision:
ModifyStandOnTopInitA:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -183,7 +254,8 @@ ModifyStandOnTopInitA:
ModifyStandOnTopInitB:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -238,7 +310,8 @@ ModifyStandOnTopInitD:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -283,7 +356,8 @@ ModifyStandOnTopInitD:
ModifyRiderInitA:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -316,7 +390,8 @@ ModifyRiderInitA:
ModifyRiderInitB:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -350,7 +425,8 @@ ModifyRiderInitB:
ModifyRiderInitC:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -377,7 +453,8 @@ ModifyRiderInitC:
ModifyRiderInitD:
# we can trash r10 for now, it's not supposed to be guaranteed anyway
- lwz r10, 4(r4) # get the sprite settings
+ lwz r10, 4(r3)
+ lwz r10, 4(r10) # get the sprite settings
srwi r10, r10, 20 # get the highest nybble as r10 (maps to Nyb5 in Reggie)
andi. r10, r10, 0xF
@@ -404,15 +481,9 @@ ModifyRiderInitD:
.global InheritSettings_A
InheritSettings_A:
- li r4, 0
+ li r0, 0
blr
- lwz r4, 4(r0)
-
- li r10, 0
- stw r10, 8(r4)
-
- blr
.global InheritSettings_B
@@ -500,6 +571,7 @@ PiranhaFirePos:
+
.global PipeGeneratorSpawn
PipeGeneratorSpawn:
@@ -520,6 +592,23 @@ LakituBomb:
.data
+
+One:
+ .float 1.0
+
+.global GlobalSpriteSize
+GlobalSpriteSize:
+ .float 1.0
+
+.global GlobalRiderSize
+GlobalRiderSize:
+ .float 1.0
+
+.global SizerOn
+SizerOn:
+ .byte 0
+
+
LookupTable:
.float 1, 1, 1, 1, 0.25, 0.5, 0.75, 1.25, 1.5, 2, 2.5, 3, 4, 5, 8, 10