From a31d7dc0b3bcd79f5cf64f5834ce6b651579c045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 3 Apr 2025 19:58:50 +0200 Subject: [PATCH] Add mechanism to "graduate" DisableHLE flags to be permanently on. Will be used soon. --- Core/HLE/HLE.cpp | 23 +++++++++++++++++------ Core/HLE/HLE.h | 3 ++- UI/GameSettingsScreen.cpp | 11 ++++++++--- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index 8d5a6022de..719e61afe4 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -187,18 +187,26 @@ const HLEModuleMeta *GetHLEModuleMetaByImport(std::string_view importModuleName) return nullptr; } +DisableHLEFlags AlwaysDisableHLEFlags() { + // Once a module seems stable to load properly, we'll graduate it here. + // This will hide the checkbox, too. + // return DisableHLEFlags::scePsmf | DisableHLEFlags::scePsmfPlayer; + return (DisableHLEFlags)0; +} + // Process compat flags. static DisableHLEFlags GetDisableHLEFlags() { - DisableHLEFlags flags = (DisableHLEFlags)g_Config.iDisableHLE; + DisableHLEFlags flags = (DisableHLEFlags)g_Config.iDisableHLE | AlwaysDisableHLEFlags(); if (PSP_CoreParameter().compat.flags().DisableHLESceFont) { flags |= DisableHLEFlags::sceFont; } + return flags; } // Note: name is the modname from prx, not the export module name! -bool ShouldHLEModule(std::string_view modname, bool *wasDisabled) { - if (wasDisabled) { - *wasDisabled = false; +bool ShouldHLEModule(std::string_view modname, bool *wasDisabledManually) { + if (wasDisabledManually) { + *wasDisabledManually = false; } const HLEModuleMeta *meta = GetHLEModuleMeta(modname); if (!meta) { @@ -207,8 +215,11 @@ bool ShouldHLEModule(std::string_view modname, bool *wasDisabled) { bool disabled = meta->disableFlag & GetDisableHLEFlags(); if (disabled) { - if (wasDisabled) { - *wasDisabled = true; + if (wasDisabledManually) { + // We don't show notifications if a flag has "graduated". + if (!(meta->disableFlag & AlwaysDisableHLEFlags())) { + *wasDisabledManually = true; + } } return false; } diff --git a/Core/HLE/HLE.h b/Core/HLE/HLE.h index 60e892b479..2a71089264 100644 --- a/Core/HLE/HLE.h +++ b/Core/HLE/HLE.h @@ -107,7 +107,7 @@ struct HLEModuleMeta { const HLEModuleMeta *GetHLEModuleMetaByFlag(DisableHLEFlags flag); const HLEModuleMeta *GetHLEModuleMeta(std::string_view modname); -bool ShouldHLEModule(std::string_view modname, bool *wasDisabled = nullptr); +bool ShouldHLEModule(std::string_view modname, bool *wasDisabledManually = nullptr); bool ShouldHLEModuleByImportName(std::string_view importModuleName); const char *GetHLEFuncName(std::string_view module, u32 nib); @@ -121,6 +121,7 @@ u32 GetNibByName(std::string_view module, std::string_view function); void RegisterHLEModule(std::string_view name, int numFunctions, const HLEFunction *funcTable); int GetNumRegisteredHLEModules(); const HLEModule *GetHLEModuleByIndex(int index); +DisableHLEFlags AlwaysDisableHLEFlags(); // Run the current thread's callbacks after the syscall finishes. void hleCheckCurrentCallbacks(); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index eca4bce8c8..130f8ab6ca 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1996,11 +1996,16 @@ void DeveloperToolsScreen::CreateViews() { list->Add(new BitCheckBox(&g_Config.iDumpFileTypes, (int)DumpFileType::Atrac3, dev->T("Atrac3/3+"))); list->Add(new ItemHeader("Disable HLE (experimental! Not expected to work yet)")); + for (int i = 0; i < (int)DisableHLEFlags::Count; i++) { DisableHLEFlags flag = (DisableHLEFlags)(1 << i); - const HLEModuleMeta *meta = GetHLEModuleMetaByFlag(flag); - if (meta) { - list->Add(new BitCheckBox(&g_Config.iDisableHLE, (int)flag, meta->modname)); + + // Show a checkbox, unless the setting has graduated to always on. + if (!(flag & AlwaysDisableHLEFlags())) { + const HLEModuleMeta *meta = GetHLEModuleMetaByFlag(flag); + if (meta) { + list->Add(new BitCheckBox(&g_Config.iDisableHLE, (int)flag, meta->modname)); + } } }