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

@ -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);