input: DualSense and DualShock 4 support (HID input, adaptive triggers, light bar, haptics) #54

Manually merged
github merged 1 commit from github-bot/gh-54 into main 2026-12-05 20:02:32 +00:00 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-12-05 19:10 UTC · original
Kal0s-design:port/dualsense → main · +3390 −12 · 15 files · 2 commits · merged 2026-12-05 20:00 UTC

For #30. This brings over upstream ReVIctory's native DualSense and DualShock 4 support (b45d17f, author kept, with the module and HID authors it credits). Today only XInput pads reach the game, so a PlayStation pad does nothing without Steam Input or DS4Windows.

With it, pads XInput doesn't list are read over HID and fill the empty XInput slots, with rumble for Sony pads. VICTORY_DUALSENSE=1 (or -DualSense) also turns on the PS5 build's adaptive triggers, light bar, the R2 vehicle notch, the rumble curve and haptics through the pad's USB audio actuators, and VICTORY_DUALSHOCK=1 the light bar on a DualShock 4. Every hook checks the game's code before patching and stays off on a build it doesn't recognise, so with the switches off the only change is that an unlisted HID pad now works. The commit message has the Windows specifics (SetupAPI discovery, report sizes, the Bluetooth CRC position).

Porting notes. gameinput.rs had one overlapping hunk, where this takes upstream's split of the pad source into xinput() and hid(). The README hunks are left out because this fork's README is different. victory-loader gains a dependency on the workspace windows crate with a few audio and COM features for the haptics, no new crates. If #48 goes in first, crates/victory-loader/src/lib.rs will conflict in one spot, where both the new mod lines and the test lock should stay, which is how upstream has it.

Merged with current main and the test fixes from #48, victory-hle (267), victory-loader (126) and victory pass here, and clippy -D warnings reports nothing new. I have no PlayStation pad on this machine, so the pad behaviour itself is untested by me.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-12-05 19:10 UTC · [original](https://github.com/VGLALALA/ReVictory-RDNA3/pull/54) `Kal0s-design:port/dualsense` → `main` · +3390 −12 · 15 files · 2 commits · merged 2026-12-05 20:00 UTC For #30. This brings over upstream ReVIctory's native DualSense and DualShock 4 support (b45d17f, author kept, with the module and HID authors it credits). Today only XInput pads reach the game, so a PlayStation pad does nothing without Steam Input or DS4Windows. With it, pads XInput doesn't list are read over HID and fill the empty XInput slots, with rumble for Sony pads. VICTORY_DUALSENSE=1 (or -DualSense) also turns on the PS5 build's adaptive triggers, light bar, the R2 vehicle notch, the rumble curve and haptics through the pad's USB audio actuators, and VICTORY_DUALSHOCK=1 the light bar on a DualShock 4. Every hook checks the game's code before patching and stays off on a build it doesn't recognise, so with the switches off the only change is that an unlisted HID pad now works. The commit message has the Windows specifics (SetupAPI discovery, report sizes, the Bluetooth CRC position). Porting notes. gameinput.rs had one overlapping hunk, where this takes upstream's split of the pad source into xinput() and hid(). The README hunks are left out because this fork's README is different. victory-loader gains a dependency on the workspace windows crate with a few audio and COM features for the haptics, no new crates. If #48 goes in first, crates/victory-loader/src/lib.rs will conflict in one spot, where both the new mod lines and the test lock should stay, which is how upstream has it. Merged with current main and the test fixes from #48, victory-hle (267), victory-loader (126) and victory pass here, and clippy -D warnings reports nothing new. I have no PlayStation pad on this machine, so the pad behaviour itself is untested by me. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Only XInput pads reached the title: a DualSense or DualShock 4 did nothing
without Steam Input or DS4Windows, and the PS5 build's pad effects were lost.

Ported from VIctory xmem (Linux/Wine) at 0fd7614:
- Pads XInput does not list are read over HID and fill the empty XInput
  slots, with rumble for Sony pads (gameinput/hid.rs).
- VICTORY_DUALSENSE=1 / -DualSense: the PS5 build's adaptive triggers,
  light bar, R2 vehicle notch, rumble curve, and haptics on the pad's USB
  audio actuators. VICTORY_DUALSHOCK=1 / -DualShock: the light bar on a
  DualShock 4.

What Windows needed that Linux did not:
- The pad is found with SetupAPI/HidD_* and written with WriteFile, sized to
  the output report length the device declares (547 bytes for a Bluetooth
  DualSense). Bluetooth reports keep their CRC at byte 74, then padding.
- Bluetooth rumble put its CRC at the end of the declared length (byte 543)
  and was dropped by the pad; it now goes at 74 for both pads.
- A DualSense's light bar is released from its firmware once per connection
  (lightbar setup: light out), as Linux's hid-playstation does on connect.

Every hook checks the title's code before patching and stays off on a build
it does not recognise.

Loader modules by Sam Sepiol and goldfishdev; HID reader by delacor and
goldfishdev (from delacor/VIctory a9553ae72, marquezini); trigger encodings
after Nielk1's TriggerEffectGenerator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b45d17f0fec31aecc9ac68225728a7b283ccaf82)

Ported to ReVictory-RDNA3: gameinput.rs takes this commit's split of the
pad source into xinput() and hid(); the README hunks are left out, as this
fork's README differs from upstream's.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 19:10:50 +00:00
github-bot force-pushed github-bot/gh-54 from 8573ed024f to fa192614f9 2026-12-05 19:51:22 +00:00 Compare
github manually merged commit 2367746a07 into main 2026-12-05 20:02:32 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.