Commit Graph
75 Commits
Author SHA1 Message Date
Dean 85a4d7f8c8 Merge pull request #10754 from slugzero/fix/pad-get-controller-type
fix(libScePad): accept special handles in scePadGetControllerType
2026-10-26 02:32:31 +13:00
Dean c15c361163 Merge pull request #10361 from orezraey/fix/libscepad-open-checks-measured-ps5
fix(libScePad): answer scePadOpen's user, index and port checks as measured on a PS5
2026-10-25 12:44:15 +13:00
SlugZero bee2bee10b fix(libScePad): accept special handles in scePadGetControllerType
Accept valid special handles in scePadGetControllerType by using KnownHandle, reporting PAD_CONTROLLER_TYPE_UNKNOWN (0) for special handles with no physical controller behind them.
2026-10-24 23:53:12 +02:00
boykopovar 35cf8d56cd refactor(sdk): add canonical headers for core libraries 2026-10-24 23:17:37 +03:00
orezraeyandClaude Opus 5.5 199fd82e3d Merge main into fix/libscepad-open-checks-measured-ps5
Main limits the standard port to logged-in users, so scePadOpen now checks the port type alone first, then the user and index, and leaves the standard port's user lookup to PortForUser.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 15:30:45 -03:00
SlugZero 05c177d2d4 test(pad): exercise PadInput slot lifecycle and pin single connected pad count 2026-10-24 19:21:15 +02:00
SlugZero 6b7d6796ff fix(pad): preserve connected port state across initialization 2026-10-24 19:21:15 +02:00
SlugZero 58a1bcc5a3 feat(pad): support up to 4 controllers with dynamic user discovery
- Track up to 4 pad slots in libScePad with per-slot inputs, outputs, sensor fusion, and deadbands
- Support dynamic user login/logout events and multi-user registration in libSceUserService
- Map SDL controllers 0-3 to Players 1-4 in libSceVideoOut while preserving Player 1 keyboard and mouse composition
- Add test coverage for multi-controller pads and multi-user services
2026-10-24 19:21:15 +02:00
orezraeyandClaude Opus 5.5 7844bbb5e1 Merge main into fix/libscepad-open-checks-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 12:58:01 -03:00
Adrià 3fcb5e4d76 Merge pull request #9178 from norton62/fix/pad-remote-control-port
fix(libScePad): open the system remote control port as a disconnected device
2026-10-24 17:40:15 +02:00
Adrià c51dcca0de Merge pull request #8350 from adriaespii/feat/pad-get-controller-type
feat(libScePad): implement scePadGetControllerType
2026-10-24 13:52:35 +02:00
norton62andClaude Opus 5.5 ce3e22a325 fix(libScePad): open the system remote control port as a disconnected device
scePadOpen for the system user's remote control port (type 16) returned the
DualSense handle, so scePadReadState on the "remote" reported the controller's
buttons as connected. SDL's PS5 video driver maps that port's buttons to keys,
so every Cross also arrived as Return and every D-pad press as an arrow key.
In Raptor (PPSA94002) the Return overwrote the key typed on the on-screen
keyboard before the name field read it, and Circle closed the dialog instead
of the keyboard.

The port now opens its own handle that reads no buttons with connected false,
and closes independently of the DualSense handle. Unlike the special port
handles, it stays out of KnownHandle, so calls that act on the DualSense reject
it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 21:31:49 +01:00
orezraeyandClaude Opus 5.5 ddcc81887f fix(libScePad): check the user before throwing for port types 3 and 4
A payload process on a PS5 (firmware 13.60) gets 0x809b0001 for user -1 on types 3 and 4 and on index 1, so scePadOpen answers those before it throws for the unknown types.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 16:52:58 -03:00
Dean Galvin 19dd43f0d8 test(libScePad): drop the unimplemented-throw asserts added by #9995
The tests for scePadSetLotusEnableIrKey, scePadSetLotusDisableIrKey,
scePadVirtualDeviceDisableButtonRemapping and scePadVirtualDeviceGetRemoteSetting
only checked that an unimplemented call throws. A test of that kind fails as
soon as someone implements the function, so it pins the absence of a feature
rather than behaviour. Tests should cover real behaviour and argument
validation.

This removes those asserts, the Throws helper and the declarations they were the
only users of. The rest of the pad test is unchanged.
2026-10-24 08:03:40 +13:00
orezraeyandClaude Opus 5.5 2d33e51c45 fix(libScePad): answer scePadOpen's user, index and port checks as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:58:45 -03:00
Dean da6ace485f Merge pull request #9995 from StoneDC/feat/pad-irkey-and-virtual-device
test(libScePad): check unsupported Lotus IR and virtual-device exports throw
2026-10-24 07:32:09 +13:00
JJenkx 8ce4ed4e77 fix(pad): timestamp scripted overlays in queued samples 2026-10-23 12:31:17 -04:00
StoneDC 0ae3cbcafb fix(libScePad): retain explicit throw for unsupported Lotus IR and virtual-device exports 2026-10-23 23:39:10 +08:00
Dean 8abd9bfb18 Merge pull request #9878 from ntamas94/fix/pad-special-port-handle
fix(libScePad): open the special port with a handle that reads as disconnected
2026-10-24 01:14:23 +13:00
StoneDC 7d8bbff86d feat(libScePad): implement Lotus IR key toggles and virtual-device settings
scePadSetLotusEnableIrKey and scePadSetLotusDisableIrKey validate
the pad handle, returning PAD_ERROR_INVALID_HANDLE (0x80920002) for any
invalid handle and 0 on open pads as silent stubs.

scePadVirtualDeviceDisableButtonRemapping acts as a silent stub returning
0. scePadVirtualDeviceGetRemoteSetting recovers the 64-byte remote setting
layout, rejecting null buffers and non-positive device IDs with
PAD_ERROR_INVALID_ARG (0x80920001) and returning
PAD_ERROR_DEVICE_NOT_CONNECTED (0x80920007).
2026-10-23 11:13:47 +08:00
Dean 11cf1c87f5 Merge pull request #9664 from krishalivaibhav/feat/pad-tracker-device-queries
feat(libScePad): answer the tracker DualShock 4, Blaster and Move queries
2026-10-23 13:01:07 +13:00
ntamas94andClaude Fable 5.1 7678df544f fix(libScePad): answer a 17th special-port user with the unknown-user code
The special port table had four slots and threw for a fifth user, which
the progress report counted as scePadOpen going back to a stub. A PS4
holds at most 16 accounts, so the table now has 16 slots and a 17th
distinct user id gets 0x809b0081, the code the console returned for an
unknown user id in the libScePad survey (PS4 Pro, firmware 10.71).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 22:45:14 +02:00
ntamas94andClaude Fable 5.1 7be1132713 fix(libScePad): make the special port handle behave as the PS4 measured
The ps4probe libScePad survey (PS4 Pro, firmware 10.71) measured the
special port with one user: a second scePadOpen returns ALREADY_OPENED
(0x80920004); scePadRead and scePadReadState give the rest record
(sticks 0x80, orientation w 1, acceleration y 1, connected 0);
scePadGetControllerInformation is zeroed;
scePadDeviceClassGetExtendedInformation reports device class -1; and
scePadSetVibration, scePadSetLightBar, scePadResetLightBar,
scePadSetMotionSensorState and scePadResetOrientation return 0.

The special handle is now accepted by every pad call: setters succeed
without touching the emulated pad, getters return the measured records.
Calls not covered by the survey follow the same rule and the debt entry
lists them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 22:41:36 +02:00
ntamas94andClaude Fable 5.1 76b318a75c fix(libScePad): keep special port state per user
A single flag and one handle served every user's special port, so a
second user's scePadClose dropped the first user's handle from
scePadGetHandle. Each user now gets a handle of its own
(PAD_SPECIAL_HANDLE + slot, four slots), a repeated open returns it
again, and close frees only that slot. Whether the console shares or
separates the handles is not measured yet; the debt entry says so.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 22:30:59 +02:00
ntamas94andClaude Fable 5.1 f8233a2738 fix(libScePad): open the special port with a handle that reads as disconnected
scePadOpen returned DEVICE_NOT_CONNECTED (0x80920007) for a special port
(type 2) since #3838, which guessed the console behaviour. A PS4 Pro on
firmware 10.71 with no special controller connected opens the special
port of any valid user and returns a handle: scePadRead on it returns one
record with connected false, scePadGetControllerInformation succeeds, and
scePadRead(-1) is INVALID_HANDLE.

Unity's PS4 input module opens the standard and the special port of a
user and keeps the pad handle only if both opens succeed; otherwise it
calls scePadRead with handle -1 every frame and the title never sees a
button. Knowledge is Power (CUSA09558) and Knowledge is Power: Decades
(CUSA12435) had no controller input for that reason.

The special port now opens PAD_SPECIAL_HANDLE, tracked apart from the
standard handle by scePadClose and scePadGetHandle. scePadRead and
scePadReadState on it return a zeroed record, scePadGetControllerInformation
and scePadDeviceClassParseData zeroed structures, and the other pad calls
reject it with INVALID_HANDLE. The standard handle still reads its own
queue, so the double read of one queue that #3838 fixed does not return.
scePadOpenExt is unchanged. The unmeasured parts are recorded in
docs/dev/debt/libScePad.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 22:11:04 +02:00
Adria Espi 63a2666558 feat(libScePad): implement scePadGetControllerType 2026-10-22 12:05:17 +02:00
krishalivaibhavandClaude Opus 5.5 81ae747acd feat(libScePad): answer the tracker DualShock 4, Blaster and Move queries
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 12:38:04 +05:30
frankea 41d551eb60 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/prx/libSceSystemService/Export.cpp
2026-10-21 17:37:31 -04:00
al3w0f205 3961826a2b test(libScePad): verify scePadSetLightBar, scePadResetLightBar and motion sensor validation 2026-10-20 19:22:24 -05:00
frankea 39e467915e Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/prx/libScePad/Export.cpp
#	core/libs/prx/libScePad/src/PadState.cpp
#	core/libs/prx/libSceVideoOut/src/PadInput.cpp
#	core/libs/tests/GuestPad.cpp
2026-10-20 13:34:08 -04:00
Dean 3e7d1d297c Merge pull request #8138 from bl4nkTHEBUNKER/fix/pad-touchpad-resolution
fix(libScePad): report the DualSense touchpad resolution
2026-10-21 06:25:52 +13:00
frankea 73bc20e93d Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-20 09:21:31 -04:00
Adrià 01e5f8f199 Merge pull request #7552 from voidlakhan/fix/pad-invalid-argument-errors
fix(pad): return invalid argument error on null buffer in scePadRead and scePadReadState
2026-10-20 12:31:46 +02:00
Adam Franke 9a027c0c0d Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/shader.md
2026-10-20 00:03:49 -04:00
bl4nkTHEBUNKER f57b79ef51 fix(libScePad): report the DualSense touchpad resolution
The controller information reported 1920 by 943, the DualShock 4 height with
the DualSense pixel density, while the host controller's fingers were scaled to
1920 by 942 and the keyboard touch contacts sat on the 942 centre line. A title
that maps touch coordinates through the reported resolution lost the lower part
of the touchpad. The width and height now live beside the pad state and all
three places use them.
2026-10-20 01:52:50 +02:00
Dean 5606dd7644 Merge pull request #7059 from Aryansh1520/fix/pad-tap-between-reads
fix(pad): report a press that ends before the next pad read
2026-10-20 09:52:24 +13:00
Adam Franke fc46dd36c7 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/tests/GuestPad.cpp
2026-10-19 12:32:58 -04:00
Dean dbac9fa15b Merge pull request #7909 from parl0v/feat/pad-accessibility-controller-state
feat(libScePad): implement scePadGetAccessibilityControllerState (zBsgF0q8DIM)
2026-10-20 05:24:48 +13:00
Adam Franke ca44747c27 fix(libScePad): report the DualSense touch pad and stick dead zones a PS5 reports
Inside Gran Turismo 7 on a PS5 (firmware 13.40) scePadGetControllerInformation for the DualSense reported touch pad resolution 1920 x 1080 and stick dead zones 13 and 13; pixel density 44.86 already matched.

Touch y coordinates now span that height: a host touch pad scales y to 0..1079 and the view-button and injected touches sit at y 540 instead of 0..942 and 471.
2026-10-19 12:20:36 -04:00
Josip Parlov acd1e0ef8f feat(libScePad): implement scePadGetAccessibilityControllerState (zBsgF0q8DIM)
The name hashes to zBsgF0q8DIM. Signature and error order follow the
OS 10.01 system module: NOT_INITIALIZED, INVALID_ARG for a NULL output,
INVALID_HANDLE for a bad handle. The emulated pad is not an Access
controller and reports 0.
2026-10-19 15:06:28 +02:00
Josip Parlov d68d797c76 fix(libScePad): return 0 from n3kSX62fgNo after scePadInit, with a pad open or not
The OS 10.01 system module checks only that the library is initialised,
then sends a per-process value to ShellCore over Mbus and returns 0 when
that call succeeds. It does not look at pad handles, so the throw while a
pad is open is gone. 0x809200ff, measured in a process that is not a game,
is the failed Mbus call; a game process is assumed to get 0.
2026-10-19 15:06:08 +02:00
lakhantheboss 23aa711e7f fix(pad): return invalid argument error on null buffer in scePadRead and scePadReadState
scePadRead_nid_postfix and scePadReadState threw APS5_INVALID_ARG_EX (std::invalid_argument) when passed a null output buffer or a non-positive buffer count, terminating the guest process across the PRX ABI boundary.

Both functions now return PAD_ERROR_INVALID_ARG (-2137915391) on invalid arguments, matching the error return contract of all sibling libScePad APIs.
2026-10-18 18:45:15 +05:30
Romans Pokrovskis a2d6c16bcd fix(audio): route legacy vibration PCM with per-port timing 2026-10-18 10:07:29 +03:00
Aryan SharmaandClaude Haiku 5.5 f3e05559d6 fix(pad): expire an older latched press when a newer one arrives
A new press refreshed the latch timestamp for every press still latched, so an
older press could survive a later one. Drop the latch first when it has expired,
and add guest tests for the cleared, expired and newer-press cases.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-17 20:34:52 +05:30
XairRrR a9377e34ba feat(pad): touch the left or right touchpad half from the input command file
APS5_PAD_INPUT_FILE commands can set bit 0x200000 or 0x400000 to put a
finger on the left or right half of the touchpad, as the TouchLeft and
TouchRight keys do, so scripted runs can press touchpad combinations.
tools/pad_input.py queues them as touch-left and touch-right.

AI-assisted: yes
2026-10-17 13:27:54 +02:00
Aryan Sharma 5786a96283 fix(pad): report a press that ends before the next pad read
scePadReadState only returned the latest input, so a tap that began and ended between two reads was never reported. Latch the pressed buttons when input is published and fold them into the next ReadState.
2026-10-17 16:08:10 +05:30
Dean 9070237dfd Merge pull request #5676 from MarcZX100/codex/pad-n3ksx62fgno-status
fix(libScePad): return measured status for unknown Pad NID
2026-10-17 13:05:42 +13:00
Adrià 7b63ccbc93 Merge pull request #5970 from Ondra97/codex/fix-pad-command-unicode-path
fix(pad): read controller commands from Unicode paths
2026-10-17 00:15:35 +02:00
MarcZX100 4ae8caac9a fix(libScePad): refuse unknown NID calls with open controller 2026-10-16 20:40:53 +00:00
MarcZX100 b85f017e5e fix(libScePad): return measured status for unknown Pad export 2026-10-16 20:40:45 +00:00