HLE: native 4-motor Xbox impulse trigger haptics via Windows.Gaming.Input with XInput fallback #1357
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1357"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T17:35:32Z.
Summary
GameInputRumbleParamsmotors (low_frequency,high_frequency,left_trigger,right_trigger) through a clamped finiteRumblestruct and reports0xFinDeviceInfo::rumble_motors.combase.dllWinRTWindows.Gaming.Input.Gamepad(IGamepadStatics::get_Gamepads+IGamepad::put_Vibration) with zero extra crate dependencies, falling back cleanly to 2-motorXInputSetStatewhen WinRT or a matching gamepad is unavailable.RumbleWorkerbackground thread (Hub::rumble_sink) soSetRumbleStatenever contends withXInputGetStatepolling or stalls the title's render/simulation thread.RumbleWorker, and live WinRT probing/teardown safety.Verification
cargo clippy --workspace --all-targets&-p victory --features diagnostics --all-targets— passed (0 new warnings)cargo test --workspace— passed (victory-hlegameinput: 10/10)cargo xtask policy— passed (151 files ok)Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T18:01:44Z.
Coordination: this overlaps #312 (open) and the older #26 / #1104, all of which change the same rumble plumbing.
Source::rumbleto[f32; 4]and adds an SDL3 source (SDL_RumbleGamepad + SDL_RumbleGamepadTriggers), for Linux/Wine pads.Rumblestruct and adds the WinRT four-motor path + worker + zeroing.git merge-treebetween #312 and this head conflicts ingameinput.rs. TheRumblestruct here looks like the better common signature; #312 could rebase onto it and keep only the SDL3 backend (its XInput path would then come from this PR). Worth picking one signature before more of these land.I can test this on AMD/Wine (RX 9060 XT, Wine 11.22 + vkd3d 3.2) if a build is useful — though WinRT may be unavailable under Wine, so the XInput fallback is what would be exercised.
upstream-sync referenced this pull request2026-11-25 01:07:56 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:24:05Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-hle/src/modules/gameinput.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-26T21:58:27Z.
This no longer merges onto current main (conflict in
crates/victory-hle/src/modules/gameinput.rs). #1958 and #2095 do the same and merge cleanly; comparison on #1958.AI-assisted (Claude).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T22:29:02Z.
Review: CHANGES_REQUESTED
Checked
cdec26e9:main(63bcca43) hits 4 merge conflicts incrates/victory-hle/src/modules/gameinput.rs(Sourcetrait,Hub::poll,FakeHost,Fake, due toVICTORY_KEYS/scripted_keys). Also note thatmain's all-zero XInput connection filter meansdisconnect_zeroes_active_rumble_for_that_slot(usingPadState::default()) will need a non-zero pad report after rebasing.cdec26e9,cargo test --locked -p victory-hle --lib modules::gameinput::passes (10/10, default and--features diagnostics), and the new hunks arerustfmt-clean (clippyfails only on pre-existingxmem.rs:747at that older base).The WinRT worker thread lifetime (
RoInitialize/RoUninitializepairing, release order beforeFreeLibrary,// SAFETY:coverage, and#[cfg(windows)]gating) is clean, but a few issues need changes:Gamepad.Gamepadsindex (gameinput.rs:1323, 1478, 1581):Gamepad.Gamepadsis a dense list whose ordering does not track sparse XInput user slots0..3. If XInput slot0disconnects while slot1remains connected (now at WinRT index0), the disconnect zero for slot0stops the surviving controller while slot1goes out of range and falls back to 2-motor XInput (or drives the wrong device when multiple pads differ in order). Please associate devices rather than indexing WinRT by XInput slot.HStringHeader([usize; 3])(1188) is only 12 bytes on 32-bit Windows where WinRT requires 20 bytes.RoInitializereturnsRPC_E_CHANGED_MODE(1270), fall back to XInput instead of using WinRT on an STA thread without a message pump.RumbleWorker::newfails to spawn (1444),Host::rumble_sinkstill returnsSome(...)and silently drops fallback XInput rumble.rumble_motors = 0xFunconditionally (254) advertises trigger motors even when falling back to 2-motor XInput, and focus-loss zeroing (1595) can be overwritten by subsequentSetRumbleStatecalls while unfocused.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.