From 9482578fbb2a942579558b06a965d3a615cbd29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 13 Nov 2022 23:16:09 +0100 Subject: [PATCH] Twinbee Portable: Add config flag to avoid the system languages the game doesn't work with --- Core/Compatibility.cpp | 1 + Core/Compatibility.h | 1 + Core/HLE/sceImpose.cpp | 6 ++++++ Core/HLE/sceUtility.cpp | 5 +++++ assets/compat.ini | 6 ++++++ 5 files changed, 19 insertions(+) diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index b09eb67c14b8..d3d65861e006 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -119,6 +119,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "AllowDownloadCLUT", &flags_.AllowDownloadCLUT); CheckSetting(iniFile, gameID, "NearestFilteringOnFramebufferCreate", &flags_.NearestFilteringOnFramebufferCreate); CheckSetting(iniFile, gameID, "SecondaryTextureCache", &flags_.SecondaryTextureCache); + CheckSetting(iniFile, gameID, "EnglishOrJapaneseOnly", &flags_.EnglishOrJapaneseOnly); } void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) { diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 86d139a5361b..6755afe7a94a 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -90,6 +90,7 @@ struct CompatFlags { bool AllowDownloadCLUT; bool NearestFilteringOnFramebufferCreate; bool SecondaryTextureCache; + bool EnglishOrJapaneseOnly; }; struct VRCompat { diff --git a/Core/HLE/sceImpose.cpp b/Core/HLE/sceImpose.cpp index 086cc83c1736..bd5f654bc20c 100644 --- a/Core/HLE/sceImpose.cpp +++ b/Core/HLE/sceImpose.cpp @@ -24,6 +24,7 @@ #include "Core/MIPS/MIPS.h" #include "Core/Config.h" #include "Core/MemMap.h" +#include "Core/System.h" const int PSP_UMD_POPUP_DISABLE = 0; const int PSP_UMD_POPUP_ENABLE = 1; @@ -40,6 +41,11 @@ static u32 backlightOffTime; void __ImposeInit() { language = g_Config.iLanguage; + if (PSP_CoreParameter().compat.flags().EnglishOrJapaneseOnly) { + if (language != PSP_SYSTEMPARAM_LANGUAGE_ENGLISH && language != PSP_SYSTEMPARAM_LANGUAGE_JAPANESE) { + language = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH; + } + } buttonValue = g_Config.iButtonPreference; umdPopup = PSP_UMD_POPUP_DISABLE; backlightOffTime = 0; diff --git a/Core/HLE/sceUtility.cpp b/Core/HLE/sceUtility.cpp index b205ed956d0a..35db8740fadd 100644 --- a/Core/HLE/sceUtility.cpp +++ b/Core/HLE/sceUtility.cpp @@ -886,6 +886,11 @@ static u32 sceUtilityGetSystemParamInt(u32 id, u32 destaddr) break; case PSP_SYSTEMPARAM_ID_INT_LANGUAGE: param = g_Config.iLanguage; + if (PSP_CoreParameter().compat.flags().EnglishOrJapaneseOnly) { + if (param != PSP_SYSTEMPARAM_LANGUAGE_ENGLISH && param != PSP_SYSTEMPARAM_LANGUAGE_JAPANESE) { + param = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH; + } + } break; case PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE: param = g_Config.iButtonPreference; diff --git a/assets/compat.ini b/assets/compat.ini index 7a1ac5d79f95..425164cf589f 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -1264,3 +1264,9 @@ ULES00850 = true ULUS10297 = true ULJM05516 = true NPJH50408 = true + +[EnglishOrJapaneseOnly] +# Twinbee Portable, see issue #16382 +ULAS42089 = true +ULJM05221 = true +ULJM05323 = true \ No newline at end of file