Files
AnyPS5/docs/dev/debt/libSceMouse.md
T
Dean c47ee4e034 Merge pull request #12958 from zaryabzip/feat/mouse-absolute-position
feat(libSceMouse): implement the absolute position calls as firmware 13.42 does
2026-11-03 06:25:57 +13:00

4.8 KiB

libSceMouse technical debt

Unknown function info

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 handle sceMouseOpen gave that user and type, or 0x80df0008. The console skips slots whose +0xc8 field is 1 when index is 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) / 65535 up. 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; past num, same-button neighbours share a record, each still moving the pointer, and the last num records 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