Skip to content

Commit

Permalink
save and restore raw cstick values
Browse files Browse the repository at this point in the history
fixes playback bug with UCF 0.84 1.0 cardinals on cstick
  • Loading branch information
JLaferri committed Jun 30, 2024
1 parent 7cd7e77 commit c852afa
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 38 deletions.
14 changes: 8 additions & 6 deletions Output/Netplay/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
936DB64C 38800005
3D808000 618CC160
7D8903A6 4E800421
38600770 3D808037
38600780 3D808037
618CF1E4 7D8903A6
4E800421 7C7E1B78
93DB0000 38600000
Expand All @@ -798,7 +798,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
987E0001 38600036
987E0002 386002F8
B07E0003 38600037
987E0005 38600040
987E0005 38600042
B07E0006 38600038
987E0008 38600054
B07E0009 38600039
Expand All @@ -814,7 +814,7 @@ B07E0015 3860003D
38600010 987E001A
38600204 B07E001B
38600036 987E001D
3C600310 60630000
3C600311 60630000
907E001E 387E0022
7FE4FB78 38A00138
3D808000 618C31F4
Expand Down Expand Up @@ -1096,12 +1096,12 @@ A07F2088 B07D0053
800100E4 382100E0
7C0803A6 8001001C
60000000 00000000
C206B0E0 0000002C #Recording/SendGamePreFrame.asm
C206B0E0 0000002E #Recording/SendGamePreFrame.asm
7C0802A6 90010004
9421FF20 BE8100B0
3D808000 618C5604
7D8903A6 4E800421
2C030000 41820120
2C030000 41820130
8B7F000C 806DB64C
83A30000 838DB650
7FBDE214 38600037
Expand Down Expand Up @@ -1135,8 +1135,10 @@ B07D0031 80640030
1C9B000C 7C832214
88640002 987D003B
88640003 987D0040
88640004 987D0041
88640005 987D0042
807F1830 907D003C
838DB650 3B9C0041
838DB650 3B9C0043
938DB650 BA8100B0
800100E4 382100E0
7C0803A6 881F2219
Expand Down
14 changes: 8 additions & 6 deletions Output/Netplay/GALJ01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
936DB64C 38800005
3D808000 618CC160
7D8903A6 4E800421
38600770 3D808037
38600780 3D808037
618CF1E4 7D8903A6
4E800421 7C7E1B78
93DB0000 38600000
Expand All @@ -797,7 +797,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
987E0001 38600036
987E0002 386002F8
B07E0003 38600037
987E0005 38600040
987E0005 38600042
B07E0006 38600038
987E0008 38600054
B07E0009 38600039
Expand All @@ -813,7 +813,7 @@ B07E0015 3860003D
38600010 987E001A
38600204 B07E001B
38600036 987E001D
3C600310 60630000
3C600311 60630000
907E001E 387E0022
7FE4FB78 38A00138
3D808000 618C31F4
Expand Down Expand Up @@ -1095,12 +1095,12 @@ A07F2088 B07D0053
800100E4 382100E0
7C0803A6 8001001C
60000000 00000000
C206B0E0 0000002C #Recording/SendGamePreFrame.asm
C206B0E0 0000002E #Recording/SendGamePreFrame.asm
7C0802A6 90010004
9421FF20 BE8100B0
3D808000 618C5604
7D8903A6 4E800421
2C030000 41820120
2C030000 41820130
8B7F000C 806DB64C
83A30000 838DB650
7FBDE214 38600037
Expand Down Expand Up @@ -1134,8 +1134,10 @@ B07D0031 80640030
1C9B000C 7C832214
88640002 987D003B
88640003 987D0040
88640004 987D0041
88640005 987D0042
807F1830 907D003C
838DB650 3B9C0041
838DB650 3B9C0043
938DB650 BA8100B0
800100E4 382100E0
7C0803A6 881F2219
Expand Down
26 changes: 15 additions & 11 deletions Output/Playback/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ BE8100B0 806DAFC0
38800005 38A00001
3D808000 618C55F0
7D8903A6 4E800421
7F63DB78 38800197
7F63DB78 388001A7
38A00000 3D808000
618C55F0 7D8903A6
4E800421 887B0000
Expand All @@ -177,7 +177,7 @@ BE8100B0 806DAFC0
BA8100B0 800100E4
382100E0 7C0803A6
881F0008 00000000
C206B0DC 00000049 #Playback/Core/RestoreGameFrame.asm
C206B0DC 0000004B #Playback/Core/RestoreGameFrame.asm
7C0802A6 90010004
9421FF20 BE8100B0
8BBF000C 7FA3EB78
Expand All @@ -189,10 +189,10 @@ C206B0DC 00000049 #Playback/Core/RestoreGameFrame.asm
7D8903A6 4E800421
7C741B78 2C140000
41820010 8879056F
2C030000 418201D4
2C030000 418201E4
389B0007 88BF000C
1CA50064 7C842A14
1CB40032 7F442A14
1CA50068 7C842A14
1CB40034 7F442A14
807A0004 907F0620
807A0008 907F0624
807A000C 907F0638
Expand All @@ -215,6 +215,8 @@ C206B0DC 00000049 #Playback/Core/RestoreGameFrame.asm
1C84000C 7E832214
887A002C 98740002
887A002D 98740003
887A0032 98740004
887A0033 98740005
8879056F 2C030000
4182004C 807A002E
2C03FFFF 41820040
Expand Down Expand Up @@ -1021,7 +1023,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
936DB64C 38800005
3D808000 618CC160
7D8903A6 4E800421
38600770 3D808037
38600780 3D808037
618CF1E4 7D8903A6
4E800421 7C7E1B78
93DB0000 38600000
Expand All @@ -1035,7 +1037,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
987E0001 38600036
987E0002 386002F8
B07E0003 38600037
987E0005 38600040
987E0005 38600042
B07E0006 38600038
987E0008 38600054
B07E0009 38600039
Expand All @@ -1051,7 +1053,7 @@ B07E0015 3860003D
38600010 987E001A
38600204 B07E001B
38600036 987E001D
3C600310 60630000
3C600311 60630000
907E001E 387E0022
7FE4FB78 38A00138
3D808000 618C31F4
Expand Down Expand Up @@ -1333,12 +1335,12 @@ A07F2088 B07D0053
800100E4 382100E0
7C0803A6 8001001C
60000000 00000000
C206B0E0 0000002C #Recording/SendGamePreFrame.asm
C206B0E0 0000002E #Recording/SendGamePreFrame.asm
7C0802A6 90010004
9421FF20 BE8100B0
3D808000 618C5604
7D8903A6 4E800421
2C030000 41820120
2C030000 41820130
8B7F000C 806DB64C
83A30000 838DB650
7FBDE214 38600037
Expand Down Expand Up @@ -1372,8 +1374,10 @@ B07D0031 80640030
1C9B000C 7C832214
88640002 987D003B
88640003 987D0040
88640004 987D0041
88640005 987D0042
807F1830 907D003C
838DB650 3B9C0041
838DB650 3B9C0043
938DB650 BA8100B0
800100E4 382100E0
7C0803A6 881F2219
Expand Down
26 changes: 15 additions & 11 deletions Output/Playback/GALJ01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ BE8100B0 806DAFC0
38800005 38A00001
3D808000 618C55F0
7D8903A6 4E800421
7F63DB78 38800197
7F63DB78 388001A7
38A00000 3D808000
618C55F0 7D8903A6
4E800421 887B0000
Expand All @@ -176,7 +176,7 @@ BE8100B0 806DAFC0
BA8100B0 800100E4
382100E0 7C0803A6
881F0008 00000000
C206B0DC 00000049 #Playback/Core/RestoreGameFrame.asm
C206B0DC 0000004B #Playback/Core/RestoreGameFrame.asm
7C0802A6 90010004
9421FF20 BE8100B0
8BBF000C 7FA3EB78
Expand All @@ -188,10 +188,10 @@ C206B0DC 00000049 #Playback/Core/RestoreGameFrame.asm
7D8903A6 4E800421
7C741B78 2C140000
41820010 8879056F
2C030000 418201D4
2C030000 418201E4
389B0007 88BF000C
1CA50064 7C842A14
1CB40032 7F442A14
1CA50068 7C842A14
1CB40034 7F442A14
807A0004 907F0620
807A0008 907F0624
807A000C 907F0638
Expand All @@ -214,6 +214,8 @@ C206B0DC 00000049 #Playback/Core/RestoreGameFrame.asm
1C84000C 7E832214
887A002C 98740002
887A002D 98740003
887A0032 98740004
887A0033 98740005
8879056F 2C030000
4182004C 807A002E
2C03FFFF 41820040
Expand Down Expand Up @@ -1020,7 +1022,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
936DB64C 38800005
3D808000 618CC160
7D8903A6 4E800421
38600770 3D808037
38600780 3D808037
618CF1E4 7D8903A6
4E800421 7C7E1B78
93DB0000 38600000
Expand All @@ -1034,7 +1036,7 @@ C216E74C 0000010A #Recording/SendGameInfo.asm
987E0001 38600036
987E0002 386002F8
B07E0003 38600037
987E0005 38600040
987E0005 38600042
B07E0006 38600038
987E0008 38600054
B07E0009 38600039
Expand All @@ -1050,7 +1052,7 @@ B07E0015 3860003D
38600010 987E001A
38600204 B07E001B
38600036 987E001D
3C600310 60630000
3C600311 60630000
907E001E 387E0022
7FE4FB78 38A00138
3D808000 618C31F4
Expand Down Expand Up @@ -1332,12 +1334,12 @@ A07F2088 B07D0053
800100E4 382100E0
7C0803A6 8001001C
60000000 00000000
C206B0E0 0000002C #Recording/SendGamePreFrame.asm
C206B0E0 0000002E #Recording/SendGamePreFrame.asm
7C0802A6 90010004
9421FF20 BE8100B0
3D808000 618C5604
7D8903A6 4E800421
2C030000 41820120
2C030000 41820130
8B7F000C 806DB64C
83A30000 838DB650
7FBDE214 38600037
Expand Down Expand Up @@ -1371,8 +1373,10 @@ B07D0031 80640030
1C9B000C 7C832214
88640002 987D003B
88640003 987D0040
88640004 987D0041
88640005 987D0042
807F1830 907D003C
838DB650 3B9C0041
838DB650 3B9C0043
938DB650 BA8100B0
800100E4 382100E0
7C0803A6 881F2219
Expand Down
4 changes: 4 additions & 0 deletions Playback/Core/RestoreGameFrame.asm
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ SKIP_RESYNC:
stb r3, 0x2(r20) #store raw x analog
lbz r3, AnalogRawInputY(PlayerBackup)
stb r3, 0x3(r20) #store raw y analog
lbz r3, CStickRawInputX(PlayerBackup)
stb r3, 0x4(r20) #store raw x cstick
lbz r3, CStickRawInputY(PlayerBackup)
stb r3, 0x5(r20) #store raw y cstick

# If we do not have resync logic enabled, don't try to restore percentage
lbz r3, PDB_SHOULD_RESYNC(REG_PDB_ADDR)
Expand Down
4 changes: 3 additions & 1 deletion Playback/Playback.s
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# gameframe
.set GameFrame_Start, InitialRNG_Start + InitialRNG_Length
# per player offsets
.set PlayerDataLength,0x32
.set PlayerDataLength,0x34
.set RNGSeed,0x00
.set AnalogX,0x04
.set AnalogY,0x08
Expand All @@ -101,6 +101,8 @@
.set AnalogRawInputX,0x2C
.set AnalogRawInputY,0x2D
.set Percentage,0x2E
.set CStickRawInputX,0x32
.set CStickRawInputY,0x33

.set GameFrame_Length, PlayerDataLength * 8

Expand Down
6 changes: 3 additions & 3 deletions Recording/Recording.s
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.set MESSAGE_DESCRIPTIONS_PAYLOAD_LENGTH, 3 * (COMMAND_COUNT - 1) + 1 # byte count
.set GAME_INFO_PAYLOAD_LENGTH, 760 # byte count
.set GAME_FRAME_START_PAYLOAD_LENGTH, 12 #byte count
.set GAME_PRE_FRAME_PAYLOAD_LENGTH, 64 # byte count
.set GAME_PRE_FRAME_PAYLOAD_LENGTH, 66 # byte count
.set GAME_POST_FRAME_PAYLOAD_LENGTH, 84 # byte count
.set GAME_ITEM_INFO_PAYLOAD_LENGTH, 44 # byte count
.set GAME_FRAME_BOOKEND_PAYLOAD_LENGTH, 8 # byte count
Expand Down Expand Up @@ -65,8 +65,8 @@

# build version number. Each byte is one digit
# any change in command data should result in a minor version change
# current version: 3.16.0
.set CURRENT_VERSION,0x03100000
# current version: 3.17.0
.set CURRENT_VERSION,0x03110000

################################################################################
# Static Function Locations
Expand Down
4 changes: 4 additions & 0 deletions Recording/SendGamePreFrame.asm
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ CONTINUE_RAW_X:
stb r3, 0x3B(REG_Buffer)
lbz r3, 0x3(r4) #load raw y analog
stb r3, 0x40(REG_Buffer)
lbz r3, 0x4(r4) #load raw x c-stick
stb r3, 0x41(REG_Buffer)
lbz r3, 0x5(r4) #load raw y c-stick
stb r3, 0x42(REG_Buffer)

# Send player's percent
lwz r3,0x1830(r31)
Expand Down

0 comments on commit c852afa

Please sign in to comment.