Files
AnyPS5/docs/dev/debt/libSceCesCs.md
T
ps54allandClaude Opus 5.5 61e10efbd6 feat(libSceCesCs): convert EUC-JP (CP51932) strings through a profile context
sceCesUcsProfileInitEucJpCp51932 returns a profile for EUC-JP, and
sceCesMbcsUcsContextInit now keeps the profile in the context. The
multibyte string conversions (UTF-8, UCS-2, their length queries) and
sceCesEucJpToUcs2 convert ASCII and the JIS X 0201 half-width katakana
for that profile, and every character for the existing CP1252/CP1251
profiles. Two- and three-byte JIS X 0208/0212 characters throw, since
their mapping table is not present.

Metal Gear Solid 4 Master Collection (PPSA18194) imports the set in its
game executable, which fails to load without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 14:32:42 +02:00

2.7 KiB

libSceCesCs technical debt

Silent stubs

  • sceCesMbcsUcsContextInit (libSceCesCs) stores the profile pointer in the first 8 bytes of the caller's context; the console's context layout is not known. It returns the invalid-parameter error for a null context.
  • EUC-JP (CP51932) conversions (libSceCesCs): sceCesUcsProfileInitEucJpCp51932 marks the caller's sheet with an 8-byte tag and returns it as the profile. sceCesUtf8StrToMbcsStr, sceCesUcs2StrToMbcsStr, sceCesMbcsStrToUtf8Str, sceCesMbcsStrToUcs2Str, their Get*Len forms and sceCesEucJpToUcs2 convert ASCII and the JIS X 0201 half-width katakana (0x8E + 0xA1-0xDF, U+FF61-U+FF9F) for that profile, and every character for the CP1252 and CP1251 profiles. Two-byte JIS X 0208 and three-byte JIS X 0212 characters throw: their mapping table is not present. Signatures follow orbital. The string forms stop at the source limit or at a zero code unit, which is neither converted nor counted, and write no terminator; *Len outputs count code units consumed and produced. A code point outside the BMP answers UNASSIGNED_CODE. Unverified on hardware. The signature int sceCesMbcsUcsContextInit(union* context, const union* mbcsUcsPrf) follows the Orbital IDA type database. PPSA15246 calls it and imports no other function that takes the context. sceCesRefersUcsProfileCp1251 returns a profile accepted by sceCesSbcToUtf8 and sceCesUtf8ToSbc only, with the Windows-1251 table of Microsoft's bestfit1251.txt, where byte 0x98 (unassigned) maps to U+0098 like the unassigned Cp1252 bytes; the console behavior for that byte is not verified
  • sceCesUcsProfileInitSJis1997Cp932 (libSceCesCs) - returns the sheet argument without writing profile tables to it, and returns null for a null pointer; Shift-JIS conversion tables are unimplemented. The signature union* sceCesUcsProfileInitSJis1997Cp932(SceCesUcsProfileSheet* sheet) follows the Orbital IDA type database

Unknown function info

  • sceCesRefersUcsProfileCp1250 (libSceCesCs) - declared without parameters and returning a pointer, following sceCesRefersUcsProfileCp1251; the signature and behavior are unverified. PPSA34501 fails to start without this export (qYu6y1E0Qbg).