mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-03 12:57:27 +00:00
sceConvertKeycodeGetCharacterFromKeyboardData threw for an index outside the key data, accepted any state bits and converted with the caller's state only. Firmware 13.42's module returns INVALID_PARAMETER for a length above 16, an led of 8 or more, a modifier_key of 0x100 or more, a state bit outside 0x1C000080 or an index outside the key data, before the layout checks, and converts key_code[index] with state | modifier_key << 8 | led << 16. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2.4 KiB
2.4 KiB
libSceConvertKeycode technical debt
Functional
- sceConvertKeycodeGetVirtualKeycode,
sceConvertKeycodeGetCharacterandsceConvertKeycodeGetCharacterFromKeyboardData: layouts 31 and up need a PS5 title or a PS4 SDK of 0x05000000, 38 and 39 a PS5 SDK of 0x06000000 or a PS4 SDK of 0x10000000, and 39 a PS5 title with SDK 0x08000000; other titles get0x80BC001D.GetVirtualKeycodeswaps the Y and Z keys of layouts 2, 3 and 12 below PS5 SDK 0x04000000 or PS4 SDK 0x09000000. These rules come from firmware 13.42's module, run natively, not from a console; the SDK version is the one in the process parameters. Three titles disassembled for this entry callsceConvertKeycodeGetVirtualKeycodeat four sites (PPSA24779 0xa9199a, PPSA29866 0x2d8bdd, PPSA30601 0x15e4624 and 0x15e47da): the keyboard type is the constant 4 at 0xa9199a and 0x15e47da and a run-time value at the other two, and no value read is 2, 3, 12 or in 31 to 39. - sceConvertKeycodeGetCharacterFromKeyboardData: returns
0x80BC0030for alengthabove 16 (or negative), anledof 8 or more, amodifier_keyof 0x100 or more, astatebit outside 0x1C000080, or an index outside the key data, before the layout checks, and otherwise convertskey_code[index]withstate | modifier_key << 8 | led << 16. From firmware 13.42's module, run natively, not from a console. - sceConvertKeycodeGetImeKeyboardType: implemented exactly as the repository owner (boykopovar) specified the UserService keyboard type (plus the Japanese variant for type 37 and the Traditional Chinese variant for type 39) to IME keyboard type table, the SDK compatibility rules (38 becomes 4 for PS5 SDK below 0x06000000 or PS4 SDK below 0x10000000; 39 becomes 29 for PS5 SDK below 0x08000000 and for every PS4 client), the error codes and the unmatched-type result (success, IME type 0). The PS4/PS5 client rule reads the title ID prefix from
param.sfoorparam.json(CUSAis PS4); a missing, malformed or oversized ID or title, as in homebrew, is treated as PS5. Reliable detection inspects the originaleboot.bin, which only the relinker reads, so it is not done. UserService reports the keyboard type of the configured system language, so the function returns the owner's IME type for that language (see libSceUserService.md).