feat(libScePad): implement scePadGetControllerType #8350
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8350"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-10-20T10:49:41Z.
What
Implement scePadGetControllerType returning PAD_DEVICE_TYPE_DUAL_SENSE for the emulated controller, following scePadGetInfo.
Tested
Windows 11, check_conventions.py passed, GuestPad test coverage added.
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 (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T02:25:54Z.
@adriaespii thanks. Two things before this can go in: (1) it conflicts with current main in core/libs/tests/GuestPad.cpp, so it needs a rebase. (2) Where does the value 3 come from? It's the scePadGetInfo deviceType constant, but scePadGetControllerType may use its own enum: duaLib's reimplementation of the API (src/include/duaLib.h, s_SceControllerType) has DUALSENSE = 2 there. Could you cite a source for 3 (a firmware read or a console run), or, if there isn't one, add an entry to docs/dev/debt/libScePad.md saying the value is unmeasured?
Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-10-21T06:28:25Z.
Rebased on current
mainand resolved the conflict incore/libs/tests/GuestPad.cpp.Regarding the value 3: it is unmeasured on a real console or firmware read; it was borrowed directly from
scePadGetInfo'sdeviceTypeconstant (PAD_DEVICE_TYPE_DUAL_SENSE = 3). I have expanded the entry indocs/dev/debt/libScePad.mdto state that the value is unmeasured on hardware and to note duaLib'ss_SceControllerTypedefinition whereDUALSENSE = 2.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T11:15:31Z.
Review: CHANGES_REQUESTED
Thanks for the rebase note and the debt entry. Remaining points:
core/libs/prx/libScePad/Export.cpp:483:*type = PAD_DEVICE_TYPE_DUAL_SENSE(3) borrows thescePadGetInfodeviceTypeconstant. The only reference for this API, duaLib, declaresscePadGetControllerType(int, s_SceControllerType*)with its own enum (UNKNOWN=0, DUALSHOCK_4=1, DUALSENSE=2,src/include/duaLib.h) and returns that enum (src/source/duaLib.cpp:872). With the only source saying 2 and nothing measured for 3, returning 3 is a plausible-but-unverified value. Either return 2 (a named constant for duaLib'sDUALSENSE, debt entry saying it is unmeasured on hardware) or keep throwing. Update the test inGuestPad.cppto pin that value.mainincore/libs/tests/GuestPad.cpp; please rebase again.PAD_ERROR_DEVICE_NOT_CONNECTEDfor an invalid pad and does not checktype == NULL. Please make the wording match what the code does.Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-10-22T07:12:13Z.
Updated:
PAD_CONTROLLER_TYPE_DUAL_SENSE(2) following duaLib'ss_SceControllerTypeenum and pinned the value inGuestPad.cpp.mainand resolved conflicts inGuestPad.cpp,Export.cpp, andlibScePad.md.docs/dev/debt/libScePad.mdto accurately reflect the return value, unmeasured hardware status, and our validation order vs duaLib.