Files
AnyPS5/docs/dev/debt/libSceCesCs.md
T
primesoul-web 3f03bc0e24 feat(libs): finish the CesCs conversions and the AudioOut, AudioIn and GameUpdate exports
libSceCesCs goes to 17 of 17: three-byte EUC-JP JIS X 0212 (0x8F)
characters convert through a table read from the Unicode consortium's
JIS0212.TXT, both directions, so sceCesEucJpToUcs2, the MbcsStrTo*
and *Get*Len forms and the context conversions accept them, and a
character with cells in both JIS X 0208 and JIS X 0212 still encodes
to the two-byte form. sceCesRefersUcsProfileCp1250 returns a profile
with the Windows-1250 table of Microsoft's bestfit1250.txt, accepted
by the SBC and context conversions.

The AudioOut HDMI bitstream Sys family follows the Ex ports: SysOpen
opens a port only for mode 5, the TrueHD MAT route EVO-PLAYER-PS5
reads from the firmware 12.70 mode tables, paced at 192 kHz with no
host device; SysConfigureOutput accepts the observed HDMI MAT switch;
SysClose closes a Sys port. sceAudioOut2MasteringGetState fills the
states by states id with the descriptors KytyPS5 declares, SetParam
answers a null parameter with the mastering invalid-API-parameter
error, Set3DLatency follows KytyPS5's output validation (0x80268001
above 2, any user), SetSystemDebugState records the debug state id,
and GetSpeakerArrayCoefficients returns the front pair KytyPS5 and
prosper both return.

sceAudioInOpen accepts param 0x10 as float mono like KytyPS5; HqOpen
answers a longer grain or a lower rate with the invalid-size and
invalid-frequency errors; AsyncOpen also accepts the 384-sample grain
SharpProspero documents. sceGameUpdateGetAddcontLatestVersion answers
a null entitlement label with 0x80412803, as prosper does.
2026-10-18 18:52:36 +02:00

4.1 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. The signature int sceCesMbcsUcsContextInit(union* context, const union* mbcsUcsPrf) follows the Orbital IDA type database. 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
  • 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, the JIS X 0201 half-width katakana (0x8E + 0xA1-0xDF, U+FF61-U+FF9F) and the two-byte rows 0xA1-0xFE for that profile, and every character for the CP1252 and CP1251 profiles. The two-byte table (JisX0208.hpp, 7336 of 8836 cells) is Microsoft code page 932 read through the standard JIS row/cell to Shift-JIS arithmetic, so it includes NEC row 13 and the NEC-selected IBM rows 89-92 and maps the Microsoft variants (U+FF5E at 0xA1C1, U+2225, U+FF0D, U+FFE0-U+FFE2) instead of JIS X 0208's; that the console's CP51932 table equals it is assumed from the Microsoft code page, not measured. A character with several cells encodes to the lowest cell. A well-formed but unassigned cell answers UNASSIGNED_CODE, a trail byte outside 0xA1-0xFE INVALID_ENCODE, a cut pair SRC_BUFFER_END; the console's errors for these are not known. Three-byte JIS X 0212 (0x8F) characters convert through a second table (JisX0212.hpp, 6067 of 8836 cells) read from the Unicode consortium's JIS0212.TXT; that the console's CP51932 table equals it is assumed from that mapping, not measured. A well-formed but unassigned three-byte cell answers UNASSIGNED_CODE and a cut triple SRC_BUFFER_END. A character with cells in both JIS X 0208 and JIS X 0212 encodes to the two-byte form, and one only in JIS X 0212 to the three-byte form. 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.
  • 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) - returns a profile accepted by sceCesSbcToUtf8, sceCesUtf8ToSbc and the MBCS context conversions, with the Windows-1250 table of Microsoft's bestfit1250.txt, where the unassigned bytes map to their Latin-1 control characters as the Cp1252 and Cp1251 tables do; the console behavior for those bytes and the whole profile is not verified. PPSA34501 fails to start without this export (qYu6y1E0Qbg)