Files
AnyPS5/docs/dev/debt/libSceKeyboard.md

6.6 KiB

libSceKeyboard technical debt

Functional

  • sceKeyboardRead and sceKeyboardReadState: guarded writes return INVALID_ARG for non-null inaccessible output spans and preserve unread history. The console's exact error code for these pointers and whether a partially writable span may receive a prefix before failure remain unverified.
  • sceDbgKeyboardInit, sceDbgKeyboardOpen and sceDbgKeyboardClose (libSceKeyboard) - forward to sceKeyboardInit, sceKeyboardOpen and sceKeyboardClose, so they share their state and every gap their entries list. In firmware 13.42's libSceKeyboard.sprx (read from disassembly, not run on a console) each of the three is a single jmp into that function's code (0x1c0 to 0xd0, 0x480 to 0x1d0, 0x700 to 0x490).
  • Keyboard handle query (libSceKeyboard) - sceKeyboardGetHandle queries the handle for the open keyboard assigned to userId on primary port (type == 0, index == 0), returning KEYBOARD_ERROR_NO_HANDLE (0x80da0008) if unassigned or if type/index differ from default port 0. Both the error constant 0x80da0008 and the type/index port 0 constraint are inferred from user service conventions and remain unmeasured on a retail console.
  • sceKeyboardDebugGetDeviceId - validation and the -1 sentinel follow the retail 11.00 dump decode: not-initialized, null output, -1 written up front, no device match returns INVALID_HANDLE, a match writes the device record's id. The decode binds the handle to a live device record, so an unopened or detached handle is the no-match case; whether firmware also has the mouse-style empty-slot success path is not decoded. The reported device id is a model constant for the single emulated device.
  • sceDbgKeyboardReadState - the retail 11.00 dump decode recovers its two-argument signature and shows it calls sceKeyboardReadState's shared path with a third argument of 1 instead of 0; the flag's semantic effect inside that path is not decoded, so the export stays unimplemented until the flag is understood.
  • sceKeyboardGetKey2Char: initialization, output length and reserved bytes remain unverified on a console; unconverted keys retain the host's length of 0. One title (PPSA15246) disassembled for this entry calls it after clearing the first 20 bytes of its output buffer (16-byte store 0x69942d, 32-bit store 0x699435; no size argument), uses a character only when the result is 0 and the first output byte is nonzero, and then reads the 16-bit value at offset 8. Which other output fields it reads and what its other arguments mean are not shown.
  • sceKeyboardOpen: a PS5 on system software 12.40 returned 0x809B0001 for user -1 and 0x809B0081 for user 0, with type and index 0 after sceKeyboardInit. Every other id that is not a registered user gets 0x809B0081 too, and other negative ids keep INVALID_ARG; neither was probed, nor was the order of the user check against a bad type or index.
  • sceKeyboardOpen with index 1: what the console's second keyboard port answers is unverified, and so is the range of index; the library's code was not read. PPSA15508 opens index 0 and then index 1 for the same user, with type 0 and a null parameter, and asserts unless each result is above 0 (call sites 0xd76403 and 0xd76427). Index 1 gives a second handle, 2, for a port with no keyboard: sceKeyboardRead returns no samples, sceKeyboardReadState a disconnected sample of length 1, sceKeyboardGetConnection false and sceKeyboardDebugGetDeviceId INVALID_HANDLE; the host keyboard stays on index 0. Any other index keeps INVALID_ARG.

Unknown function info

  • Keyboard export l76jptHfizM is recorded as a function with qualifier E#A in older and later version-labelled modules. In both, dynamic metadata maps library ID 4 and module ID 0 to libSceKeyboard. The older module-parameter words are 0x08540001 and 0x03200004; the later words are 0x13590001 and 0x13600007. The 17 older function NIDs under that qualifier have sorted-LF SHA-256 42ee4240ba6e95c22083ea1ce753b81bdc8852b5f241675f4eecbd9bcca83ad9 using the static ELF membership procedure. Version labels are not authenticated retail provenance; this digest identifies the NID set, not the binary or ABI. The export name, signature and behavior are unverified; this declaration throws.

  • sceDbgKeyboardGetHandle (logical libSceDbgKeyboard, NID vob3PZretTg) - signature and behavior are unknown. This parameterless int declaration is an import placeholder, not a verified ABI prototype; every call throws through NotImplemented_nid_no_patch. The binding is in the 13.60 inventory.

  • sceDbgKeyboardGetKey2Char and sceDbgKeyboardRead (libSceKeyboard) - names and NIDs are present in the PS5 3.20 export inventory, but no credible prototypes were found. They are declared without parameters solely to resolve known imports; this is not an ABI claim.

  • sceKeyboardGetDeviceInfo and sceKeyboardSetProcessFocus: pointer arguments are passed to device ioctls. Device-info storage is 168 bytes in the connection-query caller, but its fields and the process-focus layout remain unresolved.

  • sceKeyboardConnectPort, sceKeyboardDisconnectPort and sceKeyboardDeviceOpen: argument widths are confirmed. The meaning/order of the two 32-bit port arguments and the final 32-bit device-open argument still require the device-service backend.

  • sceKeyboardPadEmulateClose and sceKeyboardPadEmulateOpen: the supplied keyboard library has neither export; their signatures remain unresolved.