HLE input: pass trigger motor levels to the host source #620

Closed
mar10reyes wants to merge 1 commit from upstream-pr/620 into main
mar10reyes commented 2026-11-24 05:44:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mar10reyes on 2026-11-24T05:44:09Z.


set_rumble dropped the title's left/right trigger levels before they reached Source. Carry all four motors in a Motors struct; the XInput source still drives only the two grip motors (it has no trigger motors), so behaviour is unchanged, and a Windows.Gaming.Input source can now drive the triggers without touching the HLE side.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6575490568 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/620). Originally posted by [mar10reyes](https://github.com/mar10reyes) on 2026-11-24T05:44:09Z. --- set_rumble dropped the title's left/right trigger levels before they reached Source. Carry all four motors in a Motors struct; the XInput source still drives only the two grip motors (it has no trigger motors), so behaviour is unchanged, and a Windows.Gaming.Input source can now drive the triggers without touching the HLE side.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:00:36Z.

Review: APPROVED


Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).

  • cargo test -p victory-hle: all 87 tests passed cleanly, including motor_levels_are_clamped_and_kept_in_order.
  • cargo xtask policy: 151 files ok.
  • Verified trigger motor levels clamping and preservation in Motors::from_levels and pass-through in set_rumble.
<!-- greyfinch-sync:Marvisak/VIctory:review:6034419429 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/620#pullrequestreview-6034419429). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:00:36Z. **Review:** APPROVED --- Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc). - cargo test -p victory-hle: all 87 tests passed cleanly, including motor_levels_are_clamped_and_kept_in_order. - cargo xtask policy: 151 files ok. - Verified trigger motor levels clamping and preservation in Motors::from_levels and pass-through in set_rumble.
balazs63 commented 2026-11-24 09:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by balazs63 on 2026-11-24T08:44:38Z.


This pairs well with a host-side piece I wrote: a Windows.Gaming.Input path that actually drives the trigger motors.

Branch: https://github.com/balazs63/VIctory/tree/trigger-rumble (PR creation is limited to collaborators, so I can't open one).

  • Host::rumble uses Gamepad::SetVibration for all four motors (WGI ships with Windows, no redistributable).
  • WGI doesn't say which XInput slot a gamepad is in, so it's only used when exactly one XInput pad and one WGI gamepad are connected; otherwise it falls back to XInput (grip motors only), as today.
  • rumble_motors reports 0xF; windows becomes a regular Windows dependency of victory-hle (Gaming_Input), audio-capture features stay behind diagnostics.

It was written against main before this PR, so it uses [f32; 4] rather than your Motors struct; happy to rebase onto #620 if that lands. cargo test -p victory-hle gameinput passes and clippy is clean for the change. Not tested with the title or real trigger hardware (no dump here).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126507281 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/620#issuecomment-7126507281). Originally posted by [balazs63](https://github.com/balazs63) on 2026-11-24T08:44:38Z. --- This pairs well with a host-side piece I wrote: a Windows.Gaming.Input path that actually drives the trigger motors. Branch: https://github.com/balazs63/VIctory/tree/trigger-rumble (PR creation is limited to collaborators, so I can't open one). - `Host::rumble` uses `Gamepad::SetVibration` for all four motors (WGI ships with Windows, no redistributable). - WGI doesn't say which XInput slot a gamepad is in, so it's only used when exactly one XInput pad and one WGI gamepad are connected; otherwise it falls back to XInput (grip motors only), as today. - `rumble_motors` reports 0xF; `windows` becomes a regular Windows dependency of victory-hle (`Gaming_Input`), audio-capture features stay behind `diagnostics`. It was written against main before this PR, so it uses `[f32; 4]` rather than your `Motors` struct; happy to rebase onto #620 if that lands. `cargo test -p victory-hle gameinput` passes and clippy is clean for the change. Not tested with the title or real trigger hardware (no dump here).
mercuryVM commented 2026-11-24 12:04:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T11:20:36Z.

Review: APPROVED


Tested 59aa44b on Windows 11, RTX 5070, MSVC: cargo test -p victory-hle 88 passed, including motor_levels_are_clamped_and_kept_in_order. Clippy's 1 warning is the existing field_reassign_with_default at xmem.rs:747.

  • XInput behaviour is unchanged: wLeftMotorSpeed/wRightMotorSpeed still come from low/high, and the trigger levels now reach Source instead of being dropped at set_rumble. Moving the shortcut: note to the XInput source is the right place for it.
  • NaN maps to 0 through clamp and then as u16, as the test documents, so a bad level leaves the motor off.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6038283600 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/620#pullrequestreview-6038283600). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T11:20:36Z. **Review:** APPROVED --- Tested 59aa44b on Windows 11, RTX 5070, MSVC: `cargo test -p victory-hle` 88 passed, including `motor_levels_are_clamped_and_kept_in_order`. Clippy's 1 warning is the existing `field_reassign_with_default` at xmem.rs:747. - XInput behaviour is unchanged: `wLeftMotorSpeed`/`wRightMotorSpeed` still come from `low`/`high`, and the trigger levels now reach `Source` instead of being dropped at `set_rumble`. Moving the `shortcut:` note to the XInput source is the right place for it. - NaN maps to 0 through `clamp` and then `as u16`, as the test documents, so a bad level leaves the motor off. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:04:30 +00:00
Marvisak commented 2026-11-25 01:07:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:26:07Z.


Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

Plumbing only: four motor levels reach the host source in a new struct while XInput still drops the triggers, so behaviour is unchanged. A PR that really drives trigger motors (#312, #1357) carries its own plumbing.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148506417 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/620#issuecomment-7148506417). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:26:07Z. --- Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current). Plumbing only: four motor levels reach the host source in a new struct while XInput still drops the triggers, so behaviour is unchanged. A PR that really drives trigger motors (#312, #1357) carries its own plumbing. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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!620
No description provided.