From 45a5e3b7223cbc5e285bfc1197085087f1d0ec20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 9 Nov 2026 12:43:39 +0100 Subject: [PATCH] sceIo: Accept the code page devctl on fatms0: too devctl 0x02425856 sets the code page for 8.3 names (fatms.prx in 6.61 passes the word to sceCodepage). It was only handled on ms0:, and on fatms0: fell through to the unimplemented path, whose SCE_KERNEL_ERROR_UNSUP is the 80020325 the XMB showed after changing System Settings > Character Set. Also check the argument like fatms does. Co-Authored-By: Claude Opus 5.5 --- Core/HLE/sceIo.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 36474dc498..4309a06d2a 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -1782,6 +1782,16 @@ static u32 IoOpenFatSearch(u32 argAddr, int argLen); static u32 IoGetstatFatComponentPath(u32 argAddr, int argLen); static u32 IoOpenFatComponentPath(u32 argAddr, int argLen); +// Devctl 0x02425856: sets the code page for 8.3 names. From fatms.prx (6.61), which passes the +// word to sceCodepage_driver_b0ae63aa. The XMB sets it at boot and from System Settings > +// Character Set. We keep host file names, so there's nothing to do. +static u32 IoSetFatCodepage(u32 argAddr, int argLen) { + if (!Memory::IsValid4AlignedAddress(argAddr) || argLen != 4) { + return hleLogError(Log::sceIo, SCE_KERNEL_ERROR_ERRNO_INVALID_ARGUMENT); + } + return hleLogDebug(Log::sceIo, 0, "set code page %d", Memory::ReadUnchecked_U32(argAddr)); +} + static u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 outPtr, int outLen) { if (strcmp(name, "emulator:")) { DEBUG_LOG(Log::sceIo,"sceIoDevctl(\"%s\", %08x, %08x, %i, %08x, %i)", name, cmd, argAddr, argLen, outPtr, outLen); @@ -2036,8 +2046,7 @@ static u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 o } break; case 0x02425856: - // Used by VSH, no clue what it should do. Let's just return 0. - return hleLogError(Log::sceIo, 0, "Unknown memstick devctl: %08x", cmd); + return IoSetFatCodepage(argAddr, argLen); case 0x02415864: // Directory search, used by the VSH media browsers before 3.80. return IoOpenFatSearch(argAddr, argLen); @@ -2073,6 +2082,8 @@ static u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 o if (!strcmp(name, "fatms0:")) { switch (cmd) { + case 0x02425856: + return IoSetFatCodepage(argAddr, argLen); case 0x0240d81e: // TODO: Invalidate MS driver file table cache (nop) break;