feat(pad): implement scePadSetAngularVelocityDeadbandState #565

Merged
Phi1ow merged 2 commits from upstream-pr/565 into main 2026-10-04 23:49:03 +00:00
Phi1ow commented 2026-10-04 21:19:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T21:19:41Z.


What

scePadSetAngularVelocityDeadbandState was the last throwing stub in libScePad. It toggles a
dead-band filter on the controller's angular-velocity (gyro) readings. The reading path does not
apply that optional filter, so the call succeeds and does nothing, as it does in shadPS4.

Tested

Extends the existing guest_pad test with the enable and disable calls.

Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; ctest -R guest_pad passes.
On main the stub throws not implemented, so the test aborts without the change.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4737704612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/565). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T21:19:41Z. --- ### What `scePadSetAngularVelocityDeadbandState` was the last throwing stub in `libScePad`. It toggles a dead-band filter on the controller's angular-velocity (gyro) readings. The reading path does not apply that optional filter, so the call succeeds and does nothing, as it does in shadPS4. ### Tested Extends the existing `guest_pad` test with the enable and disable calls. Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; `ctest -R guest_pad` passes. On `main` the stub throws `not implemented`, so the test aborts without the change. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-04 22:38:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T22:38:19Z.


Thanks. The NID recomputes (r44mAxdSG+U is scePadSetAngularVelocityDeadbandState). Two things before it can go in:

  1. Every neighbouring setter (scePadSetMotionSensorState, scePadSetTiltCorrectionState, scePadResetOrientation) returns PAD_ERROR_INVALID_HANDLE for a handle other than PAD_HANDLE. This one now returns 0 for any handle. Could it check the handle the same way, with a test row for a bad handle?
  2. Main reports real gyro readings (PadState.cpp fills angular_velocity_x/y/z from the controller), so a title that turns the dead band on gets readings the console would have filtered. That changes input, not UI, so CONTRIBUTING's silent-stub exception doesn't cover it. If the dead band threshold is known (a source would help), applying it in ReadState like SetTiltCorrection would make this exact. Otherwise I'd accept enable == false and keep throwing for true, so a title that relies on the filter still shows up.

PPSA21564 doesn't import this function, so it doesn't affect my runs either way.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985221524 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/565#issuecomment-5985221524). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T22:38:19Z. --- Thanks. The NID recomputes (r44mAxdSG+U is scePadSetAngularVelocityDeadbandState). Two things before it can go in: 1. Every neighbouring setter (`scePadSetMotionSensorState`, `scePadSetTiltCorrectionState`, `scePadResetOrientation`) returns `PAD_ERROR_INVALID_HANDLE` for a handle other than `PAD_HANDLE`. This one now returns 0 for any handle. Could it check the handle the same way, with a test row for a bad handle? 2. Main reports real gyro readings (`PadState.cpp` fills `angular_velocity_x/y/z` from the controller), so a title that turns the dead band on gets readings the console would have filtered. That changes input, not UI, so CONTRIBUTING's silent-stub exception doesn't cover it. If the dead band threshold is known (a source would help), applying it in `ReadState` like `SetTiltCorrection` would make this exact. Otherwise I'd accept `enable == false` and keep throwing for `true`, so a title that relies on the filter still shows up. PPSA21564 doesn't import this function, so it doesn't affect my runs either way.
Phi1ow commented 2026-10-04 22:49:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T22:49:34Z.


Done. It now returns PAD_ERROR_INVALID_HANDLE for a handle other than PAD_HANDLE, like the neighbouring setters, and keeps throwing when the dead band is enabled, since the reading path doesn't apply the filter (that would change input, not UI); enable == false succeeds, matching the unfiltered readings. Added a bad-handle row to the test. Thanks for the input-vs-UI distinction.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985304847 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/565#issuecomment-5985304847). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T22:49:34Z. --- Done. It now returns `PAD_ERROR_INVALID_HANDLE` for a handle other than `PAD_HANDLE`, like the neighbouring setters, and keeps throwing when the dead band is enabled, since the reading path doesn't apply the filter (that would change input, not UI); `enable == false` succeeds, matching the unfiltered readings. Added a bad-handle row to the test. Thanks for the input-vs-UI distinction.
oneandonlydean commented 2026-10-04 23:43:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:56Z.


Thanks, the handle check now matches the neighbouring setters, and enable == false succeeds while true still throws, so a title that needs the filter shows up. The bad-handle row covers the new error. guest_pad passes here and CI is green. Ready to merge from my side.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985702046 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/565#issuecomment-5985702046). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T23:43:56Z. --- Thanks, the handle check now matches the neighbouring setters, and `enable == false` succeeds while `true` still throws, so a title that needs the filter shows up. The bad-handle row covers the new error. `guest_pad` passes here and CI is green. Ready to merge from my side.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!565
No description provided.