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

Closed
Sunkiller-qc wants to merge 1 commit from upstream-pr/26 into main
Sunkiller-qc commented 2026-11-23 23:19:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Sunkiller-qc on 2026-11-23T23:19:41Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6570878532 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/26). Originally posted by [Sunkiller-qc](https://github.com/Sunkiller-qc) on 2026-11-23T23:19:41Z. --- 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.
ZKD-YXQG commented 2026-11-24 06:54:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ZKD-YXQG on 2026-11-23T23:31:52Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117068272 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/26#issuecomment-7117068272). Originally posted by [ZKD-YXQG](https://github.com/ZKD-YXQG) on 2026-11-23T23:31:52Z. --- 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).
lordon1a commented 2026-11-24 06:54:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:21:01Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117975529 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/26#issuecomment-7117975529). Originally posted by [lordon1a](https://github.com/lordon1a) on 2026-11-24T00:21:01Z. --- 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.
DaviTostes commented 2026-11-24 06:55:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:18:15Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7117925978 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/26#issuecomment-7117925978). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T00:18:15Z. --- 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.
upstream-sync closed this pull request 2026-11-24 09:04:54 +00:00

Pull request closed

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
Marvisak/VIctory!26
No description provided.