Commit Graph
91 Commits
Author SHA1 Message Date
Dean 99327b0e3e Merge pull request #15105 from zaryabzip/feat/pad-firmware-checks
feat(libScePad): check the arguments of thirteen exports as firmware 13.42 does
2026-11-03 21:11:15 +13:00
Dean eecb6dee58 Merge pull request #10935 from mashingaan/fix/pad-open-unsupported-types
fix(libScePad): return an error for unsupported port probes
2026-11-03 08:45:10 +13:00
zaryabzip 6b856235a8 docs(libScePad): keep the firmware-checks debt entry under 1000 characters 2026-11-02 21:34:16 +05:00
zaryabzip b94b3fa322 fix(libScePad): check GetInfoByPortType's output before its port type
@BunnyFl's corrected reading of 0xe8a0: a null output is refused first,
then initialisation, then a type other than 0 or 2. The test no longer
pins ReadStateExt's handle-first order before init, which follows this
library's ReadState rather than the module; the debt entry says so.
2026-11-02 21:33:57 +05:00
zaryabzip 3b404f65e2 feat(libScePad): check the arguments of thirteen exports as firmware 13.42 does
From @BunnyFl's disassembly of the 13.42 libScePad.sprx (#15087):
GetDeviceInfo, GetCapability, GetVersionInfo, GetIdleCount,
GetControllerIdleCount, GetActiveTime, SetPS4BcVibrationMode,
GetInfoByPortType, GetExtensionUnitInfo, ReadHistory, OpenExt2,
ReadStateExt and GetDeviceId get their checks in order, and keep
throwing where the console asks the pad driver or reads state that isn't
modelled. ReadHistory's third argument is a byte size of 0x960, and
OpenExt2 takes (userId, 0x10, param).
2026-11-02 21:14:22 +05:00
Dean Galvin ae1fef53ba Merge commit 'd5ec8e6575be37f4340ded9c64c51b1d07076b51' into HEAD
# Conflicts:
#	core/libs/prx/libScePad/CMakeLists.txt
#	core/libs/prx/libScePad/Export.cpp
2026-11-01 23:40:57 +13:00
mashingaan 895e0341d9 docs(pad): record measured VR port behavior 2026-11-01 10:29:24 +03:00
Adrià c763ea56aa Merge pull request #13817 from rooklz/feat/pad-vr-controller-read
docs(libScePad): record scePadVrControllerRead as unimplemented
2026-11-01 02:18:01 +01:00
rooklz c13fd36b82 docs(libScePad): record scePadVrControllerRead as unimplemented 2026-10-31 20:26:42 +01:00
MarcZX10 68a4689e62 Merge remote-tracking branch 'upstream/main' into fix/pad-port0-connected-state 2026-10-30 23:46:32 +00:00
Adrià 7ce71a9bb7 Merge pull request #13227 from kyon-eth/feat/pad-320-exports
feat(libScePad): declare 13 callable exports
2026-10-30 23:57:55 +01:00
BunnyFlandClaude Opus 5.5 708cf647d1 test(libScePad): check the five queries before scePadInit
Firmware 13.42 checks the initialized flag first in all five and
returns 0x80920005 without writing the outputs. The debt entry now
says where the behaviour comes from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:57:01 +01:00
BunnyFlandClaude Opus 5.5 2f9581050c feat(libScePad): answer the motion, Bluetooth and Leonardo queries
scePadGetMotionTimerUnit, scePadGetMotionSensorPosition,
scePadGetSphereRadius, scePadGetBluetoothAddress and
scePadParseUniqueDataLeonardo follow firmware 13.42's handle and
device checks for the one DualSense this library reports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 16:48:37 +01:00
MarcZX10 ae8eadb71a docs(debt): record the withdrawn port 0 read as unmeasured
Names the zeroed read of a withdrawn port 0 under the controller mode, its
source (shadPS4 at a pinned commit), and what the console returns for a
removed controller, which is not measured.
2026-10-30 14:03:34 +00:00
MarcZX10 16a364a9da docs(debt): note that port 0 reports its connection state in controller mode
scePadGetControllerInformation answers connected = true on every port in the
default mode; under ANYPS5_PAD_PORT0_STATE=controller port 0 answers its
connection state. The console's answer is not measured in either case.
2026-10-30 14:03:34 +00:00
Kyon ec897f7ff4 feat(libScePad): declare 13 callable exports 2026-10-30 07:10:16 +00:00
Dean 95b85a84e2 Merge pull request #11942 from milescoviello/docs/pad-open-port-types
docs(libScePad): note the port types ten titles pass to scePadOpen
2026-10-30 02:33:45 +13:00
Dean 651e248bef Merge pull request #11845 from Ralizaki/feat/libScePad-controller-settings
feat(libScePad): implement vibration and light bar brightness controls
2026-10-29 05:05:32 +13:00
MarcZX10 37dbf3df93 feat(libScePad): implement controller audio path and volume gain
Add scePadIsSupportedAudioFunction, scePadSetAudioOutPath and
scePadSetVolumeGain. The path and the speaker, headset and microphone
gain are kept per port in the pad output state, where a host backend
can fetch them, and a repeated identical value does not bump the output
sequence.

A path above 4 is rejected with INVALID_ARG, a null gain with
INVALID_ARG, an unknown handle with INVALID_HANDLE, and everything
returns NOT_INITIALIZED before scePadInit. Special handles accept the
setters without effect. Signatures and path values follow duaLib; no
host backend routes controller audio yet, which the technical debt file
records.
2026-10-28 06:35:51 +00:00
MarcZX10 67203dbe79 feat(libScePad): implement controller bus, jack, update and container queries
Add scePadGetParticularMode, scePadGetControllerBusType,
scePadGetJackState, scePadIsControllerUpdateRequired and
scePadGetContainerIdInformation, and make scePadSetParticularMode keep
its argument for the getter.

Each call returns NOT_INITIALIZED before scePadInit, INVALID_ARG for a
null output pointer, INVALID_HANDLE for an unknown handle and
DEVICE_NOT_CONNECTED when no device is behind the handle (a special
handle or a disconnected port). The emulated DualSense reports a
Bluetooth bus, no headset or microphone, no required update and an
empty container id. Signatures follow duaLib; the console's answers are
recorded as unmeasured in the technical debt file.
2026-10-28 04:24:15 +00:00
milescovielloandClaude Opus 5.5 2af6249c59 docs(libScePad): note the port types ten titles pass to scePadOpen
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 13:16:55 +00:00
AnyPS5 Contributor 7fd424e51b feat(libScePad): implement vibration and light bar brightness controls 2026-10-27 11:04:10 +01:00
Dean 79c6c4222d Merge pull request #10880 from EagleBearerYS/feat/scepad-light-bar-and-handle-calls
feat(libScePad): implement scePadIsValidHandle, the light-bar resets and scePadSetVibrationForce
2026-10-27 21:14:55 +13:00
Adrià 1b2af92baf Merge pull request #11187 from p3n1cillin/claude/pad-ext-info-not-permitted
fix(libScePad): refuse scePadGetExtControllerInformation on a standard pad as the console does
2026-10-27 09:03:28 +01:00
Adrià f89559b472 Merge pull request #10119 from xXPBSXx/docs/debt-pad-deadbandstate-title
docs(debt): note how a title calls scePadSetAngularVelocityDeadbandState
2026-10-26 15:19:42 +01:00
Yunus Shaikh a5128c9be7 fix(libScePad): follow the module's light bar resets, handle checks and forced vibration
BunnyFl ran firmware 13.42's libScePad natively over a slot table he
wrote, and oneandonlydean asked for the four calls to follow it.

scePadIsValidHandle matches the handle's open port type against the
argument, and answers false before scePadInit.
scePadResetLightBarAllByPortType returns INVALID_ARG for any type but 0,
1 and 2 before the initialisation check, and otherwise resets each open
handle of that type as scePadResetLightBar resets it;
scePadResetLightBarAll is type 0. So a standard port with no open handle
keeps its light bar, and types 3, 4 and 16 no longer throw.

scePadSetVibrationForce returns NOT_INITIALIZED before scePadInit, then
INVALID_ARG for a null parameter, without looking the handle up. There
is no pad driver here: a special handle returns PAD_OK and a standard
handle sets its port's motors, open or not. A handle with no pad port
throws, as the driver's answer for it is not measured.

The tests drop the closed and unknown handle checks that no longer hold
and check the measured answers; the debt entries cite the run and say
which parts are this model's.
2026-10-26 05:46:40 -07:00
p3nicillinandClaude Opus 5.5 08e595fc15 docs(libScePad): keep the buffer side effect of the refusal unmeasured
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 21:43:09 +00:00
p3nicillinandClaude Opus 5.5 28544a4f7d docs(libScePad): use plain links in the extended information entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 21:41:19 +00:00
p3nicillinandClaude Opus 5.5 3436e8fe7e fix(libScePad): refuse scePadGetExtControllerInformation on a standard pad
On a standard-port handle the console answers NOT_PERMITTED (0x80920101):
Halo CE Universal's pad probe measured it on firmware 13.59 for two
connected DualSenses in three runs. The function returned 0 with
invented controller information instead. The special port keeps its
zeroed answer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 21:04:17 +00:00
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
Yunus Shaikh 63ef18b435 feat(libScePad): implement scePadSetVibrationForce as scePadSetVibration
scePadSetVibrationForce takes the same handle and vibration parameter as
scePadSetVibration and returns its result. No system vibration-off state
exists here for it to override: scePadSetVibrationMode only stores its
mode.
2026-10-25 02:53:52 +00:00
Yunus Shaikh 3921b0bd5f feat(libScePad): reset every light bar in scePadResetLightBarAll
scePadResetLightBarAll returns each standard port's light bar to its
default, as scePadResetLightBar does for one handle.
scePadResetLightBarAllByPortType does the same for the standard port
type and nothing for the special one. It throws for types 3, 4 and 16,
and rejects other types with INVALID_ARG, as scePadOpen does.
2026-10-25 02:53:18 +00:00
Yunus Shaikh 2e4ce13282 feat(libScePad): implement scePadIsValidHandle
A handle is valid for its own port type while the handle table that
scePadGetHandle reads holds it open: a standard port that is open, a
special slot that is in use, or the open remote port. Any other port
type answers false.
2026-10-25 02:52:39 +00: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
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
xXPBSXxandClaude Sonnet 5.5 a631659db4 docs(debt): note how a title calls scePadSetAngularVelocityDeadbandState
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 19:58:47 +02:00
SlugZero d950147cdc docs(debt): record unverified values in libSceUserService and libScePad 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
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 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
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 fa5b090230 docs(debt): keep the special port entry under the length limit
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-23 00:26:50 +02:00
ntamas94andClaude Fable 5.1 83debaa12f docs(debt): record the two-user special port measurement
With two users logged in on a PS4 Pro (firmware 10.71) each user's
special port handle, ALREADY_OPENED on its second open and close are
independent of the other user's, as the branch already models.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-23 00:26:06 +02: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