make fd transformations not affect rng seed

This commit is contained in:
Jas Laferriere
2025-08-13 01:21:44 -04:00
parent 94283774c1
commit acc11ae502
6 changed files with 92 additions and 14 deletions

View File

@@ -0,0 +1,9 @@
################################################################################
# Address: 0x8021aae0
# Tags: [affects-gameplay]
################################################################################
# This is a slightly different freeze implementation so that the RNG protection
# unfrozen FD code can have its own injection.
################################################################################
b 0x8

View File

@@ -0,0 +1,30 @@
################################################################################
# Address: 0x8021aae4
# Tags: [affects-gameplay]
################################################################################
# This replaces the call to FinalDestination_BGTransformThink to wrap it
# in logic that stores and restores the RNG seed, ensuring consistent RNG
# behavior whether someone freezes or unfreezes the transformations.
################################################################################
.include "Common/Common.s"
# We can use r31 here because it's backed up and restored by the parent function.
# We just need to make sure we manage it intelligently because the parent function
# needs it when we exit
.set REG_SEED, 31
# Load RNG seed into r31
lis r3, 0x804D
lwz REG_SEED, 0x5F90(r3)
# Call replaced function
mr r3, r30
branchl r12, 0x8021b2e8 # FinalDestination_BGTransformThink
# Restore RNG seed from r31
lis r3, 0x804D
stw REG_SEED, 0x5F90(r3)
# Restore r31 to it's parent function value
lwz REG_SEED, 0x2C(r30)

View File

@@ -196,13 +196,6 @@
"Annotation": "",
"Tags": ""
},
{
"InjectionAddress": "8021AAE4",
"Name": "Required: General Codes",
"Codetype": "04",
"Annotation": "",
"Tags": ""
},
{
"InjectionAddress": "8025B8BC",
"Name": "Required: General Codes",
@@ -742,6 +735,13 @@
"Annotation": "Online/Core/Hacks/PreventPadAlarmDuringRollback.asm",
"Tags": ""
},
{
"InjectionAddress": "8021AAE4",
"Name": "Required: Slippi Online",
"Codetype": "Auto",
"Annotation": "Online/Core/Hacks/FD/DesyncProofBGTransformations.asm",
"Tags": "[affects-gameplay]"
},
{
"InjectionAddress": "801D2D38",
"Name": "Required: Slippi Online",
@@ -1988,6 +1988,13 @@
"Annotation": "",
"Tags": ""
},
{
"InjectionAddress": "8021AAE0",
"Name": "Optional: Freeze Final Destination Background",
"Codetype": "Auto",
"Annotation": "External/FrozenFdSlippi/FreezeFDSlippi.asm",
"Tags": "[affects-gameplay]"
},
{
"InjectionAddress": "803BB05C",
"Name": "Optional: Widescreen 16:9",

View File

@@ -213,7 +213,6 @@ FFFFFFFF 4E800021
7C0803A6 881F24D0
60000000 00000000
042641B0 38000001 #Faster CSS Load [UnclePunch]
0421AAE4 60000000 #Disable FD Background Transitions [Achilles, Dan Salvato]
0425B8BC 38600002 #L+R+A Returns to CSS during Stage Load [Jorgasms]
04452F54 42000000 #Unrestricted Camera while Paused [strikebowler585]
04452F58 42000000
@@ -2436,6 +2435,13 @@ C2019608 0000000F #Online/Core/Hacks/PreventPadAlarmDuringRollback.asm
618C9618 7D8903A6
4E800420 38600000
60000000 00000000
C221AAE4 00000006 #Online/Core/Hacks/FD/DesyncProofBGTransformations.asm
3C60804D 83E35F90
7FC3F378 3D808021
618CB2E8 7D8903A6
4E800421 3C60804D
93E35F90 83FE002C
60000000 00000000
C21D2D38 00000016 #Online/Core/Hacks/Stadium/ChangeJumbotronText.asm
48000020 4E800021
100CC0C0 FF16400F
@@ -7234,6 +7240,10 @@ C21CBB90 00000005 #Lagless FoD
041CD250 60000000
041CCDCC 480000B4
$Optional: Freeze Final Destination Background [Fizzi]
*Prevents FD background from changing to improve performance
0421AAE0 48000008 #External/FreezeFDSlippi/FreezeFDSlippi.asm
$Optional: Widescreen 16:9 [Dan Salvato, mirrorbender, Achilles1515, UnclePunch]
*Set Aspect Ratio to "Force 16:9" in Graphics for 16:9 monitors ----------------------
*Will not cause desyncs when playing online

View File

@@ -212,7 +212,6 @@ FFFFFFFF 4E800021
7C0803A6 881F24D0
60000000 00000000
042641B0 38000001 #Faster CSS Load [UnclePunch]
0421AAE4 60000000 #Disable FD Background Transitions [Achilles, Dan Salvato]
0425B8BC 38600002 #L+R+A Returns to CSS during Stage Load [Jorgasms]
04452F54 42000000 #Unrestricted Camera while Paused [strikebowler585]
04452F58 42000000
@@ -2435,6 +2434,13 @@ C2019608 0000000F #Online/Core/Hacks/PreventPadAlarmDuringRollback.asm
618C9618 7D8903A6
4E800420 38600000
60000000 00000000
C221AAE4 00000006 #Online/Core/Hacks/FD/DesyncProofBGTransformations.asm
3C60804D 83E35F90
7FC3F378 3D808021
618CB2E8 7D8903A6
4E800421 3C60804D
93E35F90 83FE002C
60000000 00000000
C21D2D38 00000016 #Online/Core/Hacks/Stadium/ChangeJumbotronText.asm
48000020 4E800021
100CC0C0 FF16400F
@@ -7233,6 +7239,10 @@ C21CBB90 00000005 #Lagless FoD
041CD250 60000000
041CCDCC 480000B4
$Optional: Freeze Final Destination Background [Fizzi]
*Prevents FD background from changing to improve performance
0421AAE0 48000008 #External/FreezeFDSlippi/FreezeFDSlippi.asm
$Optional: Widescreen 16:9 [Dan Salvato, mirrorbender, Achilles1515, UnclePunch]
*Set Aspect Ratio to "Force 16:9" in Graphics for 16:9 monitors ----------------------
*Will not cause desyncs when playing online

View File

@@ -141,11 +141,6 @@
"sourceFile": "Binary/FasterMeleeSettings/FasterCssLoad.bin",
"annotation": "Faster CSS Load [UnclePunch]"
},
{
"type": "binary",
"sourceFile": "Binary/FasterMeleeSettings/DisableFdTransitions.bin",
"annotation": "Disable FD Background Transitions [Achilles, Dan Salvato]"
},
{
"type": "binary",
"sourceFile": "Binary/FasterMeleeSettings/ResetToCssFromStageLoad.bin",
@@ -420,6 +415,23 @@
}
]
},
{
"name": "Optional: Freeze Final Destination Background",
"authors": [
"Fizzi"
],
"description": [
"Prevents FD background from changing to improve performance"
],
"build": [
{
"type": "injectFolder",
"sourceFolder": "External/FreezeFDSlippi",
"isRecursive": true,
"annotation": "Disable FD Background Transitions"
}
]
},
{
"name": "Optional: Widescreen 16:9",
"authors": [