Repository navigation
feat(libScePad): answer the co-pilot and Move model controller queries - #15074
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
BunnyFl
left a comment
There was a problem hiding this comment.
The firmware contradicts one part of the new behaviour: the initialisation check.
Firmware 13.42's libScePad.sprx (sha256 57eab7054e10d95ba0028dbd4808f94eb34c7663333a2b7ca9f68dc90cf62c60), read from disassembly only, not measured on a console:
0x158e0 scePadIsCoPilot (rZiqk1bQwr4)
158f9: cmpl [0x24018], 0 ; je 1594d ; 1594d: eax = 0x80920005 (NOT_INITIALIZED)
1590b: call 0x1abf0 ; lock
15914: edi = [0x2401c] ; esi = 0xc0184853 ; [rbp-0x30] = {0x0a, handle}
1592c: call 0x1abd0 ; ioctl on the pad device
1593a: call 0x1ac10 ; unlock ; returns the ioctl result
- Before
scePadInit,scePadIsCoPilotreturns0x80920005, not 0. The new test assertsscePadIsCoPilot(handle) == 0for every handle before init, so it pins behaviour the console doesn't have.mainalready hasPad::IsInitialized()andPAD_ERROR_NOT_INITIALIZED, used the same way byscePadGetBluetoothAddressand others. Could both functions start withif (!Pad::IsInitialized()) return PAD_ERROR_NOT_INITIALIZED;, and could the test expect that before init? scePadIsMoveReproductionModel(0x11310) tests the same initialisation flag (0x24018) and has its own0x80920005path, at11586. I didn't trace the rest of that larger function, so I can't say more about its handle handling.- After init, the answer comes from the kernel (ioctl
0xc0184853, sub-command0x0a), so the module doesn't validate the handle itself. Answering 0 for every handle, including closed and invalid ones, is a host choice. Please say so in the debt entry, worded like thescePadIsDS4Connectedprecedent, rather than leaving the console's answers as only "not measured".
The debt-only entries for the other exports read fine. I haven't checked each of their recovered-register claims against the module.
libScePad/CMakeLists.txt: this branch's guest_pad_device_model_queries test block and main's controller_queries and audio_route blocks were added at the same place; keep all three.
Progress report (d1ae628 → 28d1bf8)📈 System libraries: 26.48% (+0.01%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
c384085 to
28d1bf8
Compare
|
Thank you for the disassembly — that pins exactly what could not be measured. Both The debt entry now records what you traced: the pre-init Nothing else changed: the same 7 Pad tests pass, conventions pass, and the entry is under 1000 characters again. The branch is rebased onto current main (d1ae628), replacing the merge commit. |
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Checked the init gate against BunnyFl's firmware 13.42 trace (0x80920005 before |
What
Answers the two unclaimed libScePad controller-model queries,
scePadIsCoPilotandscePadIsMoveReproductionModel. Per the firmware 13.42 disassembly from the review, both return0x80920005beforescePadInit, so both now check initialisation first with thescePadGetBluetoothAddressidiom. After init the console asks the kernel (ioctl0xc0184853, sub-command0x0a, handle passed through, no module-side handle validation); this host has one DualSense behind every handle and no co-pilot pairing or Move, so both answer false for every handle after init — a host choice, recorded in the debt entry in thescePadIsDS4Connectedwording.Adds 14 debt entries covering every other unclaimed pending export (idle counters, device-id queries, Mbus/port management, device-id opens, connection/BC/remote-play injection, feature report 2, button remapping, the Lotus IR family, the extended trigger effect, profile-edit and indicator family, Leonardo controller type, recording, the collaboration input manager): what is recovered, why no complete semantics source exists (each attributed only to what the cited reimplementations actually export), and why they keep throwing. No behaviour was invented.
Skipped as claimed by open PRs: the VR-controller/report batch (#5038), light-bar tracker (#8260), scePadOpen port probes (#10935), scePadSetConnection (#14840), LED setters (#12311), power/process setters (#12312), feature toggles (#12310), bond (#12308) and controller-update (#12309) families.
Tested
guest_pad_device_model_queriesasserts0x80920005beforescePadInitfor every handle and 0 after; it fails on main's stubs (scePadIsCoPilot not implemented) and against this branch's first revision (no init check). The libScePad ctest set (guest_pad,guest_pad_vibration_mode,guest_pad_controller_queries,guest_pad_audio_route,guest_pad_device_model_queries,pad_rumble_intensity,pad_identify) passes 7/7.python3 tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pylists libScePad: replace NotImplemented stubs and fix return-0 consistency #5038, feat(libScePad): set the light bar from scePadSetLightBarForTracker #8260, feat(pad): complete DualSense adaptive trigger support #10112, feat(libScePad): answer scePadBondUpdate exports as an unbonded host #12308-feat(libScePad): validate the power, process and user state setters #12312 (text overlap in Export.cpp/CMakeLists/debt); none implements these two functions.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository