Skip to content

Commit

Permalink
Merge pull request #16388 from hrydgard/twinbee-language-fix
Browse files Browse the repository at this point in the history
Twinbee Portable: Add compat flag to avoid game bug with some languages
  • Loading branch information
unknownbrackets authored Nov 13, 2022
2 parents 59c0395 + 9482578 commit 4219cfb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ struct CompatFlags {
bool AllowDownloadCLUT;
bool NearestFilteringOnFramebufferCreate;
bool SecondaryTextureCache;
bool EnglishOrJapaneseOnly;
};

struct VRCompat {
Expand Down
6 changes: 6 additions & 0 deletions Core/HLE/sceImpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions Core/HLE/sceUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1264,3 +1264,9 @@ ULES00850 = true
ULUS10297 = true
ULJM05516 = true
NPJH50408 = true

[EnglishOrJapaneseOnly]
# Twinbee Portable, see issue #16382
ULAS42089 = true
ULJM05221 = true
ULJM05323 = true

0 comments on commit 4219cfb

Please sign in to comment.