summaryrefslogtreecommitdiff
path: root/src/growup.s
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/growup.s877
1 files changed, 747 insertions, 130 deletions
diff --git a/src/growup.s b/src/growup.s
index 903b766..f1cff50 100644
--- a/src/growup.s
+++ b/src/growup.s
@@ -6,7 +6,8 @@
.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
.set r30,30; .set r31,31; .set f0,0; .set f1,1; .set f2,2
-.set f3,3; .set f4,4; .set f5,5; .set f8,8;
+.set f3,3; .set f4,4; .set f5,5; .set f6,6; .set f8,8
+.set f31,31; .set f30,30
#endif
@@ -18,94 +19,468 @@
.align 4
-.global ModifyGlobalSizes
-ModifyGlobalSizes:
-# lhz r10, 8(r3)
-# cmpwi r10, 60
-# beq dontDoAnything
+LoadFromSettingsS:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 4(r3) # get the sprite settings
+ srwi r12, r12, 20 # get the highest nybble as r10 (maps to Nyb7 in Reggie)
+ andi. r12, r12, 0xF
- # 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)
- andi. r10, r10, 0xF
+ # first off, get the value from the lookup table
+ lis r11, LookupTable@h
+ ori r11, r11, LookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsSF:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 4(r3) # get the sprite settings
+ srwi r12, r12, 28 # get the highest nybble as r12 (maps to Nyb5 in Reggie)
+ andi. r12, r12, 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 f5, r11, r10 # get it from the array
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsC:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 4(r4) # get the sprite settings
+ srwi r12, r12, 20 # get the highest nybble as r12 (maps to Nyb7 in Reggie)
+ andi. r12, r12, 0xF
+
+ # first off, get the value from the lookup table
+ lis r11, LookupTable@h
+ ori r11, r11, LookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsCF:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 4(r4) # get the sprite settings
+ srwi r12, r12, 28 # get the highest nybble as r12 (maps to Nyb5 in Reggie)
+ andi. r12, r12, 0xF
+
+ # first off, get the value from the lookup table
+ lis r11, LookupTable@h
+ ori r11, r11, LookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsH:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 4(r30) # get the sprite settings
+ srwi r12, r12, 20 # get the highest nybble as r12 (maps to Nyb7 in Reggie)
+ andi. r12, r12, 0xF
+
+ # first off, get the value from the lookup table
+ lis r11, RiderLookupTable@h
+ ori r11, r11, RiderLookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsHF:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 4(r30) # get the sprite settings
+ srwi r12, r12, 28 # get the highest nybble as r12 (maps to Nyb5 in Reggie)
+ andi. r12, r12, 0xF
+
+ # first off, get the value from the lookup table
+ lis r11, RiderLookupTable@h
+ ori r11, r11, RiderLookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsL:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 8(r30) # get the sprite settings
+ srwi r12, r12, 20 # get the highest nybble as r12 (maps to Nyb7 in Reggie)
+ andi. r12, r12, 0xF
+
+ # first off, get the value from the lookup table
+ lis r11, LookupTable@h
+ ori r11, r11, LookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+LoadFromSettingsLF:
+ # we can trash r12 for now, it's not supposed to be guaranteed anyway
+ lwz r12, 8(r30) # get the sprite settings
+ srwi r12, r12, 28 # get the highest nybble as r12 (maps to Nyb5 in Reggie)
+ andi. r12, r12, 0xF
+
+ # first off, get the value from the lookup table
+ lis r11, LookupTable@h
+ ori r11, r11, LookupTable@l
+ slwi r12, r12, 2 # size *= 4 (size of float)
+ lfsx f8, r11, r12 # get it from the array
+ blr
+
+
+
+ModelNoChanges:
+ lwz r4, 0x47C(r3)
+ lfs f0, 0xDC(r4)
+ stfs f0, 0x464(r3)
+ lfs f0, 0xE0(r4)
+ stfs f0, 0x468(r3)
+ lfs f0, 0xE4(r4)
+ stfs f0, 0x46C(r3)
+ 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
+
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsSF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsS
+
+ 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)
+ stfs f0, 0x464(r3)
lfs f0, 0xE0(r4)
- fmuls f0, f0, f5
+ fmuls f0, f0, f8
stfs f0, 0xE0(r3)
- stfs f0, 0x468(r4)
+ stfs f0, 0x468(r3)
lfs f0, 0xE4(r4)
- fmuls f0, f0, f5
+ fmuls f0, f0, f8
stfs f0, 0xE4(r3)
- stfs f0, 0x46C(r4)
+ stfs f0, 0x46C(r3)
+
+ blr
+
+
+# Another one to try at 80095750
+SpeedUpdatesNoChangesB:
+ lfs f3, 0xC(r1)
+ lfs f1, 0x440(r30)
+ lfs f2, 0x10(r1)
+ fadds f6, f3, f1
+ lfs f0, 0x444(r30)
+ lfs f4, 0x14(r1)
+ fadds f5, f2, f0
+ lfs f3, 0x448(r30)
+ lfs f1, 0xAC(r30) #Actor.x_pos
+ fadds f3, f4, f3
+ lfs f0, 0xB0(r30) #Actor.y_pos
+ fadds f2, f1, f6
+ fadds f1, f0, f5
+ lfs f0, 0xB4(r30) #Actor.z_pos
+ stfs f2, 0xAC(r30) #Actor.x_pos
+ fadds f0, f0, f3
+ stfs f1, 0xB0(r30) #Actor.y_pos
+ stfs f0, 0xB4(r30) #Actor.z_pos
+ psq_l f31, 0x38(r1), 1, 0
+ lfd f31, 0x30(r1)
+ psq_l f30, 0x28(r1), 1, 0
+ lfd f30, 0x20(r1)
+ lwz r31, 0x1C(r1)
+ lwz r30, 0x18(r1)
+ lwz r0, 0x44(r1)
+ stfs f6, 0xC(r1)
+ stfs f5, 0x10(r1)
+ stfs f3, 0x14(r1)
+ mtlr r0
+ addi r1, r1, 0x40
+ blr
+
+
+.global ModifySpeedUpdatesB
+ModifySpeedUpdatesB:
+
+ # Go back if Type is a Player, Yoshi, or World Map Shit
+ lhz r10, 8(r30)
+ cmpwi r10, 0x12
+ blt SpeedUpdatesNoChangesB
+
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq SpeedUpdatesNoChangesB
+
+ # Else, use Global
+ lis r11, GlobalSpriteSpeed@h
+ ori r11, r11, GlobalSpriteSpeed@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsHF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsH
+
+ mtlr r9
+
+
+ lfs f3, 0xC(r1)
+ lfs f1, 0x440(r30)
+ lfs f2, 0x10(r1)
+ fadds f6, f3, f1
+ lfs f0, 0x444(r30)
+ lfs f4, 0x14(r1)
+ fadds f5, f2, f0
+ lfs f3, 0x448(r30)
+ lfs f1, 0xAC(r30) #Actor.x_pos
+ fadds f3, f4, f3
+ lfs f0, 0xB0(r30) #Actor.y_pos
+ fmuls f6, f8, f6
+ fadds f2, f1, f6
+ fmuls f5, f8, f5
+ fadds f1, f0, f5
+ lfs f0, 0xB4(r30) #Actor.z_pos
+ stfs f2, 0xAC(r30) #Actor.x_pos
+ fmuls f3, f8, f3
+ fadds f0, f0, f3
+ stfs f1, 0xB0(r30) #Actor.y_pos
+ stfs f0, 0xB4(r30) #Actor.z_pos
+ psq_l f31, 0x38(r1), 1, 0
+ lfd f31, 0x30(r1)
+ psq_l f30, 0x28(r1), 1, 0
+ lfd f30, 0x20(r1)
+ lwz r31, 0x1C(r1)
+ lwz r30, 0x18(r1)
+ lwz r0, 0x44(r1)
+ stfs f6, 0xC(r1)
+ stfs f5, 0x10(r1)
+ stfs f3, 0x14(r1)
+ mtlr r0
+ addi r1, r1, 0x40
+ blr
+
+
+
+# dStageActor_positionRelated: 80065620
+SpeedUpdatesNoChangesA:
+ lfs f3, 0xB0(r4)
+ lfs f2, 0xD4(r4)
+ lfs f1, 0xAC(r4)
+ lfs f0, 0xD0(r4)
+ fadds f2, f3, f2
+ fadds f0, f1, f0
+ stfs f2, 4(r3)
+ stfs f0, 0(r3)
+ blr
+
+
+.global ModifySpeedUpdatesA
+ModifySpeedUpdatesA:
+
+ # Go back if Type is a Player, Yoshi, or World Map Shit
+ lhz r10, 8(r4)
+ cmpwi r10, 0x12
+ blt SpeedUpdatesNoChangesA
+
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq SpeedUpdatesNoChangesA
+
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsCF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsC
+
+ mtlr r9
+
+ lfs f3, 0xB0(r4)
+ lfs f2, 0xD4(r4)
+ lfs f1, 0xAC(r4)
+ lfs f0, 0xD0(r4)
+ fmuls f2, f8, f2
+ fadds f2, f3, f2
+ fmuls f0, f8, f0
+ fadds f0, f1, f0
+ stfs f2, 4(r3)
+ stfs f0, 0(r3)
+ blr
- # Modify the initial actor speeds
-# lfs f0, 0xD0(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0xD0(r3)
+
+#SpeedUpdatesNoChanges:
+# # Xpos
+# lfs f1, 0xAC(r3)
+# lfs f0, 0(r4)
+# fadds f0, f1, f0
+# stfs f0, 0xAC(r3)
+# # Ypos
+# lfs f1, 0xB0(r3)
+# lfs f0, 4(r4)
+# fadds f0, f1, f0
+# stfs f0, 0xB0(r3)
+# # Zpos
+# lfs f1, 0xB4(r3)
+# lfs f0, 8(r4)
+# fadds f0, f1, f0
+# stfs f0, 0xB4(r3)
+# blr
+#
#
-# lfs f0, 0xE8(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0xE8(r3)
+#.global ModifySpeedUpdates
+#ModifySpeedUpdates:
#
-# lfs f0, 0xC4(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0xC4(r3)
+# # Go back if Type is a Player, Yoshi, or World Map Shit
+# lhz r10, 8(r3)
+# cmpwi r10, 0x12
+# blt SpeedUpdatesNoChanges
#
-# lfs f0, 0x110(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0x110(r3)
+# # Go back if SizerOn is 0 (off)
+# lis r10, SizerOn@h
+# ori r10, r10, SizerOn@l
+# lbz r10, 0(r10)
+# cmpwi r10, 0
+# beq SpeedUpdatesNoChanges
#
-# lfs f0, 0xF4(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0xF4(r3)
-#
-# lfs f0, 0x11C(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0x11C(r3)
+# # Else, use Global
+# lis r11, GlobalSpriteSize@h
+# ori r11, r11, GlobalSpriteSize@l
+# lfs f8, 0(r11)
+#
+# mflr r9
+#
+# # Load from Nyb5 Settings if SizerOn is 1
+# cmpwi r10, 1
+# beql LoadFromSettingsSF
+#
+# # Load from Nyb7 Settings if SizerOn is 2
+# cmpwi r10, 2
+# beql LoadFromSettingsS
+#
+# mtlr r9
#
-# lfs f0, 0x108(r3)
-# fmuls f0, f0, f5
-# stfs f0, 0x108(r3)
+# # Xpos
+# lfs f1, 0xAC(r3)
+# lfs f0, 0(r4)
+# fmuls f0, f8, f0
+# fadds f0, f1, f0
+# stfs f0, 0xAC(r3)
+# # Ypos
+# lfs f1, 0xB0(r3)
+# lfs f0, 4(r4)
+# fmuls f0, f8, f0
+# fadds f0, f1, f0
+# stfs f0, 0xB0(r3)
+# # Zpos
+# lfs f1, 0xB4(r3)
+# lfs f0, 8(r4)
+# fmuls f0, f8, f0
+# fadds f0, f1, f0
+# stfs f0, 0xB4(r3)
+# blr
- 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
-#dontDoAnything:
-# blr
+.global ModifyCollision
+ModifyCollision:
+ # 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
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
-.global ModifyCollision
-ModifyCollision:
+ mflr r9
- # 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
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsCF
- # 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
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsC
+
+ mtlr r9
#This is the old ActivePhysics_InitWithStruct function.
stw r4, 4(r3)
@@ -153,7 +528,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 +559,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 +615,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
@@ -278,20 +656,43 @@ ModifyStandOnTopInitD:
blr # Off we go!
+RiderInitANoChanges:
+ lfs f0, 0(r4)
+ stfs f0, 0x4C(r3)
+ lfs f0, 4(r4)
+ stfs f0, 0x50(r3)
+ lfs f0, 0(r5)
+ stfs f0, 0x54(r3)
+ lfs f0, 4(r5)
+ stfs f0, 0x58(r3)
+ blr
.global ModifyRiderInitA
ModifyRiderInitA:
- # 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
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq RiderInitANoChanges
- # first off, get the value from the lookup table
- lis r11, RiderLookupTable@h
- ori r11, r11, RiderLookupTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f8, r11, r10 # get it from the array
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsSF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsS
+
+ mtlr r9
lfs f0, 0(r4)
fmuls f0, f0, f8
@@ -312,19 +713,44 @@ ModifyRiderInitA:
blr # Off we go!
+RiderInitBNoChanges:
+ lfs f0, 0(r5)
+ stfs f0, 0x4C(r3)
+ lfs f0, 4(r5)
+ stfs f0, 0x50(r3)
+ lfs f0, 0(r4)
+ stfs f0, 0x54(r3)
+ lfs f0, 4(r4)
+ stfs f0, 0x58(r3)
+ blr
+
+
.global ModifyRiderInitB
ModifyRiderInitB:
- # 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
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq RiderInitBNoChanges
- # first off, get the value from the lookup table
- lis r11, RiderLookupTable@h
- ori r11, r11, RiderLookupTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f8, r11, r10 # get it from the array
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsSF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsS
+
+ mtlr r9
lfs f0, 0(r5)
fmuls f0, f0, f8
@@ -346,19 +772,39 @@ ModifyRiderInitB:
+RiderInitCNoChanges:
+ stfs f1, 0x4C(r3)
+ stfs f2, 0x50(r3)
+ stfs f3, 0x54(r3)
+ stfs f4, 0x58(r3)
+ blr
+
.global ModifyRiderInitC
ModifyRiderInitC:
- # 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
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq RiderInitCNoChanges
- # first off, get the value from the lookup table
- lis r11, RiderLookupTable@h
- ori r11, r11, RiderLookupTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f8, r11, r10 # get it from the array
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsSF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsS
+
+ mtlr r9
fmuls f1, f1, f8
fmuls f2, f2, f8
@@ -373,19 +819,41 @@ ModifyRiderInitC:
blr # Off we go!
+
+RiderInitDNoChanges:
+ stfs f3, 0x4C(r3)
+ stfs f4, 0x50(r3)
+ stfs f1, 0x54(r3)
+ stfs f2, 0x58(r3)
+ blr
+
+
.global ModifyRiderInitD
ModifyRiderInitD:
- # 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
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@h
+ ori r10, r10, SizerOn@l
+ lbz r10, 0(r10)
+ cmpwi r10, 0
+ beq RiderInitDNoChanges
- # first off, get the value from the lookup table
- lis r11, RiderLookupTable@h
- ori r11, r11, RiderLookupTable@l
- slwi r10, r10, 2 # size *= 4 (size of float)
- lfsx f8, r11, r10 # get it from the array
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ mflr r9
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsSF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsS
+
+ mtlr r9
fmuls f1, f1, f8
fmuls f2, f2, f8
@@ -401,73 +869,199 @@ ModifyRiderInitD:
-.global InheritSettings_A
-InheritSettings_A:
+.global InheritSettings
+InheritSettings:
- li r4, 0
+ lwz r4, 4(r3)
+ andis. r4, r4, 0xFFF0
blr
- lwz r4, 4(r0)
-
- li r10, 0
- stw r10, 8(r4)
-
- blr
-
.global InheritSettings_B
InheritSettings_B:
- li r4, 0
- blr
-
- or r4, r31, r0
- lwz r10, 4(r28)
- or r4, r10, r4
-
+ lwz r5, 4(r3)
blr
.global InheritSettings_C
InheritSettings_C:
- li r4, 0
- blr
-
- or r4, r8, r18
- lwz r10, 4(r27)
- or r4, r10, r4
-
+ lwz r4, 4(r3)
+ andis. r4, r4, 0xFFF0
blr
-
.global InheritSettings_D
InheritSettings_D:
- li r4, 0
+ ori r4, r4, 0x2
blr
- lwz r4, 4(r3)
- li r10, 0
- stw r10, 8(r4)
- mr r11, r4
-
+
+
+.global AlwaysVisible
+AlwaysVisible:
+
+ li r3, 1
blr
-.global InheritSettings_E
-InheritSettings_E:
- li r4, 0
+
+
+ModifyLoadSizeNoChanges:
+ lhz r0, 0(r30)
+ cmpwi r17, 0
+ lhz r3, 2(r30)
+ li r28, 0
+ mulli r4, r0, 0x28
+ lwz r0, 0x24(r1)
+ lhz r7, 4(r30)
+ add r31, r0, r4
+ lwz r0, 0xC(r31)
+ lwz r6, 0x14(r31)
+ li r6, 12800
+ add r3, r3, r0
+ lwz r8, 0x10(r31)
+ subf r0, r6, r3
+ lhz r4, 0x20(r31)
+ li r4, 12800
+ add r3, r3, r6
+ lhz r5, 0x22(r31)
+ li r5, 12800
+ subf r6, r4, r0
+ lwz r9, 0x18(r31)
+ subf r7, r8, r7
+ add r5, r5, r3
+ srawi r26, r6, 4
+ lhz r4, 0x1C(r31)
+ subf r0, r9, r7
+ srawi r25, r5, 4
+ subf r4, r4, r0
+ lhz r3, 0x1E(r31)
+ add r0, r7, r9
+ mr r27, r25
+ srawi r23, r4, 4
+ add r0, r3, r0
+ srawi r22, r0, 4
blr
- mr r4, r11
+.global ModifyLoadSize
+ModifyLoadSize:
+
+ mflr r9
+ # Go back if SizerOn is 0 (off)
+ lis r10, SizerOn@ha
+ lbz r10, SizerOn@l(r10)
+ cmpwi r10, 0
+ b ModifyLoadSizeNoChanges
+
+ # Else, use Global
+ lis r11, GlobalSpriteSize@h
+ ori r11, r11, GlobalSpriteSize@l
+ lfs f8, 0(r11)
+
+ # Load from Nyb5 Settings if SizerOn is 1
+ cmpwi r10, 1
+ beql LoadFromSettingsLF
+
+ # Load from Nyb7 Settings if SizerOn is 2
+ cmpwi r10, 2
+ beql LoadFromSettingsL
+
+ lhz r0, 0(r30)
+ cmpwi r17, 0
+ lhz r3, 2(r30)
+ li r28, 0
+ mulli r4, r0, 0x28
+ lwz r0, 0x24(r1)
+ lhz r7, 4(r30)
+ add r31, r0, r4
+
+ lwz r12, 0xC(r31)
+ bl ConverterFunc
+ mr r0, r12
+ li r0, 12800
+
+ lwz r12, 0x14(r31)
+ bl ConverterFunc
+ mr r6, r12
+ li r6, 12800
+
+ add r3, r3, r0
+
+ lwz r12, 0x10(r31)
+ bl ConverterFunc
+ mr r8, r12
+ li r8, 12800
+
+ subf r0, r6, r3
+
+ lhz r12, 0x20(r31)
+ bl ConverterFunc
+ mr r4, r12
+ li r4, 12800
+
+ add r3, r3, r6
+
+ lhz r12, 0x22(r31)
+ bl ConverterFunc
+ mr r5, r12
+ li r5, 12800
+
+ subf r6, r4, r0
+
+ lwz r12, 0x18(r31)
+ bl ConverterFunc
+ mr r9, r12
+ li r9, 12800
+
+ subf r7, r8, r7
+ add r5, r5, r3
+ srawi r26, r6, 4
+
+ lhz r12, 0x1C(r31)
+ bl ConverterFunc
+ mr r4, r12
+ li r4, 12800
+
+ subf r0, r9, r7
+ srawi r25, r5, 4
+ subf r4, r4, r0
+
+ lhz r12, 0x1E(r31)
+ bl ConverterFunc
+ mr r3, r12
+ li r3, 12800
+
+ add r0, r7, r9
+ mr r27, r25
+ srawi r23, r4, 4
+ add r0, r3, r0
+ srawi r22, r0, 4
+
+ mtlr r9
blr
+ConverterFunc:
+ # Converts an int to a float
+ lis r10, ConvertFloat@h
+ ori r10, r10, ConvertFloat@l
+ xoris r12,r12,0x8000
+ stw r12, 4(r10)
+ lfd f0, 0(r10)
+ lfd f1, 8(r10)
+ fsub f0, f0, f1
+ fmuls f0, f0, f8
+ # Converts a float to an int
+ fctiw f0, f1
+ stfd f0, 0(r12)
+ lwz r12, 4(r12)
+ blr
@@ -500,6 +1094,7 @@ PiranhaFirePos:
+
.global PipeGeneratorSpawn
PipeGeneratorSpawn:
@@ -520,6 +1115,25 @@ LakituBomb:
.data
+
+.global GlobalSpriteSize
+GlobalSpriteSize:
+ .float 1.0
+
+.global GlobalSpriteSpeed
+GlobalSpriteSpeed:
+ .float 1.0
+
+.global GlobalRiderSize
+GlobalRiderSize:
+ .float 1.0
+
+.global SizerOn
+SizerOn:
+ .byte 0
+
+.align 4
+
LookupTable:
.float 1, 1, 1, 1, 0.25, 0.5, 0.75, 1.25, 1.5, 2, 2.5, 3, 4, 5, 8, 10
@@ -529,7 +1143,10 @@ RiderLookupTable:
PiranhaPosF:
.float 4.0
-
+ConvertFloat:
+ .word 0x43300000,0x0,0x43300000,0x80000000
+
+
Stupid: .string "Fucking Sprite was enlarged by %f times\n"
.align 4