From 76a6917fdf244854bba1e3c989fc1b306173d06f Mon Sep 17 00:00:00 2001 From: rog Date: Wed, 24 Oct 2012 19:37:51 -0400 Subject: [PATCH] Check game ID against what is recorded to the .dtm --- Source/Core/Core/Src/BootManager.cpp | 1 - Source/Core/Core/Src/Movie.cpp | 20 +++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Source/Core/Core/Src/BootManager.cpp b/Source/Core/Core/Src/BootManager.cpp index 187baf415c..afe6a83dad 100644 --- a/Source/Core/Core/Src/BootManager.cpp +++ b/Source/Core/Core/Src/BootManager.cpp @@ -118,7 +118,6 @@ bool BootCore(const std::string& _rFilename) if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) { - Movie::Init(); StartUp.bCPUThread = Movie::IsDualCore(); StartUp.bSkipIdle = Movie::IsSkipIdle(); StartUp.bDSPHLE = Movie::IsDSPHLE(); diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index 11ec6a899d..53b5e2a088 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -135,6 +135,11 @@ void Init() if (IsPlayingInput()) { ReadHeader(); + if ((strncmp((char *)tmpHeader.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str(), 6))) + { + PanicAlert("The recorded game (%s) is not the same as the selected game (%s)", tmpHeader.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str()); + EndPlayInput(false); + } } if (IsRecordingInput()) { @@ -683,19 +688,6 @@ bool PlayInput(const char *filename) Movie::LoadInput(filename); } - /* TODO: Put this verification somewhere we have the gameID of the played game - // TODO: Replace with Unique ID - if(tmpHeader.uniqueID != 0) { - PanicAlert("Recording Unique ID Verification Failed"); - goto cleanup; - } - - if(strncmp((char *)tmpHeader.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str(), 6)) { - PanicAlert("The recorded game (%s) is not the same as the selected game (%s)", header.gameID, Core::g_CoreStartupParameter.GetUniqueID().c_str()); - goto cleanup; - } - */ - ReadHeader(); g_totalFrames = tmpHeader.frameCount; g_totalLagCount = tmpHeader.lagCount; @@ -1094,6 +1086,7 @@ void SaveRecording(const char *filename) header.bMemcard = bMemcard; header.bBlankMC = bBlankMC; strncpy((char *)header.discChange, g_discChange.c_str(),ARRAYSIZE(header.discChange)); + // TODO: prompt the user for author name. It's currently always blank, unless the user manually edits the .dtm file. strncpy((char *)header.author, author.c_str(),ARRAYSIZE(header.author)); // TODO @@ -1141,6 +1134,7 @@ void SetGraphicsConfig() void GetSettings() { + bSaveConfig = true; bSkipIdle = SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle; bDualCore = SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread; bProgressive = SConfig::GetInstance().m_LocalCoreStartupParameter.bProgressive;