From 266236d6a436b570ad9606730818ac77d1ed6c86 Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Fri, 21 Jun 2013 01:53:50 -0400 Subject: [PATCH] When loading a save state in read only that mismatches the current movie, load the input prior to the save state from the save state's movie, instead of using the current movie's input up to that point. This prevents desyncing before the save state. --- Source/Core/Core/Src/Movie.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index df5be29fa0..0e31be380f 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -850,6 +850,7 @@ void LoadInput(const char *filename) { // TODO: more detail PanicAlertT("Warning: You loaded a save whose movie mismatches on byte %d (0x%X). You should load another save before continuing, or load this state with read-only mode off. Otherwise you'll probably get a desync.", i+256, i+256); + memcpy(tmpInput, movInput, g_currentByte); } else { @@ -871,6 +872,8 @@ void LoadInput(const char *filename) (int)curPadState.Start, (int)curPadState.A, (int)curPadState.B, (int)curPadState.X, (int)curPadState.Y, (int)curPadState.Z, (int)curPadState.DPadUp, (int)curPadState.DPadDown, (int)curPadState.DPadLeft, (int)curPadState.DPadRight, (int)curPadState.L, (int)curPadState.R, (int)curPadState.TriggerL, (int)curPadState.TriggerR, (int)curPadState.AnalogStickX, (int)curPadState.AnalogStickY, (int)curPadState.CStickX, (int)curPadState.CStickY, (int)frame, (int)movPadState.Start, (int)movPadState.A, (int)movPadState.B, (int)movPadState.X, (int)movPadState.Y, (int)movPadState.Z, (int)movPadState.DPadUp, (int)movPadState.DPadDown, (int)movPadState.DPadLeft, (int)movPadState.DPadRight, (int)movPadState.L, (int)movPadState.R, (int)movPadState.TriggerL, (int)movPadState.TriggerR, (int)movPadState.AnalogStickX, (int)movPadState.AnalogStickY, (int)movPadState.CStickX, (int)movPadState.CStickY); + + memcpy(tmpInput, movInput, g_currentByte); } break; }