Fix recompiler not auto-disabling with PGXP-CPU mode

This commit is contained in:
Connor McLaughlin 2020-08-20 22:25:49 +10:00
parent afda565d78
commit c3ce9135bf
6 changed files with 15 additions and 6 deletions

View file

@ -132,6 +132,7 @@ void AndroidHostInterface::SetUserDirectory()
void AndroidHostInterface::LoadSettings()
{
CommonHostInterface::LoadSettings(m_settings_interface);
CommonHostInterface::FixIncompatibleSettings(false);
CommonHostInterface::UpdateInputMap(m_settings_interface);
}

View file

@ -441,22 +441,22 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si)
void HostInterface::LoadSettings(SettingsInterface& si)
{
g_settings.Load(si);
FixIncompatibleSettings();
}
void HostInterface::FixIncompatibleSettings()
void HostInterface::FixIncompatibleSettings(bool display_osd_messages)
{
if (g_settings.gpu_pgxp_enable)
{
if (g_settings.gpu_renderer == GPURenderer::Software)
{
Log_WarningPrintf("PGXP enabled with software renderer, disabling");
if (display_osd_messages)
AddOSDMessage("PGXP is incompatible with the software renderer, disabling PGXP.", 10.0f);
g_settings.gpu_pgxp_enable = false;
}
else if (g_settings.gpu_pgxp_cpu && g_settings.cpu_execution_mode == CPUExecutionMode::Recompiler)
{
Log_WarningPrintf("Recompiler selected with PGXP CPU mode, falling back to cached interpreter");
if (display_osd_messages)
AddOSDMessage("PGXP CPU mode is incompatible with the recompiler, using Cached Interpreter instead.", 10.0f);
g_settings.cpu_execution_mode = CPUExecutionMode::CachedInterpreter;
}
}

View file

@ -135,7 +135,7 @@ protected:
virtual void SaveSettings(SettingsInterface& si);
/// Checks and fixes up any incompatible settings.
virtual void FixIncompatibleSettings();
virtual void FixIncompatibleSettings(bool display_osd_messages);
/// Checks for settings changes, std::move() the old settings away for comparing beforehand.
virtual void CheckForSettingsChanges(const Settings& old_settings);

View file

@ -101,6 +101,7 @@ bool LibretroHostInterface::Initialize()
return false;
LoadSettings();
FixIncompatibleSettings();
UpdateLogging();
return true;
}
@ -631,6 +632,7 @@ void LibretroHostInterface::UpdateSettings()
{
Settings old_settings(std::move(g_settings));
LoadSettings();
FixIncompatibleSettings();
if (g_settings.gpu_resolution_scale != old_settings.gpu_resolution_scale &&
g_settings.gpu_renderer != GPURenderer::Software)

View file

@ -281,6 +281,7 @@ void QtHostInterface::setDefaultSettings()
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::ApplyGameSettings(false);
CommonHostInterface::FixIncompatibleSettings(false);
}
CheckForSettingsChanges(old_settings);
@ -299,6 +300,7 @@ void QtHostInterface::applySettings(bool display_osd_messages /* = false */)
std::lock_guard<std::recursive_mutex> guard(m_settings_mutex);
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::ApplyGameSettings(display_osd_messages);
CommonHostInterface::FixIncompatibleSettings(display_osd_messages);
}
CheckForSettingsChanges(old_settings);
@ -676,6 +678,7 @@ void QtHostInterface::LoadSettings()
CommonHostInterface::CheckSettings(*m_settings_interface.get());
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::FixIncompatibleSettings(false);
}
void QtHostInterface::SetDefaultSettings(SettingsInterface& si)

View file

@ -324,6 +324,7 @@ void SDLHostInterface::OnRunningGameChanged()
Settings old_settings(std::move(g_settings));
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::ApplyGameSettings(true);
CommonHostInterface::FixIncompatibleSettings(true);
CheckForSettingsChanges(old_settings);
if (!System::GetRunningTitle().empty())
@ -353,6 +354,7 @@ void SDLHostInterface::SaveAndUpdateSettings()
Settings old_settings(std::move(g_settings));
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::ApplyGameSettings(false);
CommonHostInterface::FixIncompatibleSettings(false);
CheckForSettingsChanges(old_settings);
m_settings_interface->Save();
@ -462,6 +464,7 @@ void SDLHostInterface::LoadSettings()
m_settings_interface = std::make_unique<INISettingsInterface>(GetSettingsFileName());
m_settings_copy.Load(*m_settings_interface);
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::FixIncompatibleSettings(false);
}
void SDLHostInterface::ReportError(const char* message)