Input: pass the trigger motor levels on to the host #26

Closed
github-bot wants to merge 1 commit from gh-pr/26/head into gh-pr/26/base
Owner

@⁠Sunkiller-qc on GitHub · 2026-11-23 23:19 UTC · original
Sunkiller-qc:gameinput-trigger-rumble → main · +71 −16 · 1 files · 1 commits · closed without merging

Hi, thanks for the project!

GameInput's SetRumbleState (device slot 0x50) receives four levels: low frequency, high frequency, left trigger and right trigger. Until now only the first two reached the host Source. This changes Source::rumble to take all four as a small Motors struct, so a host backend that can drive impulse triggers (e.g. a future Windows.Gaming.Input path) gets them without touching the HLE side again. The XInput host still drops the trigger motors, since XInput has none, and the existing shortcut note now sits next to it. rumble_motors still advertises only the two grip motors, because the host can't drive the triggers yet.

Tests: the existing rumble test now checks the full Motors value, and a new trigger_rumble_reaches_the_host checks that trigger levels are clamped like the grip motors (out of range and NaN).

Note: this is a static change. I have not compiled it, run the tests or tried it on hardware, so please run CI / cargo test -p victory-hle. Happy to adjust anything.

**@⁠Sunkiller-qc** on GitHub · 2026-11-23 23:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/26) `Sunkiller-qc:gameinput-trigger-rumble` → `main` · +71 −16 · 1 files · 1 commits · closed without merging Hi, thanks for the project! GameInput's `SetRumbleState` (device slot 0x50) receives four levels: low frequency, high frequency, left trigger and right trigger. Until now only the first two reached the host `Source`. This changes `Source::rumble` to take all four as a small `Motors` struct, so a host backend that can drive impulse triggers (e.g. a future Windows.Gaming.Input path) gets them without touching the HLE side again. The XInput host still drops the trigger motors, since XInput has none, and the existing shortcut note now sits next to it. `rumble_motors` still advertises only the two grip motors, because the host can't drive the triggers yet. Tests: the existing rumble test now checks the full `Motors` value, and a new `trigger_rumble_reaches_the_host` checks that trigger levels are clamped like the grip motors (out of range and NaN). Note: this is a static change. I have not compiled it, run the tests or tried it on hardware, so please run CI / `cargo test -p victory-hle`. Happy to adjust anything.
GameInput's SetRumbleState (slot 0x50) takes four levels: low and high
frequency, left and right trigger. Only the first two reached the host.
Source::rumble now takes all four as Motors, so a host that can drive
the trigger motors gets them; the XInput host still drops them (it has
none), and the shortcut note moves next to it.

A new test checks the trigger levels reach the host, clamped like the
grip motors.

Not compiled or tested here; static change only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:47:03 +00:00
github-bot closed this pull request 2026-11-26 03:47:03 +00:00
Author
Owner

@⁠ZKD-YXQG on GitHub · 2026-11-23 23:31 UTC · original

I tested 886d15ba17bb745360253d1672de7cbeedad4d88 on Windows 11 25H2 (build 26200.9457) with Rust 1.98.1 (x86_64-pc-windows-msvc).

cargo test --locked -p victory-hle passed all 83 tests (82 unit tests and one integration test), including trigger_rumble_reaches_the_host and devices_are_found_by_id_and_rumble_reaches_the_host. The rumble tests used the fake host. Physical trigger vibration was outside the test scope.

AI-assisted testing and reporting (Codex).

**@⁠ZKD-YXQG** on GitHub · 2026-11-23 23:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/26#issuecomment-7117068272) I tested `886d15ba17bb745360253d1672de7cbeedad4d88` on Windows 11 25H2 (build 26200.9457) with Rust 1.98.1 (`x86_64-pc-windows-msvc`). `cargo test --locked -p victory-hle` passed all 83 tests (82 unit tests and one integration test), including `trigger_rumble_reaches_the_host` and `devices_are_found_by_id_and_rumble_reaches_the_host`. The rumble tests used the fake host. Physical trigger vibration was outside the test scope. AI-assisted testing and reporting (Codex).
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 00:21 UTC · original

Verified 886d15ba1 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@35b054ec0): pass.

  • cargo xtask policy: 150 files ok
  • cargo test -p victory-hle gameinput: 8 passed, 0 failed (including the trigger motor level tests).

AI-assisted.

**@⁠lordon1a** on GitHub · 2026-11-24 00:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/26#issuecomment-7117975529) Verified `886d15ba1` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@35b054ec0`): **pass**. - `cargo xtask policy`: 150 files ok - `cargo test -p victory-hle gameinput`: **8 passed, 0 failed** (including the trigger motor level tests). AI-assisted.
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:18 UTC · original · edited 2026-11-24 03:48 UTC

Tested 886d15b stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass.

  • cargo test --workspace: 156 passed, 0 failed, 3 ignored; merge with #39 clean.
  • Scope note: the trigger-motor path goes to the host controller backend (GameInput/controller device) and is not exercised on this machine; the GameInput shim tests and the rest of the workspace pass.
  • Review note: like the neighbouring branches, the diff against main also carries the 133-line victory-loader/src/threads.rs change — make sure it is intended here.
  • No game data used.
**@⁠DaviTostes** on GitHub · 2026-11-24 00:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/26#issuecomment-7117925978) · edited 2026-11-24 03:48 UTC Tested `886d15b` stacked on **#39** on **Arch Linux x86_64, rustc 1.98.1**: **pass**. - `cargo test --workspace`: **156 passed, 0 failed, 3 ignored**; merge with #39 clean. - Scope note: the trigger-motor path goes to the host controller backend (GameInput/controller device) and is not exercised on this machine; the GameInput shim tests and the rest of the workspace pass. - Review note: like the neighbouring branches, the diff against `main` also carries the 133-line `victory-loader/src/threads.rs` change — make sure it is intended here. - No game data used.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!26
No description provided.