fix(pad): accept vibration mode 5 #5523

Merged
milescoviello merged 1 commit from upstream-pr/5523 into main 2026-10-14 22:28:37 +00:00
milescoviello commented 2026-10-13 22:22:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-13T22:22:40Z.


What

Crimson Desert (PPSA25286) calls scePadSetVibrationMode(handle, 5) on its open pad handle at start-up. main rejects any mode above 3, so the call returns SCE_PAD_ERROR_INVALID_ARG (0x80920001). The title carries on with the call failed.

The modes are not documented:

  • SharpProspero names only 1 (Advanced) and 2 (Compatible).
  • Mode 3 was accepted for PPSA21480 (1e3a9345f), which passes it right after scePadOpen.
  • #5264's console measurements show that modes 1 to 5 pass the console's first argument check: on an invalid handle they get INVALID_HANDLE, not INVALID_ARG. Modes above 3 on an open handle could not be measured there.

The call now also accepts 5, the value a shipped title passes on an open handle. It keeps rejecting the values no title has been seen to use (4, 6 and above), and the mode is stored as before with no other effect. The libScePad debt entry now lists 5 next to 3 as accepted modes of unknown meaning.

guest_pad checks that mode 5 is accepted and that 4 and 6 are still refused.

Rebased onto #5264, which now checks the mode before the handle as the console does: the change is if (mode > 3 && mode != 5) after its mode <= 0 check, and the debt entry keeps #5264's console measurements and adds mode 5.

#5038 rewrites the neighbouring scePadOpen entry of the libScePad debt file, so whichever of the two lands second needs a one-line rebase there.

Tested

Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags. After the rebase onto main fa539dd9b, guest_pad again fails with main's Export.cpp and passes with the change, and tools/check_conventions.py --base upstream/main passes. Before it, on main bf8dc610e:

  • With main's Export.cpp and the new checks, guest_pad fails; with the change it passes 20/20.
  • All 344 guest_* tests pass in two runs.
  • Crimson Desert (PPSA25286), relinked with --to-intel and run on Linux under gdb, logging every libScePad, libSceSaveData, libSceUserService and other service call that returns an error code:
    • With main's libScePad, scePadSetVibrationMode (handle 1, mode 5) returns 0x80920001.
    • With this change it returns 0, and it no longer appears among the failing calls.
  • tools/check_conventions.py --base upstream/main passes.

Not checked on a console.

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4850243530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5523). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-13T22:22:40Z. --- ### What Crimson Desert (PPSA25286) calls `scePadSetVibrationMode(handle, 5)` on its open pad handle at start-up. `main` rejects any mode above 3, so the call returns `SCE_PAD_ERROR_INVALID_ARG` (`0x80920001`). The title carries on with the call failed. The modes are not documented: - [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Pad/Pad.cs) names only 1 (`Advanced`) and 2 (`Compatible`). - Mode 3 was accepted for PPSA21480 (1e3a9345f), which passes it right after `scePadOpen`. - #5264's console measurements show that modes 1 to 5 pass the console's first argument check: on an invalid handle they get `INVALID_HANDLE`, not `INVALID_ARG`. Modes above 3 on an open handle could not be measured there. The call now also accepts 5, the value a shipped title passes on an open handle. It keeps rejecting the values no title has been seen to use (4, 6 and above), and the mode is stored as before with no other effect. The libScePad debt entry now lists 5 next to 3 as accepted modes of unknown meaning. `guest_pad` checks that mode 5 is accepted and that 4 and 6 are still refused. Rebased onto #5264, which now checks the mode before the handle as the console does: the change is `if (mode > 3 && mode != 5)` after its `mode <= 0` check, and the debt entry keeps #5264's console measurements and adds mode 5. #5038 rewrites the neighbouring `scePadOpen` entry of the libScePad debt file, so whichever of the two lands second needs a one-line rebase there. ### Tested Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags. After the rebase onto `main` fa539dd9b, `guest_pad` again fails with `main`'s `Export.cpp` and passes with the change, and `tools/check_conventions.py --base upstream/main` passes. Before it, on `main` bf8dc610e: - With `main`'s `Export.cpp` and the new checks, `guest_pad` fails; with the change it passes 20/20. - All 344 `guest_*` tests pass in two runs. - Crimson Desert (PPSA25286), relinked with `--to-intel` and run on Linux under gdb, logging every libScePad, libSceSaveData, libSceUserService and other service call that returns an error code: - With `main`'s libScePad, `scePadSetVibrationMode` (handle 1, mode 5) returns `0x80920001`. - With this change it returns 0, and it no longer appears among the failing calls. - `tools/check_conventions.py --base upstream/main` passes. Not checked on a console. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Unblocks: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-13 22:26:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T22:26:52Z.

Review: APPROVED


The change is narrowly scoped: mode 5 is accepted while 4, 6+, and negative values remain rejected, and the regression checks cover those boundaries. The PR also records the remaining uncertainty about mode semantics and the expected one-line rebase with #5264. The current CI checks pass, while platform/build jobs are skipped; I’m relying on the Linux test evidence documented in the PR, not claiming an independent local run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5510801755 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5523#pullrequestreview-5510801755). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T22:26:52Z. **Review:** APPROVED --- The change is narrowly scoped: mode 5 is accepted while 4, 6+, and negative values remain rejected, and the regression checks cover those boundaries. The PR also records the remaining uncertainty about mode semantics and the expected one-line rebase with #5264. The current CI checks pass, while platform/build jobs are skipped; I’m relying on the Linux test evidence documented in the PR, not claiming an independent local run.
adriadam10 commented 2026-10-14 21:39:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T21:39:29Z.


Checked the diff, guest_pad and the scoped ctest (34/34) on current main; guest_pad fails without the Export.cpp change and passes with it. Debt entry updated accurately; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179082325 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5523#issuecomment-6179082325). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T21:39:29Z. --- Checked the diff, `guest_pad` and the scoped ctest (34/34) on current main; `guest_pad` fails without the `Export.cpp` change and passes with it. Debt entry updated accurately; merging.
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!5523
No description provided.