Config: Port Fastmem setting to new config system.
This commit is contained in:
parent
88d725c918
commit
dc7e7d08ad
|
@ -248,7 +248,6 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||||
StartUp.iSyncGpuMinDistance = netplay_settings.m_SyncGpuMinDistance;
|
StartUp.iSyncGpuMinDistance = netplay_settings.m_SyncGpuMinDistance;
|
||||||
StartUp.fSyncGpuOverclock = netplay_settings.m_SyncGpuOverclock;
|
StartUp.fSyncGpuOverclock = netplay_settings.m_SyncGpuOverclock;
|
||||||
StartUp.bMMU = netplay_settings.m_MMU;
|
StartUp.bMMU = netplay_settings.m_MMU;
|
||||||
StartUp.bFastmem = netplay_settings.m_Fastmem;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -103,6 +103,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
|
||||||
&Config::MAIN_DISABLE_ICACHE.GetLocation(),
|
&Config::MAIN_DISABLE_ICACHE.GetLocation(),
|
||||||
&Config::MAIN_FAST_DISC_SPEED.GetLocation(),
|
&Config::MAIN_FAST_DISC_SPEED.GetLocation(),
|
||||||
&Config::MAIN_SYNC_ON_SKIP_IDLE.GetLocation(),
|
&Config::MAIN_SYNC_ON_SKIP_IDLE.GetLocation(),
|
||||||
|
&Config::MAIN_FASTMEM.GetLocation(),
|
||||||
|
|
||||||
// UI.General
|
// UI.General
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ void SConfig::SaveCoreSettings(IniFile& ini)
|
||||||
IniFile::Section* core = ini.GetOrCreateSection("Core");
|
IniFile::Section* core = ini.GetOrCreateSection("Core");
|
||||||
|
|
||||||
core->Set("TimingVariance", iTimingVariance);
|
core->Set("TimingVariance", iTimingVariance);
|
||||||
core->Set("Fastmem", bFastmem);
|
|
||||||
core->Set("CPUThread", bCPUThread);
|
core->Set("CPUThread", bCPUThread);
|
||||||
core->Set("SyncGPU", bSyncGPU);
|
core->Set("SyncGPU", bSyncGPU);
|
||||||
core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance);
|
core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance);
|
||||||
|
@ -136,7 +135,6 @@ void SConfig::LoadCoreSettings(IniFile& ini)
|
||||||
{
|
{
|
||||||
IniFile::Section* core = ini.GetOrCreateSection("Core");
|
IniFile::Section* core = ini.GetOrCreateSection("Core");
|
||||||
|
|
||||||
core->Get("Fastmem", &bFastmem, true);
|
|
||||||
core->Get("TimingVariance", &iTimingVariance, 40);
|
core->Get("TimingVariance", &iTimingVariance, 40);
|
||||||
core->Get("CPUThread", &bCPUThread, true);
|
core->Get("CPUThread", &bCPUThread, true);
|
||||||
core->Get("SlotA", (int*)&m_EXIDevice[0], ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER);
|
core->Get("SlotA", (int*)&m_EXIDevice[0], ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER);
|
||||||
|
@ -275,7 +273,6 @@ void SConfig::LoadDefaults()
|
||||||
|
|
||||||
iTimingVariance = 40;
|
iTimingVariance = 40;
|
||||||
bCPUThread = false;
|
bCPUThread = false;
|
||||||
bFastmem = true;
|
|
||||||
bMMU = false;
|
bMMU = false;
|
||||||
iBBDumpPort = -1;
|
iBBDumpPort = -1;
|
||||||
bSyncGPU = false;
|
bSyncGPU = false;
|
||||||
|
|
|
@ -63,8 +63,6 @@ struct SConfig
|
||||||
bool bJITNoBlockCache = false;
|
bool bJITNoBlockCache = false;
|
||||||
bool bJITNoBlockLinking = false;
|
bool bJITNoBlockLinking = false;
|
||||||
|
|
||||||
bool bFastmem;
|
|
||||||
|
|
||||||
int iTimingVariance = 40; // in milli secounds
|
int iTimingVariance = 40; // in milli secounds
|
||||||
bool bCPUThread = true;
|
bool bCPUThread = true;
|
||||||
bool bCopyWiiSaveNetplay = true;
|
bool bCopyWiiSaveNetplay = true;
|
||||||
|
|
|
@ -348,7 +348,8 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
|
||||||
static_cast<void>(IDCache::GetEnvForThread());
|
static_cast<void>(IDCache::GetEnvForThread());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_CoreParameter.bFastmem)
|
const bool fastmem_enabled = Config::Get(Config::MAIN_FASTMEM);
|
||||||
|
if (fastmem_enabled)
|
||||||
EMM::InstallExceptionHandler(); // Let's run under memory watch
|
EMM::InstallExceptionHandler(); // Let's run under memory watch
|
||||||
|
|
||||||
#ifdef USE_MEMORYWATCHER
|
#ifdef USE_MEMORYWATCHER
|
||||||
|
@ -396,7 +397,7 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
|
||||||
|
|
||||||
s_is_started = false;
|
s_is_started = false;
|
||||||
|
|
||||||
if (_CoreParameter.bFastmem)
|
if (fastmem_enabled)
|
||||||
EMM::UninstallExceptionHandler();
|
EMM::UninstallExceptionHandler();
|
||||||
|
|
||||||
if (GDBStub::IsActive())
|
if (GDBStub::IsActive())
|
||||||
|
|
|
@ -360,7 +360,7 @@ void DolphinAnalytics::MakePerGameBuilder()
|
||||||
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", SConfig::GetInstance().bCPUThread);
|
||||||
builder.AddData("cfg-fastmem", SConfig::GetInstance().bFastmem);
|
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));
|
||||||
builder.AddData("cfg-oc-enable", Config::Get(Config::MAIN_OVERCLOCK_ENABLE));
|
builder.AddData("cfg-oc-enable", Config::Get(Config::MAIN_OVERCLOCK_ENABLE));
|
||||||
|
|
|
@ -332,7 +332,7 @@ void Jit64::Init()
|
||||||
{
|
{
|
||||||
EnableBlockLink();
|
EnableBlockLink();
|
||||||
|
|
||||||
jo.fastmem_arena = SConfig::GetInstance().bFastmem && Memory::InitFastmemArena();
|
jo.fastmem_arena = m_fastmem_enabled && Memory::InitFastmemArena();
|
||||||
jo.optimizeGatherPipe = true;
|
jo.optimizeGatherPipe = true;
|
||||||
jo.accurateSinglePrecision = true;
|
jo.accurateSinglePrecision = true;
|
||||||
UpdateMemoryAndExceptionOptions();
|
UpdateMemoryAndExceptionOptions();
|
||||||
|
@ -355,8 +355,7 @@ void Jit64::Init()
|
||||||
|
|
||||||
// BLR optimization has the same consequences as block linking, as well as
|
// BLR optimization has the same consequences as block linking, as well as
|
||||||
// depending on the fault handler to be safe in the event of excessive BL.
|
// depending on the fault handler to be safe in the event of excessive BL.
|
||||||
m_enable_blr_optimization =
|
m_enable_blr_optimization = jo.enableBlocklink && m_fastmem_enabled && !m_enable_debugging;
|
||||||
jo.enableBlocklink && SConfig::GetInstance().bFastmem && !m_enable_debugging;
|
|
||||||
m_cleanup_after_stackfault = false;
|
m_cleanup_after_stackfault = false;
|
||||||
|
|
||||||
m_stack = nullptr;
|
m_stack = nullptr;
|
||||||
|
|
|
@ -52,7 +52,7 @@ void JitArm64::Init()
|
||||||
AllocCodeSpace(CODE_SIZE + child_code_size);
|
AllocCodeSpace(CODE_SIZE + child_code_size);
|
||||||
AddChildCodeSpace(&m_far_code, child_code_size);
|
AddChildCodeSpace(&m_far_code, child_code_size);
|
||||||
|
|
||||||
jo.fastmem_arena = SConfig::GetInstance().bFastmem && Memory::InitFastmemArena();
|
jo.fastmem_arena = m_fastmem_enabled && Memory::InitFastmemArena();
|
||||||
jo.enableBlocklink = true;
|
jo.enableBlocklink = true;
|
||||||
jo.optimizeGatherPipe = true;
|
jo.optimizeGatherPipe = true;
|
||||||
UpdateMemoryAndExceptionOptions();
|
UpdateMemoryAndExceptionOptions();
|
||||||
|
@ -67,8 +67,7 @@ void JitArm64::Init()
|
||||||
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CARRY_MERGE);
|
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CARRY_MERGE);
|
||||||
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_BRANCH_FOLLOW);
|
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_BRANCH_FOLLOW);
|
||||||
|
|
||||||
m_enable_blr_optimization =
|
m_enable_blr_optimization = jo.enableBlocklink && m_fastmem_enabled && !m_enable_debugging;
|
||||||
jo.enableBlocklink && SConfig::GetInstance().bFastmem && !m_enable_debugging;
|
|
||||||
m_cleanup_after_stackfault = false;
|
m_cleanup_after_stackfault = false;
|
||||||
|
|
||||||
AllocStack();
|
AllocStack();
|
||||||
|
|
|
@ -54,6 +54,7 @@ void JitBase::RefreshConfig()
|
||||||
m_low_dcbz_hack = Config::Get(Config::MAIN_LOW_DCBZ_HACK);
|
m_low_dcbz_hack = Config::Get(Config::MAIN_LOW_DCBZ_HACK);
|
||||||
m_fprf = Config::Get(Config::MAIN_FPRF);
|
m_fprf = Config::Get(Config::MAIN_FPRF);
|
||||||
m_accurate_nans = Config::Get(Config::MAIN_ACCURATE_NANS);
|
m_accurate_nans = Config::Get(Config::MAIN_ACCURATE_NANS);
|
||||||
|
m_fastmem_enabled = Config::Get(Config::MAIN_FASTMEM);
|
||||||
analyzer.SetDebuggingEnabled(m_enable_debugging);
|
analyzer.SetDebuggingEnabled(m_enable_debugging);
|
||||||
analyzer.SetBranchFollowingEnabled(Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH));
|
analyzer.SetBranchFollowingEnabled(Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH));
|
||||||
analyzer.SetFloatExceptionsEnabled(m_enable_float_exceptions);
|
analyzer.SetFloatExceptionsEnabled(m_enable_float_exceptions);
|
||||||
|
@ -78,7 +79,7 @@ bool JitBase::CanMergeNextInstructions(int count) const
|
||||||
void JitBase::UpdateMemoryAndExceptionOptions()
|
void JitBase::UpdateMemoryAndExceptionOptions()
|
||||||
{
|
{
|
||||||
bool any_watchpoints = PowerPC::memchecks.HasAny();
|
bool any_watchpoints = PowerPC::memchecks.HasAny();
|
||||||
jo.fastmem = SConfig::GetInstance().bFastmem && jo.fastmem_arena && (MSR.DR || !any_watchpoints);
|
jo.fastmem = m_fastmem_enabled && jo.fastmem_arena && (MSR.DR || !any_watchpoints);
|
||||||
jo.memcheck = SConfig::GetInstance().bMMU || any_watchpoints;
|
jo.memcheck = SConfig::GetInstance().bMMU || any_watchpoints;
|
||||||
jo.fp_exceptions = m_enable_float_exceptions;
|
jo.fp_exceptions = m_enable_float_exceptions;
|
||||||
jo.div_by_zero_exceptions = m_enable_div_by_zero_exceptions;
|
jo.div_by_zero_exceptions = m_enable_div_by_zero_exceptions;
|
||||||
|
|
|
@ -132,6 +132,7 @@ protected:
|
||||||
bool m_low_dcbz_hack = false;
|
bool m_low_dcbz_hack = false;
|
||||||
bool m_fprf = false;
|
bool m_fprf = false;
|
||||||
bool m_accurate_nans = false;
|
bool m_accurate_nans = false;
|
||||||
|
bool m_fastmem_enabled = false;
|
||||||
|
|
||||||
void RefreshConfig();
|
void RefreshConfig();
|
||||||
|
|
||||||
|
|
|
@ -829,9 +829,9 @@ void MenuBar::AddJITMenu()
|
||||||
|
|
||||||
m_jit_disable_fastmem = m_jit->addAction(tr("Disable Fastmem"));
|
m_jit_disable_fastmem = m_jit->addAction(tr("Disable Fastmem"));
|
||||||
m_jit_disable_fastmem->setCheckable(true);
|
m_jit_disable_fastmem->setCheckable(true);
|
||||||
m_jit_disable_fastmem->setChecked(!SConfig::GetInstance().bFastmem);
|
m_jit_disable_fastmem->setChecked(!Config::Get(Config::MAIN_FASTMEM));
|
||||||
connect(m_jit_disable_fastmem, &QAction::toggled, [this](bool enabled) {
|
connect(m_jit_disable_fastmem, &QAction::toggled, [this](bool enabled) {
|
||||||
SConfig::GetInstance().bFastmem = !enabled;
|
Config::SetBaseOrCurrent(Config::MAIN_FASTMEM, !enabled);
|
||||||
ClearCache();
|
ClearCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue