Skip to content

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

Closed
mar10reyes wants to merge 1 commit into
Marvisak:mainfrom
mar10reyes:feat/trigger-rumble-source
Closed

mar10reyes wants to merge 1 commit into
Marvisak:mainfrom
mar10reyes:feat/trigger-rumble-source

Conversation

@mar10reyes

Copy link
Copy Markdown

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.

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@LAKSHYA-cmd-tech LAKSHYA-cmd-tech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

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 mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
…to the host source

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Marvisak

Copy link
Copy Markdown
Owner

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.

@Marvisak Marvisak closed this Nov 25, 2026
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
…elds

GPU: Reuse placed texture views across resource description padding
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