Skip to content

Commit

Permalink
fix: UCF 0.84 1.0 cardinal on cstick
Browse files Browse the repository at this point in the history
the UCF code for 1.0 cardinals is applied in playback because it affects gameplay and we didn't realize that the raw cstick values needed to be saved and restored in order for the cardinals code to work. because of the order of the codes, if you input a cstick value that would need a 1.0 adjustment, UCF would clobber the replay input with the current input meaning you could input smashes and aerials with your controller during playback, causing a desync
  • Loading branch information
JLaferri committed Jun 30, 2024
1 parent 7fafd4d commit fd1bf76
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 35 deletions.
26 changes: 15 additions & 11 deletions Data/PlaybackGeckoCodes/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 Data/PlaybackGeckoCodes/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
14 changes: 8 additions & 6 deletions Data/Sys/GameSettings/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 Data/Sys/GameSettings/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
3 changes: 3 additions & 0 deletions Externals/SlippiLib/SlippiGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ namespace Slippi {

p.joystickYRaw = readByte(data, idx, maxSize, 0);

p.cstickXRaw = readByte(data, idx, maxSize, 0);
p.cstickYRaw = readByte(data, idx, maxSize, 0);

// Add player data to frame
std::unordered_map<uint8_t, PlayerFrameData>* target;
target = isFollower ? &frame->followers : &frame->players;
Expand Down
3 changes: 3 additions & 0 deletions Externals/SlippiLib/SlippiGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ namespace Slippi {

uint8_t joystickXRaw;
uint8_t joystickYRaw;

uint8_t cstickXRaw;
uint8_t cstickYRaw;
} PlayerFrameData;

typedef struct FrameData {
Expand Down
4 changes: 3 additions & 1 deletion Source/Core/Core/HW/EXI_DeviceSlippi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ void CEXISlippi::prepareCharacterFrameData(Slippi::FrameData *frame, u8 port, u8
source = isFollower ? frame->followers : frame->players;

// This must be updated if new data is added
int characterDataLen = 50;
int characterDataLen = 52;

// Check if player exists
if (!source.count(port))
Expand Down Expand Up @@ -1004,6 +1004,8 @@ void CEXISlippi::prepareCharacterFrameData(Slippi::FrameData *frame, u8 port, u8
m_read_queue.push_back(data.joystickXRaw);
m_read_queue.push_back(data.joystickYRaw);
appendWordToBuffer(&m_read_queue, *(u32 *)&data.percent);
m_read_queue.push_back(data.cstickXRaw);
m_read_queue.push_back(data.cstickYRaw);
// NOTE TO DEV: If you add data here, make sure to increase the size above
}

Expand Down

0 comments on commit fd1bf76

Please sign in to comment.