From 914f3ad447cf614385bbab4add177ef5c8d47e10 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 29 Aug 2020 22:11:10 +1000 Subject: [PATCH] GameSettings: Add trait for recompiler icache --- src/core/game_settings.cpp | 13 +++++++++++++ src/core/game_settings.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/core/game_settings.cpp b/src/core/game_settings.cpp index 1d84d5943..4e347f9e4 100644 --- a/src/core/game_settings.cpp +++ b/src/core/game_settings.cpp @@ -32,6 +32,7 @@ std::array, static_cast(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 \ No newline at end of file diff --git a/src/core/game_settings.h b/src/core/game_settings.h index 45b8bd0ac..030e957e1 100644 --- a/src/core/game_settings.h +++ b/src/core/game_settings.h @@ -23,6 +23,7 @@ enum class Trait : u32 ForcePGXPCPUMode, ForceDigitalController, ForceRecompilerMemoryExceptions, + ForceRecompilerICache, Count };