GameSettings: Add trait for recompiler icache

This commit is contained in:
Connor McLaughlin 2020-08-29 22:11:10 +10:00
parent 19d6037b99
commit 914f3ad447
2 changed files with 14 additions and 0 deletions

View file

@ -32,6 +32,7 @@ std::array<std::pair<const char*, const char*>, static_cast<u32>(Trait::Count)>
{"ForcePGXPCPUMode", TRANSLATABLE("GameSettingsTrait", "Force PGXP CPU Mode")},
{"ForceDigitalController", TRANSLATABLE("GameSettingsTrait", "Force Digital Controller")},
{"ForceRecompilerMemoryExceptions", TRANSLATABLE("GameSettingsTrait", "Force Recompiler Memory Exceptions")},
{"ForceRecompilerICache", TRANSLATABLE("GameSettingsTrait", "Force Recompiler ICache")},
}};
const char* GetTraitName(Trait trait)
@ -459,6 +460,18 @@ void Entry::ApplySettings(bool display_osd_messages) const
g_settings.cpu_recompiler_memory_exceptions = true;
}
if (HasTrait(Trait::ForceRecompilerICache))
{
if (display_osd_messages && g_settings.cpu_execution_mode != CPUExecutionMode::Interpreter &&
!g_settings.cpu_recompiler_icache)
{
g_host_interface->AddOSDMessage(
g_host_interface->TranslateStdString("OSDMessage", "Recompiler ICache forced by game settings."), osd_duration);
}
g_settings.cpu_recompiler_icache = true;
}
}
} // namespace GameSettings

View file

@ -23,6 +23,7 @@ enum class Trait : u32
ForcePGXPCPUMode,
ForceDigitalController,
ForceRecompilerMemoryExceptions,
ForceRecompilerICache,
Count
};