mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
23 lines
4.8 KiB
Markdown
23 lines
4.8 KiB
Markdown
# libSceMouse technical debt
|
|
|
|
### Unknown function info
|
|
|
|
- [sceMouseGetDeviceInfo, sceMouseSetHandType, sceMouseSetPointerSpeed and the extension calls](../../../core/libs/prx/libSceMouse/Export.cpp) (libSceMouse) - argument lists and checks follow @BunnyFl's [firmware 13.42 disassembly](https://github.com/boykopovar/AnyPS5/issues/15088#issuecomment-6580877653) of `libSceMouse.sprx` (SHA-256 `e07cd04766ea48f5216e40fd4397758f640a7200cfa7edb6a00255326bd33c61`), not a console. Past their checks they throw:
|
|
- `GetDeviceInfo(int32, void*)`, `SetHandType(handle, uint32)`, `SetPointerSpeed(handle, uint32)`, `ExtensionSetCursor(handle, int32)` and `ExtensionGetCursor(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)` and `ExtensionReadState(handle, void*, uint32 size)` run `sceMouseRead`'s checks with the extension flag, after their size checks (0x30 and 0x40) and `ReadState`'s 64-byte clear; the 0x30-byte extension record and the state the slot keeps at +0x100 are unknown.
|
|
|
|
- [sceMouseDisconnectAll, sceMouseVirtualDeviceAddDevice, sceMouseVirtualDeviceDeleteDevice and sceMouseVirtualDeviceGetCursor](../../../core/libs/prx/libSceMouse/InventoryExports.cpp) - the names and NIDs are recorded in the [13.60 export inventory](https://github.com/xdCloudy/PS5-13.60-Function-Stub-Library/blob/e495d3cf24aea17cefda59decdfda9e3e4e3e5ff/data/firmware-13.60/libscemouse-acdd5b5e23.jsonl). Signatures and behavior remain unknown; the parameterless `int` declarations only resolve imports and every call throws. Not measured on a console.
|
|
|
|
- [sceMouseConnectPort, sceMouseDebugGetDeviceId, sceMouseDeviceOpen, sceMouseDisconnectDevice, sceMouseDisconnectPort, sceMouseMbusInit and sceMouseSetProcessPrivilege](../../../core/libs/prx/libSceMouse/Export.cpp) (libSceMouse) - names and NIDs are present in the [PS5 3.20 export inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceMouse.c); the no-argument prototypes follow [shadPS4's PS4 stubs](https://github.com/shadps4-emu/shadPS4/blob/f68923fe807f657348e6719ce658bcbd0a2b1c72/src/core/libraries/mouse/mouse.cpp#L34-L146), 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](../../../core/libs/prx/libSceMouse/src/mouse_impl.cpp) (libSceMouse) - follow the same [13.42 disassembly](https://github.com/boykopovar/AnyPS5/issues/15088#issuecomment-6580877653), 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](https://github.com/boykopovar/AnyPS5/pull/15106#pullrequestreview-5739861373)).
|
|
|
|
- [Publish](../../../core/libs/prx/libSceMouse/src/mouse_impl.cpp) (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](../../../core/libs/prx/libSceMouse/src/mouse_impl.cpp) (libSceMouse) - follow firmware 13.42 [run natively](https://github.com/boykopovar/AnyPS5/issues/11477#issuecomment-6502712241) 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](https://github.com/boykopovar/AnyPS5/issues/11477#issuecomment-6503782633): 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
|