fix(libScePad): check scePadSetVibrationMode's arguments in the console's order #5264
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5264"
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 hugodearaujo on 2026-10-13T16:00:15Z.
What
scePadSetVibrationModechecked the handle first and accepted modes 0 to 3, before or afterscePadInit. I called the console's export from a homebrew payload on a PS5 (firmware 13.60):mainscePadInit0x80920005INVALID_ARG(0x80920001)INVALID_HANDLEINVALID_HANDLE(0x80920003)INVALID_HANDLEINVALID_ARG(mode checked before the handle)So the console rejects a mode of 0 or below before it looks at the handle, and the call fails with NOT_INITIALIZED (
0x80920005, namedPAD_ERROR_NOT_INITIALIZEDhere) untilscePadInit. Modes above 3 on an open handle could not be measured, becausescePadOpendoes not open a pad in the payload (0x809b0001). They keep returningINVALID_ARGafter the handle check, and the TechnicalDebt entry says so.Evidence from titles is weak, and this PR is only for matching the console. Hollow Knight: Silksong (PPSA12544) calls
scePadSetVibrationModewith handle -1 and mode 1 three times, and Hades (PPSA03355) with its open handle and mode 1. Both already got the console's answer onmain. The calls that change here (mode 0 or below, or a call beforescePadInit) were not seen in a title. The change keeps the answers correct for a title that passes them.Overlap: #5038 rewrites the libScePad TechnicalDebt section, including the line before
scePadSetVibrationMode's entry, so the two conflict on that one line ofdocs/dev/debt/libScePad.md. Whichever lands second resolves it.Tested
guest_pad_vibration_modechecks every row; it aborts onmain.guest_padpasses unchanged.agc_driver_tessellationsegfaults the same way on currentmain.guest_padandguest_pad_vibration_modepass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T16:35:04Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libScePad/Export.cppL255docs/dev/debt/libScePad.mdL8Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-13T22:22:52Z.
A data point for the "modes above 3 on an open handle" case: Crimson Desert (PPSA25286) calls
scePadSetVibrationMode(1, 5)on its open handle at start-up. I traced it under gdb on Linux, and onmainit getsINVALID_ARG. I opened #5523, which accepts 5 next to 3, with that evidence. It changes the same line as this PR, so whichever of the two lands second gets a one-line rebase. On top of this PR it would beif (mode > 3 && mode != 5)after yourmode <= 0check.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T18:11:13Z.
Checked the diff against the table in the description, ran the build and the scoped ctest (34/34,
guest_pad_vibration_modepasses; it does not build without the change since it usesPAD_ERROR_NOT_INITIALIZED), and the TechnicalDebt entry replaces the old one. The console measurements are taken from the description. Merging once the full Build is green; #5523 will need its one-line rebase on top.