diff options
author | Colin Noga <Tempus@Spectrum-Song.local> | 2011-06-10 13:20:13 -0500 |
---|---|---|
committer | Colin Noga <Tempus@Spectrum-Song.local> | 2011-06-10 13:20:13 -0500 |
commit | 209baabbc250ffecbb2d886e6fed9488c706d367 (patch) | |
tree | a6b139b53d143a2b8ddc47824cc740404a7f045e /src | |
parent | 173e876db1287224164fbca60217817932d03e25 (diff) | |
download | kamek-209baabbc250ffecbb2d886e6fed9488c706d367.tar.gz kamek-209baabbc250ffecbb2d886e6fed9488c706d367.zip |
Added many small fixes, updates, etc
Diffstat (limited to '')
-rw-r--r-- | src/growup.s | 744 | ||||
-rw-r--r-- | src/levelspecial.cpp | 36 | ||||
-rw-r--r-- | src/spritetex.S | 15 |
3 files changed, 662 insertions, 133 deletions
diff --git a/src/growup.s b/src/growup.s index f0c513c..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
@@ -20,58 +21,114 @@ LoadFromSettingsS: - # 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 Nyb7 in Reggie) - andi. r10, r10, 0xF
+ # 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
# 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 + slwi r12, r12, 2 # size *= 4 (size of float) + lfsx f8, r11, r12 # get it from the array blr LoadFromSettingsSF: - # 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, 28 # get the highest nybble as r10 (maps to Nyb5 in Reggie) - andi. r10, r10, 0xF
+ # 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 f8, 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 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 Nyb7 in Reggie) - andi. r10, r10, 0xF
+ # 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 r10, r10, 2 # size *= 4 (size of float) - lfsx f8, 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 LoadFromSettingsCF: - # 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, 28 # get the highest nybble as r10 (maps to Nyb5 in Reggie) - andi. r10, r10, 0xF
+ # 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 r10, r10, 2 # size *= 4 (size of float) - lfsx f8, 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 + + +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 @@ -79,14 +136,11 @@ LoadFromSettingsCF: ModelNoChanges: lwz r4, 0x47C(r3) lfs f0, 0xDC(r4) - stfs f0, 0xDC(r3) - stfs f0, 0x464(r4) + stfs f0, 0x464(r3) lfs f0, 0xE0(r4) - stfs f0, 0xE0(r3) - stfs f0, 0x468(r4) + stfs f0, 0x468(r3) lfs f0, 0xE4(r4) - stfs f0, 0xE4(r3) - stfs f0, 0x46C(r4) + stfs f0, 0x46C(r3) blr @@ -123,48 +177,254 @@ ModifyGlobalSizes: lfs f0, 0xDC(r4) fmuls f0, f0, f8 stfs f0, 0xDC(r3) - stfs f0, 0x464(r4) + stfs f0, 0x464(r3) lfs f0, 0xE0(r4) fmuls f0, f0, f8 stfs f0, 0xE0(r3) - stfs f0, 0x468(r4) + stfs f0, 0x468(r3) lfs f0, 0xE4(r4) 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 - # Modify the initial actor speeds -# lfs f0, 0xD0(r3) -# fmuls f0, f0, f5 -# stfs f0, 0xD0(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 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 + + +#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) # -# lfs f0, 0x108(r3) -# fmuls f0, f0, f5 -# stfs f0, 0x108(r3) - - blr +# 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 +# +# # 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 @@ -396,21 +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(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
+ # 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 @@ -431,20 +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(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
+ # 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 @@ -466,20 +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(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
+ # 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 @@ -494,20 +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(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
+ # 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 @@ -523,67 +869,199 @@ ModifyRiderInitD: -.global InheritSettings_A -InheritSettings_A: +.global InheritSettings +InheritSettings: - li r0, 0 + lwz r4, 4(r3) + andis. r4, r4, 0xFFF0 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 @@ -642,6 +1120,10 @@ LakituBomb: GlobalSpriteSize: .float 1.0 +.global GlobalSpriteSpeed +GlobalSpriteSpeed: + .float 1.0 + .global GlobalRiderSize GlobalRiderSize: .float 1.0 @@ -650,6 +1132,7 @@ GlobalRiderSize: 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 @@ -660,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 diff --git a/src/levelspecial.cpp b/src/levelspecial.cpp index d92c5ce..5fd900d 100644 --- a/src/levelspecial.cpp +++ b/src/levelspecial.cpp @@ -28,6 +28,8 @@ extern EventTable_t *EventTable; extern u16 TimeStopFlag; extern u32 TimerBranch; +extern u32 AlwaysDrawFlag; +extern u32 AlwaysDrawBranch; extern float MarioDescentRate; extern float MarioJumpMax; @@ -36,6 +38,7 @@ extern float MiniMarioJumpArc; extern float MarioSize; extern float GlobalSpriteSize; +extern float GlobalSpriteSpeed; extern float GlobalRiderSize; extern char SizerOn; @@ -65,8 +68,11 @@ bool ResetAfterLevel(void) { MiniMarioJumpArc = 2.5; MarioSize = 1.0; GlobalSpriteSize = 1.0; + GlobalSpriteSpeed = 1.0; GlobalRiderSize = 1.0; SizerOn = 0; + AlwaysDrawFlag = 0x9421FFF0; + AlwaysDrawBranch = 0x7C0802A6; return true;
}
@@ -148,14 +154,29 @@ void LevelSpecial_Update(LevelSpecial *self) { case 5: // Global Enemy Size - SizerOn = 1; + SizerOn = 3; GlobalSpriteSize = GlobalSizeFloatModifications[self->effect]; GlobalRiderSize = GlobalRiderFloatModifications[self->effect]; + GlobalSpriteSpeed = GlobalRiderFloatModifications[self->effect]; - + AlwaysDrawFlag = 0x38600001; + AlwaysDrawBranch = 0x4E800020; + break; + case 6: // Individual Enemy Size - SizerOn = 1; + AlwaysDrawFlag = 0x38600001; + AlwaysDrawBranch = 0x4E800020; + + if (self->effect == 0) + { + SizerOn = 1; // Nyb 5 + } + else + { + SizerOn = 2; // Nyb 7 + } + break; default: @@ -194,9 +215,18 @@ void LevelSpecial_Update(LevelSpecial *self) { GlobalSpriteSize = 1.0; GlobalRiderSize = 1.0; + GlobalSpriteSpeed = 1.0; + + AlwaysDrawFlag = 0x9421FFF0; + AlwaysDrawBranch = 0x7C0802A6; + break; case 6: // Individual Enemy Size SizerOn = 0; + + AlwaysDrawFlag = 0x9421FFF0; + AlwaysDrawBranch = 0x7C0802A6; + break; default: break; diff --git a/src/spritetex.S b/src/spritetex.S index bd13428..0336a5c 100644 --- a/src/spritetex.S +++ b/src/spritetex.S @@ -80,6 +80,14 @@ TEX_Goomba: srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
+ + +.global TEX_BigGoomba
+TEX_BigGoomba:
+ lwz r5, 4(r30)
+ srwi r5, r5, 24
+ andi. r5, r5, 0xF
+ b GetTexFilenameForR5
.global TEX_Barrel
@@ -395,8 +403,13 @@ TEX_PokeyB: srwi r5, r5, 24
andi. r5, r5, 0xF
b GetTexFilenameForR5
+ -
+.global TEX_PokeyC
+TEX_PokeyC:
+ lwz r5, 4(r30) + or r5, r5, r31
+ blr
|