From 0384f61af3ef5427291e404e5b27b1e613580ce9 Mon Sep 17 00:00:00 2001 From: rog Date: Fri, 19 Oct 2012 19:42:44 -0400 Subject: [PATCH] re-rearrange movie code so it actually works all of the time --- Source/Core/Core/Src/Movie.h | 6 +++--- Source/Core/Core/Src/State.cpp | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/Movie.h b/Source/Core/Core/Src/Movie.h index 6a4cc6bbb1..f7a1fd27e9 100644 --- a/Source/Core/Core/Src/Movie.h +++ b/Source/Core/Core/Src/Movie.h @@ -48,10 +48,10 @@ struct ControllerState { bool Start:1, A:1, B:1, X:1, Y:1, Z:1; // Binary buttons, 6 bits bool DPadUp:1, DPadDown:1, // Binary D-Pad buttons, 4 bits DPadLeft:1, DPadRight:1; - bool L:1, R:1; // Binary triggers, 2 bits + bool L:1, R:1; // Binary triggers, 2 bits bool reserved:4; // Reserved bits used for padding, 4 bits - u8 TriggerL, TriggerR; // Triggers, 16 bits + u8 TriggerL, TriggerR; // Triggers, 16 bits u8 AnalogStickX, AnalogStickY; // Main Stick, 16 bits u8 CStickX, CStickY; // Sub-Stick, 16 bits @@ -103,7 +103,7 @@ struct DTMHeader { u64 recordingStartTime; // seconds since 1970 that recording started (used for RTC) - bool bSaveConfig; + bool bSaveConfig; // Loads the settings below on startup if true bool bSkipIdle; bool bDualCore; bool bProgressive; diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index 88d7c7720c..3f3e367349 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -201,12 +201,11 @@ void CompressAndDumpState(CompressAndDumpState_args save_args) if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav") || !File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm")) Core::DisplayMessage("Failed to move previous state to state undo backup", 1000); - - if ((Movie::IsRecordingInput() || Movie::IsPlayingInput()) && !Movie::IsJustStartingRecordingInputFromSaveState()) - Movie::SaveRecording((filename + ".dtm").c_str()); - else if (!Movie::IsRecordingInput() && !Movie::IsPlayingInput()) - File::Delete(filename + ".dtm"); } + if ((Movie::IsRecordingInput() || Movie::IsPlayingInput()) && !Movie::IsJustStartingRecordingInputFromSaveState()) + Movie::SaveRecording((filename + ".dtm").c_str()); + else if (!Movie::IsRecordingInput() && !Movie::IsPlayingInput()) + File::Delete(filename + ".dtm"); File::IOFile f(filename, "wb"); if (!f)