Skip to content

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

Closed
Sunkiller-qc wants to merge 1 commit into
Marvisak:mainfrom
Sunkiller-qc:gameinput-trigger-rumble
Closed

Sunkiller-qc wants to merge 1 commit into
Marvisak:mainfrom
Sunkiller-qc:gameinput-trigger-rumble

Conversation

@Sunkiller-qc

Copy link
Copy Markdown

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.
@ZKD-YXQG

Copy link
Copy Markdown

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

@DaviTostes

DaviTostes commented Nov 24, 2026 •

Copy link
Copy Markdown

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 Build: make workspace tests run on Linux #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.

@lordon1a

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants