Skip to content

Commit

Permalink
add mode check for stage extractions
Browse files Browse the repository at this point in the history
not having this was causing crashes in training mode for example because we would write data to a buffer that was never initialized
  • Loading branch information
JLaferri committed Jan 26, 2025
1 parent 86dee2b commit 1f4bfc2
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 25 deletions.
19 changes: 14 additions & 5 deletions Output/Console/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,12 @@ C208D698 00000005 #Recording/GetLCancelStatus/GetLCancelStatus.asm
C206C324 00000002 #Recording/GetLCancelStatus/ResetLCancelStatus.asm
38600000 987E25FF
807E00B0 00000000
C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
C2211BF8 0000000F #Recording/Stages/SendDreamlandInfo.asm
4800000C 4E800021
00000000 4BFFFFF9
00000000 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand All @@ -543,9 +546,12 @@ C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
98AB0005 818DB650
398C0006 918DB650
BB4100E8 00000000
C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
C21CC998 0000000E #Recording/Stages/SendFountainInfo.asm
7C0802A6 3C60801C
6063C908 7C001A79
41820058 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820040 806DB64C
81630000 818DB650
7D6B6214 3860003F
Expand All @@ -555,9 +561,12 @@ C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
D3EB0006 818DB650
398C000A 918DB650
D3FB003C 00000000
C21D4FD8 0000000C #Recording/Stages/SendStadiumInfo.asm
C21D4FD8 0000000F #Recording/Stages/SendStadiumInfo.asm
4800000C 4E800021
00000005 4BFFFFF9
00000005 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand Down
Binary file modified Output/Console/g_core.bin
Binary file not shown.
Binary file modified Output/Console/g_core_porta.bin
Binary file not shown.
19 changes: 14 additions & 5 deletions Output/Netplay/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1170,9 +1170,12 @@ C208D698 00000005 #Recording/GetLCancelStatus/GetLCancelStatus.asm
C206C324 00000002 #Recording/GetLCancelStatus/ResetLCancelStatus.asm
38600000 987E25FF
807E00B0 00000000
C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
C2211BF8 0000000F #Recording/Stages/SendDreamlandInfo.asm
4800000C 4E800021
00000000 4BFFFFF9
00000000 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand All @@ -1183,9 +1186,12 @@ C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
98AB0005 818DB650
398C0006 918DB650
BB4100E8 00000000
C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
C21CC998 0000000E #Recording/Stages/SendFountainInfo.asm
7C0802A6 3C60801C
6063C908 7C001A79
41820058 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820040 806DB64C
81630000 818DB650
7D6B6214 3860003F
Expand All @@ -1195,9 +1201,12 @@ C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
D3EB0006 818DB650
398C000A 918DB650
D3FB003C 00000000
C21D4FD8 0000000C #Recording/Stages/SendStadiumInfo.asm
C21D4FD8 0000000F #Recording/Stages/SendStadiumInfo.asm
4800000C 4E800021
00000005 4BFFFFF9
00000005 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand Down
19 changes: 14 additions & 5 deletions Output/Netplay/GALJ01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,12 @@ C208D698 00000005 #Recording/GetLCancelStatus/GetLCancelStatus.asm
C206C324 00000002 #Recording/GetLCancelStatus/ResetLCancelStatus.asm
38600000 987E25FF
807E00B0 00000000
C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
C2211BF8 0000000F #Recording/Stages/SendDreamlandInfo.asm
4800000C 4E800021
00000000 4BFFFFF9
00000000 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand All @@ -1182,9 +1185,12 @@ C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
98AB0005 818DB650
398C0006 918DB650
BB4100E8 00000000
C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
C21CC998 0000000E #Recording/Stages/SendFountainInfo.asm
7C0802A6 3C60801C
6063C908 7C001A79
41820058 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820040 806DB64C
81630000 818DB650
7D6B6214 3860003F
Expand All @@ -1194,9 +1200,12 @@ C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
D3EB0006 818DB650
398C000A 918DB650
D3FB003C 00000000
C21D4FD8 0000000C #Recording/Stages/SendStadiumInfo.asm
C21D4FD8 0000000F #Recording/Stages/SendStadiumInfo.asm
4800000C 4E800021
00000005 4BFFFFF9
00000005 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand Down
19 changes: 14 additions & 5 deletions Output/Playback/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1409,9 +1409,12 @@ C208D698 00000005 #Recording/GetLCancelStatus/GetLCancelStatus.asm
C206C324 00000002 #Recording/GetLCancelStatus/ResetLCancelStatus.asm
38600000 987E25FF
807E00B0 00000000
C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
C2211BF8 0000000F #Recording/Stages/SendDreamlandInfo.asm
4800000C 4E800021
00000000 4BFFFFF9
00000000 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand All @@ -1422,9 +1425,12 @@ C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
98AB0005 818DB650
398C0006 918DB650
BB4100E8 00000000
C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
C21CC998 0000000E #Recording/Stages/SendFountainInfo.asm
7C0802A6 3C60801C
6063C908 7C001A79
41820058 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820040 806DB64C
81630000 818DB650
7D6B6214 3860003F
Expand All @@ -1434,9 +1440,12 @@ C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
D3EB0006 818DB650
398C000A 918DB650
D3FB003C 00000000
C21D4FD8 0000000C #Recording/Stages/SendStadiumInfo.asm
C21D4FD8 0000000F #Recording/Stages/SendStadiumInfo.asm
4800000C 4E800021
00000005 4BFFFFF9
00000005 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand Down
19 changes: 14 additions & 5 deletions Output/Playback/GALJ01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1408,9 +1408,12 @@ C208D698 00000005 #Recording/GetLCancelStatus/GetLCancelStatus.asm
C206C324 00000002 #Recording/GetLCancelStatus/ResetLCancelStatus.asm
38600000 987E25FF
807E00B0 00000000
C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
C2211BF8 0000000F #Recording/Stages/SendDreamlandInfo.asm
4800000C 4E800021
00000000 4BFFFFF9
00000000 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand All @@ -1421,9 +1424,12 @@ C2211BF8 0000000C #Recording/Stages/SendDreamlandInfo.asm
98AB0005 818DB650
398C0006 918DB650
BB4100E8 00000000
C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
C21CC998 0000000E #Recording/Stages/SendFountainInfo.asm
7C0802A6 3C60801C
6063C908 7C001A79
41820058 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820040 806DB64C
81630000 818DB650
7D6B6214 3860003F
Expand All @@ -1433,9 +1439,12 @@ C21CC998 0000000B #Recording/Stages/SendFountainInfo.asm
D3EB0006 818DB650
398C000A 918DB650
D3FB003C 00000000
C21D4FD8 0000000C #Recording/Stages/SendStadiumInfo.asm
C21D4FD8 0000000F #Recording/Stages/SendStadiumInfo.asm
4800000C 4E800021
00000005 4BFFFFF9
00000005 3D808000
618C5604 7D8903A6
4E800421 2C030000
41820050 4BFFFFE1
7C6802A6 80830000
80BF00DC 7C042800
41820038 90A30000
Expand Down
5 changes: 5 additions & 0 deletions Recording/Stages/SendDreamlandInfo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ STATIC_PREVIOUS_VALUE:
.long 0x00000000

Start:
# check if VS Mode
branchl r12,FN_ShouldRecord
cmpwi r3,0x0
beq Skip

bl STATIC_PREVIOUS_VALUE
mflr r3
lwz r4, 0(r3)
Expand Down
5 changes: 5 additions & 0 deletions Recording/Stages/SendFountainInfo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
xor. r0, r0, r3
beq Skip

# check if VS Mode
branchl r12,FN_ShouldRecord
cmpwi r3,0x0
beq Skip

#------------- INITIALIZE -------------
# here we want to initalize some variables we plan on using throughout
# get current offset in buffer
Expand Down
5 changes: 5 additions & 0 deletions Recording/Stages/SendStadiumInfo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ STATIC_PREVIOUS_VALUE:
.long 0x00000005

Start:
# check if VS Mode
branchl r12,FN_ShouldRecord
cmpwi r3,0x0
beq Skip
bl STATIC_PREVIOUS_VALUE
mflr r3
lwz r4, 0(r3)
Expand Down

0 comments on commit 1f4bfc2

Please sign in to comment.