Config: Port dual core setting to new config system.

This commit is contained in:
Admiral H. Curtiss 2022-01-07 03:50:18 +01:00
parent e5ef597642
commit d8825f5635
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
13 changed files with 50 additions and 48 deletions

View File

@ -44,6 +44,7 @@
#include "Core/Movie.h" #include "Core/Movie.h"
#include "Core/NetPlayProto.h" #include "Core/NetPlayProto.h"
#include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
#include "Core/WiiRoot.h" #include "Core/WiiRoot.h"
#include "DiscIO/Enums.h" #include "DiscIO/Enums.h"
@ -69,7 +70,6 @@ public:
private: private:
bool valid = false; bool valid = false;
bool bCPUThread = false;
bool bMMU = false; bool bMMU = false;
bool bSyncGPU = false; bool bSyncGPU = false;
int iSyncGpuMaxDistance = 0; int iSyncGpuMaxDistance = 0;
@ -82,7 +82,6 @@ void ConfigCache::SaveConfig(const SConfig& config)
{ {
valid = true; valid = true;
bCPUThread = config.bCPUThread;
bMMU = config.bMMU; bMMU = config.bMMU;
bSyncGPU = config.bSyncGPU; bSyncGPU = config.bSyncGPU;
iSyncGpuMaxDistance = config.iSyncGpuMaxDistance; iSyncGpuMaxDistance = config.iSyncGpuMaxDistance;
@ -103,7 +102,6 @@ void ConfigCache::RestoreConfig(SConfig* config)
valid = false; valid = false;
config->bCPUThread = bCPUThread;
config->bMMU = bMMU; config->bMMU = bMMU;
config->bSyncGPU = bSyncGPU; config->bSyncGPU = bSyncGPU;
config->iSyncGpuMaxDistance = iSyncGpuMaxDistance; config->iSyncGpuMaxDistance = iSyncGpuMaxDistance;
@ -146,7 +144,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
IniFile::Section* core_section = game_ini.GetOrCreateSection("Core"); IniFile::Section* core_section = game_ini.GetOrCreateSection("Core");
IniFile::Section* controls_section = game_ini.GetOrCreateSection("Controls"); IniFile::Section* controls_section = game_ini.GetOrCreateSection("Controls");
core_section->Get("CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread);
core_section->Get("MMU", &StartUp.bMMU, StartUp.bMMU); core_section->Get("MMU", &StartUp.bMMU, StartUp.bMMU);
core_section->Get("SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU); core_section->Get("SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU);
@ -181,7 +178,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
{ {
// TODO: remove this once ConfigManager starts using OnionConfig. // TODO: remove this once ConfigManager starts using OnionConfig.
StartUp.bCPUThread = Config::Get(Config::MAIN_CPU_THREAD);
StartUp.bSyncGPU = Config::Get(Config::MAIN_SYNC_GPU); StartUp.bSyncGPU = Config::Get(Config::MAIN_SYNC_GPU);
for (int i = 0; i < 2; ++i) for (int i = 0; i < 2; ++i)
{ {
@ -203,7 +199,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
{ {
const NetPlay::NetSettings& netplay_settings = NetPlay::GetNetSettings(); const NetPlay::NetSettings& netplay_settings = NetPlay::GetNetSettings();
Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(netplay_settings)); Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(netplay_settings));
StartUp.bCPUThread = netplay_settings.m_CPUthread;
StartUp.bCopyWiiSaveNetplay = netplay_settings.m_CopyWiiSave; StartUp.bCopyWiiSaveNetplay = netplay_settings.m_CopyWiiSave;
StartUp.bSyncGPU = netplay_settings.m_SyncGPU; StartUp.bSyncGPU = netplay_settings.m_SyncGPU;
StartUp.iSyncGpuMaxDistance = netplay_settings.m_SyncGpuMaxDistance; StartUp.iSyncGpuMaxDistance = netplay_settings.m_SyncGpuMaxDistance;
@ -263,6 +258,8 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
if (!boot->riivolution_patches.empty()) if (!boot->riivolution_patches.empty())
Config::SetCurrent(Config::MAIN_FAST_DISC_SPEED, true); Config::SetCurrent(Config::MAIN_FAST_DISC_SPEED, true);
Core::System::GetInstance().Initialize();
Core::UpdateWantDeterminism(/*initial*/ true); Core::UpdateWantDeterminism(/*initial*/ true);
if (StartUp.bWii) if (StartUp.bWii)

View File

@ -117,6 +117,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
&Config::GetInfoForSIDevice(1).GetLocation(), &Config::GetInfoForSIDevice(1).GetLocation(),
&Config::GetInfoForSIDevice(2).GetLocation(), &Config::GetInfoForSIDevice(2).GetLocation(),
&Config::GetInfoForSIDevice(3).GetLocation(), &Config::GetInfoForSIDevice(3).GetLocation(),
&Config::MAIN_CPU_THREAD.GetLocation(),
// UI.General // UI.General

View File

@ -99,7 +99,6 @@ void SConfig::SaveCoreSettings(IniFile& ini)
{ {
IniFile::Section* core = ini.GetOrCreateSection("Core"); IniFile::Section* core = ini.GetOrCreateSection("Core");
core->Set("CPUThread", bCPUThread);
core->Set("SyncGPU", bSyncGPU); core->Set("SyncGPU", bSyncGPU);
core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance); core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance);
core->Set("SyncGpuMinDistance", iSyncGpuMinDistance); core->Set("SyncGpuMinDistance", iSyncGpuMinDistance);
@ -122,7 +121,6 @@ void SConfig::LoadCoreSettings(IniFile& ini)
{ {
IniFile::Section* core = ini.GetOrCreateSection("Core"); IniFile::Section* core = ini.GetOrCreateSection("Core");
core->Get("CPUThread", &bCPUThread, true);
core->Get("MMU", &bMMU, bMMU); core->Get("MMU", &bMMU, bMMU);
core->Get("BBDumpPort", &iBBDumpPort, -1); core->Get("BBDumpPort", &iBBDumpPort, -1);
core->Get("SyncGPU", &bSyncGPU, false); core->Get("SyncGPU", &bSyncGPU, false);
@ -244,7 +242,6 @@ void SConfig::LoadDefaults()
bAutomaticStart = false; bAutomaticStart = false;
bBootToPause = false; bBootToPause = false;
bCPUThread = false;
bMMU = false; bMMU = false;
iBBDumpPort = -1; iBBDumpPort = -1;
bSyncGPU = false; bSyncGPU = false;

View File

@ -56,7 +56,6 @@ struct SConfig
bool bJITNoBlockCache = false; bool bJITNoBlockCache = false;
bool bJITNoBlockLinking = false; bool bJITNoBlockLinking = false;
bool bCPUThread = true;
bool bCopyWiiSaveNetplay = true; bool bCopyWiiSaveNetplay = true;
bool bMMU = false; bool bMMU = false;

View File

@ -67,6 +67,7 @@
#include "Core/PowerPC/JitInterface.h" #include "Core/PowerPC/JitInterface.h"
#include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PowerPC.h"
#include "Core/State.h" #include "Core/State.h"
#include "Core/System.h"
#include "Core/WiiRoot.h" #include "Core/WiiRoot.h"
#ifdef USE_MEMORYWATCHER #ifdef USE_MEMORYWATCHER
@ -202,8 +203,7 @@ bool IsCPUThread()
bool IsGPUThread() bool IsGPUThread()
{ {
const SConfig& _CoreParameter = SConfig::GetInstance(); if (Core::System::GetInstance().IsDualCoreMode())
if (_CoreParameter.bCPUThread)
{ {
return (s_emu_thread.joinable() && (s_emu_thread.get_id() == std::this_thread::get_id())); return (s_emu_thread.joinable() && (s_emu_thread.get_id() == std::this_thread::get_id()));
} }
@ -238,7 +238,8 @@ bool Init(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
HostDispatchJobs(); HostDispatchJobs();
INFO_LOG_FMT(BOOT, "Starting core = {} mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube"); INFO_LOG_FMT(BOOT, "Starting core = {} mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube");
INFO_LOG_FMT(BOOT, "CPU Thread separate = {}", SConfig::GetInstance().bCPUThread ? "Yes" : "No"); INFO_LOG_FMT(BOOT, "CPU Thread separate = {}",
Core::System::GetInstance().IsDualCoreMode() ? "Yes" : "No");
Host_UpdateMainFrame(); // Disable any menus or buttons at boot Host_UpdateMainFrame(); // Disable any menus or buttons at boot
@ -272,8 +273,6 @@ void Stop() // - Hammertime!
if (GetState() == State::Stopping || GetState() == State::Uninitialized) if (GetState() == State::Stopping || GetState() == State::Uninitialized)
return; return;
const SConfig& _CoreParameter = SConfig::GetInstance();
s_is_stopping = true; s_is_stopping = true;
s_timer.Stop(); s_timer.Stop();
@ -291,7 +290,7 @@ void Stop() // - Hammertime!
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stop CPU")); INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stop CPU"));
CPU::Stop(); CPU::Stop();
if (_CoreParameter.bCPUThread) if (Core::System::GetInstance().IsDualCoreMode())
{ {
// Video_EnterLoop() should now exit so that EmuThread() // Video_EnterLoop() should now exit so that EmuThread()
// will continue concurrently with the rest of the commands // will continue concurrently with the rest of the commands
@ -333,8 +332,7 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
{ {
DeclareAsCPUThread(); DeclareAsCPUThread();
const SConfig& _CoreParameter = SConfig::GetInstance(); if (Core::System::GetInstance().IsDualCoreMode())
if (_CoreParameter.bCPUThread)
Common::SetCurrentThreadName("CPU thread"); Common::SetCurrentThreadName("CPU thread");
else else
Common::SetCurrentThreadName("CPU-GPU thread"); Common::SetCurrentThreadName("CPU-GPU thread");
@ -413,8 +411,7 @@ static void FifoPlayerThread(const std::optional<std::string>& savestate_path,
{ {
DeclareAsCPUThread(); DeclareAsCPUThread();
const SConfig& _CoreParameter = SConfig::GetInstance(); if (Core::System::GetInstance().IsDualCoreMode())
if (_CoreParameter.bCPUThread)
Common::SetCurrentThreadName("FIFO player thread"); Common::SetCurrentThreadName("FIFO player thread");
else else
Common::SetCurrentThreadName("FIFO-GPU thread"); Common::SetCurrentThreadName("FIFO-GPU thread");
@ -446,6 +443,7 @@ static void FifoPlayerThread(const std::optional<std::string>& savestate_path,
// See the BootManager.cpp file description for a complete call schedule. // See the BootManager.cpp file description for a complete call schedule.
static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi) static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi)
{ {
const Core::System& system = Core::System::GetInstance();
const SConfig& core_parameter = SConfig::GetInstance(); const SConfig& core_parameter = SConfig::GetInstance();
CallOnStateChangedCallbacks(State::Starting); CallOnStateChangedCallbacks(State::Starting);
Common::ScopeGuard flag_guard{[] { Common::ScopeGuard flag_guard{[] {
@ -647,7 +645,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
} }
// ENTER THE VIDEO THREAD LOOP // ENTER THE VIDEO THREAD LOOP
if (core_parameter.bCPUThread) if (system.IsDualCoreMode())
{ {
// This thread, after creating the EmuWindow, spawns a CPU // This thread, after creating the EmuWindow, spawns a CPU
// thread, and then takes over and becomes the video thread // thread, and then takes over and becomes the video thread
@ -930,8 +928,6 @@ void Callback_NewField()
void UpdateTitle(u32 ElapseTime) void UpdateTitle(u32 ElapseTime)
{ {
SConfig& _CoreParameter = SConfig::GetInstance();
if (ElapseTime == 0) if (ElapseTime == 0)
ElapseTime = 1; ElapseTime = 1;
@ -942,8 +938,9 @@ void UpdateTitle(u32 ElapseTime)
// Settings are shown the same for both extended and summary info // Settings are shown the same for both extended and summary info
const std::string SSettings = fmt::format( const std::string SSettings = fmt::format(
"{} {} | {} | {}", PowerPC::GetCPUName(), _CoreParameter.bCPUThread ? "DC" : "SC", "{} {} | {} | {}", PowerPC::GetCPUName(),
g_video_backend->GetDisplayName(), Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE"); Core::System::GetInstance().IsDualCoreMode() ? "DC" : "SC", g_video_backend->GetDisplayName(),
Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE");
std::string SFPS; std::string SFPS;
if (Movie::IsPlayingInput()) if (Movie::IsPlayingInput())

View File

@ -359,7 +359,7 @@ void DolphinAnalytics::MakePerGameBuilder()
builder.AddData("cfg-dsp-hle", Config::Get(Config::MAIN_DSP_HLE)); builder.AddData("cfg-dsp-hle", Config::Get(Config::MAIN_DSP_HLE));
builder.AddData("cfg-dsp-jit", Config::Get(Config::MAIN_DSP_JIT)); builder.AddData("cfg-dsp-jit", Config::Get(Config::MAIN_DSP_JIT));
builder.AddData("cfg-dsp-thread", Config::Get(Config::MAIN_DSP_THREAD)); builder.AddData("cfg-dsp-thread", Config::Get(Config::MAIN_DSP_THREAD));
builder.AddData("cfg-cpu-thread", SConfig::GetInstance().bCPUThread); builder.AddData("cfg-cpu-thread", Config::Get(Config::MAIN_CPU_THREAD));
builder.AddData("cfg-fastmem", Config::Get(Config::MAIN_FASTMEM)); builder.AddData("cfg-fastmem", Config::Get(Config::MAIN_FASTMEM));
builder.AddData("cfg-syncgpu", SConfig::GetInstance().bSyncGPU); builder.AddData("cfg-syncgpu", SConfig::GetInstance().bSyncGPU);
builder.AddData("cfg-audio-backend", Config::Get(Config::MAIN_AUDIO_BACKEND)); builder.AddData("cfg-audio-backend", Config::Get(Config::MAIN_AUDIO_BACKEND));

View File

@ -3,6 +3,8 @@
#include "Core/System.h" #include "Core/System.h"
#include "Core/Config/MainSettings.h"
namespace Core namespace Core
{ {
struct System::Impl struct System::Impl
@ -14,4 +16,9 @@ System::System() : m_impl{std::make_unique<Impl>()}
} }
System::~System() = default; System::~System() = default;
void System::Initialize()
{
m_separate_cpu_and_gpu_threads = Config::Get(Config::MAIN_CPU_THREAD);
}
} // namespace Core } // namespace Core

View File

@ -26,10 +26,16 @@ public:
return instance; return instance;
} }
void Initialize();
bool IsDualCoreMode() const { return m_separate_cpu_and_gpu_threads; }
private: private:
System(); System();
struct Impl; struct Impl;
std::unique_ptr<Impl> m_impl; std::unique_ptr<Impl> m_impl;
bool m_separate_cpu_and_gpu_threads = false;
}; };
} // namespace Core } // namespace Core

View File

@ -252,7 +252,7 @@ void GeneralPane::LoadConfig()
#if defined(USE_ANALYTICS) && USE_ANALYTICS #if defined(USE_ANALYTICS) && USE_ANALYTICS
m_checkbox_enable_analytics->setChecked(Settings::Instance().IsAnalyticsEnabled()); m_checkbox_enable_analytics->setChecked(Settings::Instance().IsAnalyticsEnabled());
#endif #endif
m_checkbox_dualcore->setChecked(SConfig::GetInstance().bCPUThread); m_checkbox_dualcore->setChecked(Config::Get(Config::MAIN_CPU_THREAD));
m_checkbox_cheats->setChecked(Settings::Instance().GetCheatsEnabled()); m_checkbox_cheats->setChecked(Settings::Instance().GetCheatsEnabled());
m_checkbox_override_region_settings->setChecked( m_checkbox_override_region_settings->setChecked(
Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS)); Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS));
@ -263,7 +263,7 @@ void GeneralPane::LoadConfig()
int selection = qRound(Config::Get(Config::MAIN_EMULATION_SPEED) * 10); int selection = qRound(Config::Get(Config::MAIN_EMULATION_SPEED) * 10);
if (selection < m_combobox_speedlimit->count()) if (selection < m_combobox_speedlimit->count())
m_combobox_speedlimit->setCurrentIndex(selection); m_combobox_speedlimit->setCurrentIndex(selection);
m_checkbox_dualcore->setChecked(SConfig::GetInstance().bCPUThread); m_checkbox_dualcore->setChecked(Config::Get(Config::MAIN_CPU_THREAD));
const auto fallback = Settings::Instance().GetFallbackRegion(); const auto fallback = Settings::Instance().GetFallbackRegion();
@ -346,7 +346,6 @@ void GeneralPane::OnSaveConfig()
Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked()); Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
DolphinAnalytics::Instance().ReloadConfig(); DolphinAnalytics::Instance().ReloadConfig();
#endif #endif
settings.bCPUThread = m_checkbox_dualcore->isChecked();
Config::SetBaseOrCurrent(Config::MAIN_CPU_THREAD, m_checkbox_dualcore->isChecked()); Config::SetBaseOrCurrent(Config::MAIN_CPU_THREAD, m_checkbox_dualcore->isChecked());
Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked()); Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS, Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS,

View File

@ -17,6 +17,7 @@
#include "Core/HW/GPFifo.h" #include "Core/HW/GPFifo.h"
#include "Core/HW/MMIO.h" #include "Core/HW/MMIO.h"
#include "Core/HW/ProcessorInterface.h" #include "Core/HW/ProcessorInterface.h"
#include "Core/System.h"
#include "VideoCommon/Fifo.h" #include "VideoCommon/Fifo.h"
namespace CommandProcessor namespace CommandProcessor
@ -42,7 +43,7 @@ static Common::Flag s_interrupt_waiting;
static bool IsOnThread() static bool IsOnThread()
{ {
return SConfig::GetInstance().bCPUThread; return Core::System::GetInstance().IsDualCoreMode();
} }
static void UpdateInterrupts_Wrapper(u64 userdata, s64 cyclesLate) static void UpdateInterrupts_Wrapper(u64 userdata, s64 cyclesLate)

View File

@ -19,6 +19,7 @@
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
#include "Core/HW/Memmap.h" #include "Core/HW/Memmap.h"
#include "Core/Host.h" #include "Core/Host.h"
#include "Core/System.h"
#include "VideoCommon/AsyncRequests.h" #include "VideoCommon/AsyncRequests.h"
#include "VideoCommon/CPMemory.h" #include "VideoCommon/CPMemory.h"
@ -95,9 +96,7 @@ void PauseAndLock(bool doLock, bool unpauseOnUnlock)
SyncGPU(SyncGPUReason::Other); SyncGPU(SyncGPUReason::Other);
EmulatorState(false); EmulatorState(false);
const SConfig& param = SConfig::GetInstance(); if (!Core::System::GetInstance().IsDualCoreMode() || s_use_deterministic_gpu_thread)
if (!param.bCPUThread || s_use_deterministic_gpu_thread)
return; return;
s_gpu_mainloop.WaitYield(std::chrono::milliseconds(100), Host_YieldToUI); s_gpu_mainloop.WaitYield(std::chrono::milliseconds(100), Host_YieldToUI);
@ -114,7 +113,7 @@ void Init()
// Padded so that SIMD overreads in the vertex loader are safe // Padded so that SIMD overreads in the vertex loader are safe
s_video_buffer = static_cast<u8*>(Common::AllocateMemoryPages(FIFO_SIZE + 4)); s_video_buffer = static_cast<u8*>(Common::AllocateMemoryPages(FIFO_SIZE + 4));
ResetVideoBuffer(); ResetVideoBuffer();
if (SConfig::GetInstance().bCPUThread) if (Core::System::GetInstance().IsDualCoreMode())
s_gpu_mainloop.Prepare(); s_gpu_mainloop.Prepare();
s_sync_ticks.store(0); s_sync_ticks.store(0);
} }
@ -400,9 +399,7 @@ void RunGpuLoop()
void FlushGpu() void FlushGpu()
{ {
const SConfig& param = SConfig::GetInstance(); if (!Core::System::GetInstance().IsDualCoreMode() || s_use_deterministic_gpu_thread)
if (!param.bCPUThread || s_use_deterministic_gpu_thread)
return; return;
s_gpu_mainloop.Wait(); s_gpu_mainloop.Wait();
@ -423,17 +420,16 @@ bool AtBreakpoint()
void RunGpu() void RunGpu()
{ {
const SConfig& param = SConfig::GetInstance(); const bool is_dual_core = Core::System::GetInstance().IsDualCoreMode();
// wake up GPU thread // wake up GPU thread
if (param.bCPUThread && !s_use_deterministic_gpu_thread) if (is_dual_core && !s_use_deterministic_gpu_thread)
{ {
s_gpu_mainloop.Wakeup(); s_gpu_mainloop.Wakeup();
} }
// if the sync GPU callback is suspended, wake it up. // if the sync GPU callback is suspended, wake it up.
if (!SConfig::GetInstance().bCPUThread || s_use_deterministic_gpu_thread || if (!is_dual_core || s_use_deterministic_gpu_thread || SConfig::GetInstance().bSyncGPU)
SConfig::GetInstance().bSyncGPU)
{ {
if (s_syncing_suspended) if (s_syncing_suspended)
{ {
@ -508,7 +504,6 @@ void UpdateWantDeterminism(bool want)
{ {
// We are paused (or not running at all yet), so // We are paused (or not running at all yet), so
// it should be safe to change this. // it should be safe to change this.
const SConfig& param = SConfig::GetInstance();
bool gpu_thread = false; bool gpu_thread = false;
switch (Config::GetGPUDeterminismMode()) switch (Config::GetGPUDeterminismMode())
{ {
@ -523,7 +518,7 @@ void UpdateWantDeterminism(bool want)
break; break;
} }
gpu_thread = gpu_thread && param.bCPUThread; gpu_thread = gpu_thread && Core::System::GetInstance().IsDualCoreMode();
if (s_use_deterministic_gpu_thread != gpu_thread) if (s_use_deterministic_gpu_thread != gpu_thread)
{ {
@ -579,7 +574,7 @@ static void SyncGPUCallback(u64 ticks, s64 cyclesLate)
ticks += cyclesLate; ticks += cyclesLate;
int next = -1; int next = -1;
if (!SConfig::GetInstance().bCPUThread || s_use_deterministic_gpu_thread) if (!Core::System::GetInstance().IsDualCoreMode() || s_use_deterministic_gpu_thread)
{ {
next = RunGpuOnCpu((int)ticks); next = RunGpuOnCpu((int)ticks);
} }
@ -597,7 +592,7 @@ void SyncGPUForRegisterAccess()
{ {
SyncGPU(SyncGPUReason::Other); SyncGPU(SyncGPUReason::Other);
if (!SConfig::GetInstance().bCPUThread || s_use_deterministic_gpu_thread) if (!Core::System::GetInstance().IsDualCoreMode() || s_use_deterministic_gpu_thread)
RunGpuOnCpu(GPU_TIME_SLOT_SIZE); RunGpuOnCpu(GPU_TIME_SLOT_SIZE);
else if (SConfig::GetInstance().bSyncGPU) else if (SConfig::GetInstance().bSyncGPU)
WaitForGpuThread(GPU_TIME_SLOT_SIZE); WaitForGpuThread(GPU_TIME_SLOT_SIZE);

View File

@ -10,11 +10,14 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
#include "Core/HW/MMIO.h" #include "Core/HW/MMIO.h"
#include "Core/HW/ProcessorInterface.h" #include "Core/HW/ProcessorInterface.h"
#include "Core/System.h"
#include "VideoCommon/BoundingBox.h" #include "VideoCommon/BoundingBox.h"
#include "VideoCommon/Fifo.h" #include "VideoCommon/Fifo.h"
#include "VideoCommon/PerfQueryBase.h" #include "VideoCommon/PerfQueryBase.h"
@ -286,7 +289,7 @@ static void RaiseEvent(int cycles_into_future)
CoreTiming::FromThread from = CoreTiming::FromThread::NON_CPU; CoreTiming::FromThread from = CoreTiming::FromThread::NON_CPU;
s64 cycles = 0; // we don't care about timings for dual core mode. s64 cycles = 0; // we don't care about timings for dual core mode.
if (!SConfig::GetInstance().bCPUThread || Fifo::UseDeterministicGPUThread()) if (!Core::System::GetInstance().IsDualCoreMode() || Fifo::UseDeterministicGPUThread())
{ {
from = CoreTiming::FromThread::CPU; from = CoreTiming::FromThread::CPU;

View File

@ -13,7 +13,6 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Config/Config.h"
#include "Common/Event.h" #include "Common/Event.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
@ -21,6 +20,7 @@
#include "Core/Config/MainSettings.h" #include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/System.h"
// TODO: ugly // TODO: ugly
#ifdef _WIN32 #ifdef _WIN32
@ -289,7 +289,7 @@ void VideoBackendBase::PopulateBackendInfoFromUI()
void VideoBackendBase::DoState(PointerWrap& p) void VideoBackendBase::DoState(PointerWrap& p)
{ {
if (!SConfig::GetInstance().bCPUThread) if (!Core::System::GetInstance().IsDualCoreMode())
{ {
VideoCommon_DoState(p); VideoCommon_DoState(p);
return; return;