controller: forward guest vibration to SDL rumble #365
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!365
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/365/head"
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?
@MehmetCambaz on GitHub · 2026-08-28 22:24 UTC · original
MehmetCambaz:feat/controller-rumble→main· +27 −0 · 1 files · 1 commits · merged 2026-08-29 00:49 UTCSummary
scePadSetVibrationlogged the requested motor levels and then discarded them, so guest rumble never reached the pad. Forward both motors toSDL_GameControllerRumble.large_motordrives SDL's low frequency motor andsmall_motorthe high frequency one, scaled from the guest's 8 bit levels to SDL's 16 bit range (0xff->0xffff).0xffffms internally, so that maximum is requested and an explicit zero level stops the motors early instead.Test plan
Windows 11 25H2, clang-cl 20.1.8, RTX 2060, DualShock 4 v2 (CUH-ZCT2) over Bluetooth.
ctest: 31/31, three consecutive runs.SDL_GameController*rather than the virtual keyboard pad (checked with temporary logging, since removed).Not verified: rumble driven by real gameplay. The only title I have (Tetris Forever, PPSA25646) calls
scePadSetVibration(0, 0)once at startup and never again, so I could not exercise a game-driven effect. I confirmed the motors with a forced non-zero call through the same code path instead.An automated test did not seem practical here, since the behaviour only shows up as physical motor output on real hardware. Happy to add one if you have a preferred approach.
Only Windows and a DualShock 4 were tested. Adaptive triggers are untouched: that is DualSense-only hardware and
scePadSetTriggerEffectremains a stub.AI use
Developed with AI assistance (Claude). It located the stub, wrote the change, and ran the builds, tests and logging on my machine. I reviewed the diff, checked the motor scaling and that the SDL calls used here lock internally so they are safe from the guest thread, and ran the emulator with my own controller to confirm the rumble fires.