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 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-11-09 12:43:39 +01:00
1 parent c3ab986b74
commit 45a5e3b722
1 file changed
+13 -2
+13 -2
View File
@@ -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;