From 6951228abd6b050a25c6e48594907cd06bd64fcd Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 5 Jul 2016 18:50:06 +0200 Subject: [PATCH 1/2] Use g_want_determinism more --- Source/Core/Core/Core.cpp | 3 +-- Source/Core/Core/HW/DSPLLE/DSPLLE.cpp | 9 +++------ Source/Core/Core/HW/EXI_DeviceIPL.cpp | 3 +++ Source/Core/DolphinWX/Config/ConfigMain.cpp | 3 ++- Source/Core/DolphinWX/ControllerConfigDiag.cpp | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index f01b17beae..01a508dbe9 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -976,8 +976,7 @@ void UpdateWantDeterminism(bool initial) // For now, this value is not itself configurable. Instead, individual // settings that depend on it, such as GPU determinism mode. should have // override options for testing, - bool new_want_determinism = - Movie::IsPlayingInput() || Movie::IsRecordingInput() || NetPlay::IsNetPlayRunning(); + bool new_want_determinism = Movie::IsMovieActive() || NetPlay::IsNetPlayRunning(); if (new_want_determinism != g_want_determinism || initial) { WARN_LOG(COMMON, "Want determinism <- %s", new_want_determinism ? "true" : "false"); diff --git a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp index 70146c1eac..fad25fabb3 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp @@ -166,11 +166,9 @@ bool DSPLLE::Initialize(bool bWii, bool bDSPThread) return false; // needs to be after DSPCore_Init for the dspjit ptr - if (NetPlay::IsNetPlayRunning() || Movie::IsMovieActive() || Core::g_want_determinism || - !g_dsp_jit) - { + if (Core::g_want_determinism || !g_dsp_jit) bDSPThread = false; - } + m_bWii = bWii; m_bDSPThread = bDSPThread; @@ -310,8 +308,7 @@ void DSPLLE::DSP_Update(int cycles) */ if (m_bDSPThread) { - if (requestDisableThread || NetPlay::IsNetPlayRunning() || Movie::IsMovieActive() || - Core::g_want_determinism) + if (requestDisableThread || Core::g_want_determinism) { DSP_StopSoundStream(); m_bDSPThread = false; diff --git a/Source/Core/Core/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/HW/EXI_DeviceIPL.cpp index 0938647c01..e66a8dc378 100644 --- a/Source/Core/Core/HW/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/HW/EXI_DeviceIPL.cpp @@ -4,6 +4,7 @@ #include +#include "Common/Assert.h" #include "Common/ChunkFile.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" @@ -12,6 +13,7 @@ #include "Common/MemoryUtil.h" #include "Common/Timer.h" #include "Core/ConfigManager.h" +#include "Core/Core.h" #include "Core/CoreTiming.h" #include "Core/HW/EXI_DeviceIPL.h" #include "Core/HW/Sram.h" @@ -421,6 +423,7 @@ u32 CEXIIPL::GetGCTime() } else { + _assert_(!Core::g_want_determinism); ltime = Common::Timer::GetLocalTimeSinceJan1970(); } diff --git a/Source/Core/DolphinWX/Config/ConfigMain.cpp b/Source/Core/DolphinWX/Config/ConfigMain.cpp index 3a62f7e97b..72d6f421ed 100644 --- a/Source/Core/DolphinWX/Config/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Config/ConfigMain.cpp @@ -9,6 +9,7 @@ #include "Common/CommonTypes.h" #include "Core/ConfigManager.h" +#include "Core/Core.h" #include "Core/Movie.h" #include "Core/NetPlayProto.h" #include "DolphinWX/Config/AdvancedConfigPane.h" @@ -74,7 +75,7 @@ void CConfigMain::CreateGUIControls() Notebook->AddPage(wii_pane, _("Wii")); Notebook->AddPage(path_pane, _("Paths")); Notebook->AddPage(advanced_pane, _("Advanced")); - if (Movie::IsMovieActive() || NetPlay::IsNetPlayRunning()) + if (Core::g_want_determinism) advanced_pane->Disable(); wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL); diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp index 8a0de34024..3d8d12bbef 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp +++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp @@ -98,7 +98,7 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer() pad_type_choices[i]->Bind(wxEVT_CHOICE, &ControllerConfigDiag::OnGameCubePortChanged, this); // Disable controller type selection for certain circumstances. - if (NetPlay::IsNetPlayRunning() || Movie::IsMovieActive()) + if (Core::g_want_determinism) pad_type_choices[i]->Disable(); // Set the saved pad type as the default choice. @@ -179,7 +179,7 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateWiimoteConfigSizer() // Disable controller type selection for certain circumstances. bool wii_game_started = SConfig::GetInstance().bWii || Core::GetState() == Core::CORE_UNINITIALIZED; - if (NetPlay::IsNetPlayRunning() || Movie::IsMovieActive() || !wii_game_started) + if (Core::g_want_determinism || !wii_game_started) wiimote_source_ch[i]->Disable(); m_orig_wiimote_sources[i] = g_wiimote_sources[i]; From ce9622c42652c0207801b5c20702569802a07f91 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 5 Jul 2016 20:58:44 +0200 Subject: [PATCH 2/2] Use g_want_determinism in code added by 8f0cbef There's no reason this only should apply to netplay. --- Source/Core/Core/HW/SI_DeviceGCAdapter.cpp | 10 +++++----- Source/Core/InputCommon/GCAdapter.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/HW/SI_DeviceGCAdapter.cpp b/Source/Core/Core/HW/SI_DeviceGCAdapter.cpp index 280a85e465..35bc93e2fb 100644 --- a/Source/Core/Core/HW/SI_DeviceGCAdapter.cpp +++ b/Source/Core/Core/HW/SI_DeviceGCAdapter.cpp @@ -8,6 +8,7 @@ #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Core/ConfigManager.h" +#include "Core/Core.h" #include "Core/HW/GCPad.h" #include "Core/HW/SI_DeviceGCAdapter.h" #include "Core/NetPlayProto.h" @@ -41,12 +42,11 @@ GCPadStatus CSIDevice_GCAdapter::GetPadStatus() int CSIDevice_GCAdapter::RunBuffer(u8* buffer, int length) { - if (!NetPlay::IsNetPlayRunning()) + if (!Core::g_want_determinism) { - // The previous check is a hack to prevent a netplay desync due to - // SI devices being different and returning different values on - // RunBuffer(); the corresponding code in GCAdapter.cpp has the same - // check. + // The previous check is a hack to prevent a desync due to SI devices + // being different and returning different values on RunBuffer(); + // the corresponding code in GCAdapter.cpp has the same check. // This returns an error value if there is no controller plugged // into this port on the hardware gc adapter, exposing it to the game. diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index b86b0aa4c5..7c450d4288 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -453,9 +453,9 @@ void Input(int chan, GCPadStatus* pad) pad->triggerLeft = controller_payload_copy[1 + (9 * chan) + 7]; pad->triggerRight = controller_payload_copy[1 + (9 * chan) + 8]; } - else if (!NetPlay::IsNetPlayRunning()) + else if (!Core::g_want_determinism) { - // This is a hack to prevent a netplay desync due to SI devices + // This is a hack to prevent a desync due to SI devices // being different and returning different values. // The corresponding code in DeviceGCAdapter has the same check pad->button = PAD_ERR_STATUS;