HLE: write at-rest gamepad state for non-pad readings #574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/574"
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 Quat3rnion on 2026-11-24T05:10:27Z.
What
IGameInputReading::GetGamepadStatemust write default at-rest values andreturn
falsewhen the reading has no gamepad. The shim returnedfalsewithout touching the caller's buffer, so a title reusing one
PadStatecould keep a held button or displaced stick after switching to keyboard
input. The state is now written in both cases; pad readings still write
their real state and return
true.An AI tool wrote part of this change.
Tested
cargo test --workspace: 165 passed, 0 failed, 3 ignored. A regression seeds aPadStatewith pressed buttons and moved sticks, calls slot0xb0on a keyboard reading, and asserts bothfalseandPadState::default().cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. No Windows host here.cargo xtask policypasses (150 files ok). No game files or data from them were added.Checklist
cargo xtask policypasses. No game files or data from them were added.Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:30:36Z.
Review: APPROVED
Tested
c70c478on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed), includinga_keyboard_reading_resets_the_gamepad_state_it_is_given.IGameInputReading::GetGamepadStatefills the struct with at-rest values and returnsfalsewhen the reading has no gamepad, so writingPadState::default()there matches it. A title that reuses its buffer can no longer keep a stale held button. A nulloutstill returnsfalsewithout writing.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T12:21:07Z.
Independent verification & code review on Windows 11 x64 MSVC (merged onto
mainffe310e):Checks Run
cargo xtask policy: PASS (154 files ok)cargo clippy -p victory-hle --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-hle --locked -- gameinput: PASS (8/8tests, includinga_keyboard_reading_resets_the_gamepad_state_it_is_given)Review
Looks clean and ready to merge —
gamepad_stateproperly guardsout.is_null(), writesPadState::default()on non-pad readings so reused caller buffers don't retain stale buttons/axes, and returnsfalse(or writes real state and returnstrueforValue::Pad).AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:16:42Z.
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
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.