Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
5.6 KiB
libSceMouse technical debt
Unknown function info
-
sceMouseGetDeviceInfo, sceMouseSetHandType, sceMouseSetPointerSpeed and the extension calls (libSceMouse) - argument lists and checks follow @BunnyFl's firmware 13.42 disassembly of
libSceMouse.sprx(SHA-256e07cd04766ea48f5216e40fd4397758f640a7200cfa7edb6a00255326bd33c61), not a console. Past their checks they throw:GetDeviceInfo(int32, void*),SetHandType(handle, uint32),SetPointerSpeed(handle, uint32),ExtensionSetCursor(handle, int32)andExtensionGetCursor(handle, void*)end in a mouse driver ioctl, which isn't modelled.GetDeviceInfo's first check, a closed device fd, is taken as not initialised here.ExtensionRead(handle, void*, uint32 size, int32 num)andExtensionReadState(handle, void*, uint32 size)runsceMouseRead's checks with the extension flag, after their size checks (0x30 and 0x40) andReadState's 64-byte clear; the 0x30-byte extension record and the state the slot keeps at +0x100 are unknown.
-
sceMouseDisconnectAll, sceMouseVirtualDeviceAddDevice, sceMouseVirtualDeviceDeleteDevice and sceMouseVirtualDeviceGetCursor - the names and NIDs are recorded in the 13.60 export inventory. Signatures and behavior remain unknown; the parameterless
intdeclarations only resolve imports and every call throws. Not measured on a console. -
sceMouseConnectPort, sceMouseDeviceOpen, sceMouseDisconnectDevice, sceMouseDisconnectPort, sceMouseMbusInit and sceMouseSetProcessPrivilege (libSceMouse) - names and NIDs are present in the PS5 3.20 export inventory; the no-argument prototypes follow shadPS4's PS4 stubs, not measured on a console. These declarations have no parameters solely to resolve known imports and make no ABI claim.
Functional
-
sceMouseGetHandle, sceMouseExtensionSetConfig and sceMouseExtensionScalePosition (libSceMouse) - follow the same 13.42 disassembly, not a console; none reaches the driver.
GetHandle(userId, type, index)returns the handlesceMouseOpengave that user and type, or 0x80df0008. The console skips slots whose +0xc8 field is 1 whenindexis non-zero; that field's meaning is unknown, and no slot here has it.ExtensionSetConfig(handle, config)refuses a null or a non-zero byte in 5..0x1f, then stores the u32 at 0 and the byte at 4; nothing here reads them yet.ExtensionScalePosition(uint16* position, uint16 scale)rounds*position * (scale - 1) / 65535up. The console divides with a multiply by 0x80008001 and a shift by 47, which is the floor, and adds 1 when the remainder isn't 0, through a compare of-(product * 65537)with 0x10002 (@BunnyFl's emulation).
-
Publish (libSceMouse) - consecutive motion-only reports with the same buttons are summed into the newest unread entry, so a title that reads a few entries per frame gets current motion instead of a full queue of old reports. Reports with no motion and no button, wheel, tilt or connection change are dropped. Per-report granularity and the console's own report rate are not reproduced
-
sceMouseResetAbsolutePosition, sceMouseSetAbsoluteVirtualScreenSize, sceMouseSetAbsoluteHighPrecisionMode, sceMouseReadAbsolutePosition (libSceMouse) - follow firmware 13.42 run natively with the driver stubbed: checks and order, screen sizes and rescale, the mode byte, the curve with its fraction, the 40-byte record. Host choices, after XatiX's title-tested version: each host event is one sample with unscaled counts, in its own queue, so
sceMouseRead's motion merging does not feed the curve. A read takes all pending samples; pastnum, same-button neighbours share a record, each still moving the pointer, and the lastnumrecords are kept. Speed is taken as 4, the hand swap and flagged bit never apply, and a disconnected mouse stands in for a zero driver status -
sceMouseDebugGetDeviceId - validation order and the empty/live-slot split follow the retail 11.00 dump decode: not-initialized first, then null output, -1 written up front, a match on a port handle with an empty slot returns success leaving -1, a live slot writes the device id, and no match returns INVALID_HANDLE. A closed handle returns INVALID_HANDLE like the other mouse functions; whether the console treats the port handle as valid after
sceMouseCloseis not covered by the decode. The reported device id is a model constant for the single emulated device; the console's device-id assignment is not decoded.