From c7c5fc0ac6141551ef4c741a07afd179f8e69f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 7 Nov 2026 16:21:04 +0100 Subject: [PATCH] sceFont: Use the HLE and our own fonts for the Monster Hunter 3rd HD remaster - Fixes #22982 This remaster only ever ran in the PS3's emulator, and its unofficial Simplified Chinese translation renders no Chinese text with the firmware's sceFont and fonts, which we now use whenever a firmware is installed. Its entry in the HD remaster table now says so: sceFont stays HLE'd whatever the settings and compat flags say, and the HLE sceFont loads our fonts rather than the NAND's (and doesn't install any from the disc's updater). Co-Authored-By: Claude Opus 5.5 --- Core/HDRemaster.cpp | 5 ++++- Core/HDRemaster.h | 4 ++++ Core/HLE/HLE.cpp | 7 ++++++- Core/HLE/sceFont.cpp | 7 ++++++- Core/PSPLoaders.cpp | 1 + Core/System.cpp | 1 + 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Core/HDRemaster.cpp b/Core/HDRemaster.cpp index f7869687a9..b593b68eb4 100644 --- a/Core/HDRemaster.cpp +++ b/Core/HDRemaster.cpp @@ -20,10 +20,13 @@ bool g_RemasterMode; bool g_DoubleTextureCoordinates; +bool g_RemasterHLEFonts; // TODO: Do all of the remasters aside from Monster Hunter/Shin Sangoku use double texture coordinates? extern const struct HDRemaster g_HDRemasters[] = { - { "NPJB40001", 0x04000000, false }, // MONSTER HUNTER PORTABLE 3rd HD Ver. + // It only ever ran in the PS3's emulator, never on a PSP. Its unofficial Simplified Chinese + // translation renders no Chinese text with the firmware's sceFont and fonts (#22982). + { "NPJB40001", 0x04000000, false, nullptr, true }, // MONSTER HUNTER PORTABLE 3rd HD Ver. { "NPJB40002", 0x04000000, true }, // K-ON Houkago Live HD Ver { "NPJB40003", 0x04000000, false }, // Shin Sangoku Musou Multi Raid 2 HD Ver { "ULJM05170", 0x04000000, true, "ULJM-05170|55C069C631B22685|0001|G" }, // Eiyuu Densetsu Sora no Kiseki FC Kai HD Edition diff --git a/Core/HDRemaster.h b/Core/HDRemaster.h index 47884976ed..478078ef53 100644 --- a/Core/HDRemaster.h +++ b/Core/HDRemaster.h @@ -27,11 +27,15 @@ extern bool g_RemasterMode; extern bool g_DoubleTextureCoordinates; +// Keep sceFont HLE'd and give it our own fonts, never the firmware's. +extern bool g_RemasterHLEFonts; + struct HDRemaster { const char *gameID; u32 memorySize; bool doubleTextureCoordinates; const char *umdDataValue; + bool hleFonts; }; extern const struct HDRemaster g_HDRemasters[]; diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index 7c4d31e3ab..b404f90c80 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -46,6 +46,7 @@ #include "Core/HLE/sceKernelModule.h" #include "Core/HLE/sceFont.h" #include "Core/FileSystems/MetaFileSystem.h" +#include "Core/HDRemaster.h" #include "Core/HLE/HLE.h" enum { @@ -424,7 +425,11 @@ void HLECheckModuleAvailability() { // libfont.prx/sceFont is shipped on game discs but reads its fonts from flash0:/font and has // nothing to fall back on, so the fonts are required. - if (AlwaysDisableHLEFlags() & DisableHLEFlags::sceFont) { + if (g_RemasterHLEFonts) { + // Overrides the setting and the compat flag too. + g_unavailableDisableFlags |= DisableHLEFlags::sceFont; + INFO_LOG(Log::HLE, "This HD remaster needs the HLE sceFont and our fonts."); + } else if (AlwaysDisableHLEFlags() & DisableHLEFlags::sceFont) { if (!NandFontsComplete()) { g_unavailableDisableFlags |= DisableHLEFlags::sceFont; INFO_LOG(Log::HLE, "flash0:/font doesn't have this firmware's fonts - using the HLE sceFont rather than the disc's."); diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 03a328b783..576cf5ef1b 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -24,6 +24,7 @@ #include "Core/System.h" #include "Core/ELF/ParamSFO.h" #include "Core/Font/PGF.h" +#include "Core/HDRemaster.h" #include "Core/Util/PathUtil.h" #include "Core/Util/PSARUnpack.h" #include "Common/Data/Text/I18n.h" @@ -1001,8 +1002,12 @@ static void __LoadInternalFonts() { const std::string gameFontPath = "disc0:/PSP_GAME/USRDIR/"; const bool checkClassicOverrides = pspFileSystem.GetFileInfo(fontOverridePath).exists; + // See g_HDRemasters. Our own fonts, from assets, then. + const bool useNand = !checkClassicOverrides && !g_RemasterHLEFonts; if (checkClassicOverrides) { WARN_LOG(Log::sceFont, "Classic font overrides active, ignoring NAND: %s", fontOverridePath.c_str()); + } else if (g_RemasterHLEFonts) { + INFO_LOG(Log::sceFont, "Not using the NAND's fonts for this HD remaster"); } else if (!NandFontsComplete()) { InstallFontsFromDiscUpdater(); } @@ -1035,7 +1040,7 @@ static void __LoadInternalFonts() { // No game font, let's try classic override path. NOTE: This is not recommended - use flash0. fontFilename = fontOverridePath + entry.fileName; bufferRead = pspFileSystem.ReadEntireFile(fontFilename, buffer, true) >= 0; - } else if (!bufferRead) { + } else if (useNand && !bufferRead) { // The real fonts, from a firmware the user installed or that we took off a disc. fontFilename = std::string(g_nandFontPath) + entry.fileName; bufferRead = pspFileSystem.ReadEntireFile(fontFilename, buffer, true) >= 0; diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index a22ff33bd8..cfbbe49c67 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -197,6 +197,7 @@ void InitMemorySizeForGame() { g_RemasterMode = true; Memory::g_MemorySize = entry.memorySize; g_DoubleTextureCoordinates = entry.doubleTextureCoordinates; + g_RemasterHLEFonts = entry.hleFonts; break; } if (g_RemasterMode) { diff --git a/Core/System.cpp b/Core/System.cpp index a80a62fd52..8dc54d92c9 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -387,6 +387,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin g_RemasterMode = false; g_DoubleTextureCoordinates = false; + g_RemasterHLEFonts = false; Memory::g_PSPModel = g_Config.iPSPModel; g_CoreParameter.fileType = type;