VICTORY_KEYS never reaches pad slot 0 when no pad is plugged in #1167
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#1167
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@MoonYueya on GitHub · 2026-11-25 22:25 UTC · original
Commit tested:
c36971b.cargo build --profile diag -p victory --features diagnostics, toolchain 1.98.1.channel is the in-process
VICTORY_KEYSschedule. A XInputdwPacketNumbercheck ranthroughout and never saw a change while no scripted key was held.
author's machine.
What happens
With no gamepad plugged in,
VICTORY_KEYSpresses do not reach pad slot 0. A screen that onlyreads slot 0 therefore ignores every scripted key, even though the keys are being held.
crates/victory-hle/src/modules/gameinput.rs,impl Source for Host,fn pad:The comment above that block says the keys are merged into the first pad "with a real pad
connected the stand-in is not there, and a title that listens to the pad saw nothing" — so the
merge is clearly meant to cover the no-stand-in case. But an empty slot 0 is a third case,
and it returns early: nothing is merged, and the scripted keys only ever appear on the stand-in
device (device 4) and on the keyboard device (device 5).
Why it matters here
The first-run flow of the title has a page that lists the local profiles. On this machine that
list draws entirely black (its frame is 33/255 mean with only 7 of 576 sampled blocks lit — the
bottom hint bar is all that shows), and the page only answers to the pad's buttons. With
VICTORY_KEYSdriving the run there was no way past it: 300 s of a scripted schedule(
Y,Down,Enterrepeated 8 times at 12 s intervals) changed the picture exactly zero times.What made it pass (local diagnostic patch, not proposed as a fix)
Making slot 0 answer with a pad that carries the scripted buttons whenever XInput reports no pad
there — i.e. giving it a pad that is there the whole time, not one that appears only while a
key is held:
Result, same
VICTORY_KEYSschedule, same data directory, same title build: the profile pagewas passed at +13 s after process start, the world's archives opened at +24.0 s, and the first frame below 5 fps
came at +39.0 s.
The pad has to be there the whole time. A first form that offered the pad only while a key was
held made the device connect and disconnect repeatedly; the title behaved as if a pad had been
unplugged and the picture never moved.
Repro
--features diagnostics(thescripted()path is behind that feature).VICTORY_KEYSschedule that pressesEnterevery few seconds.victory_hle::modules::gameinputreportinginput device device=4 connected=trueanddevice=5 connected=true, with no slot 0.@Tanju42 on GitHub · 2026-11-25 23:43 UTC · original
Confirmed on a third machine (RTX 5060 Laptop 8 GB, Win 11, 31 GB RAM, main
2950915+--features diagnostics) and fixed locally — the profile list does respond once slot 0 gets the merged pad.Frame log before the fix: flat
30.0 fpsforever (start screen), noVICTORY_KEYSeffect. After the fix below:14.7 → 30.0 ×8 → 0.1-0.9 fps, i.e. the scriptedEnterpassed the profile list and the title loaded into the world. Same machine, same save dir, onlypad()changed.The merge block in
pad()only runs afterXInputGetStatesucceeded; with no pad attached the earlyreturn Noneskips it, exactly as you wrote. My patch turns the empty-slot-0 case into the stand-in pad the block was meant to feed:One caveat I cannot rule out from outside: the title may poll slot 0 with
XInputGetStatethrough the HLE in places too (I only see GameInput traffic in my logs), and a permanently-present slot 0 could change what a title assumes about a connected pad outside diagnostics runs — hence keeping it behinddiagnosticsand gated on a non-empty schedule. Happy to open a PR if useful.@FordMustang0288 on GitHub · 2026-11-26 03:48 UTC · original
Confirmed the same on our machine, and Tanju42's diagnosis is right.
Our build is a detached checkout of
main(3973179) with the samepad()structure: an empty slot 0return Nones before the scripted-key merge, so every screen that reads the pad ignores the keys. On our host the title sat at a prompt indefinitely; Tanju42's observations match ours exactly.We fixed it the same way on our checkout: in the empty-slot-0 case, return a stand-in
PadStatefrom the scripted keys instead ofNone, and clearempty_until[slot]. That unblocked the title immediately. On an RTX 3080 10 GB the title went from sitting at a prompt for 25+ minutes to loading through first-boot screens, menus, key art, a 3D loading frame, and into the world.One thing Tanju42's patch gets right that ours missed: gating it on
!scripted().is_empty()so the stand-in pad only appears when there is actually a key held. Without that check, the title sees a permanently connected pad between key presses, which may cause other titles to behave differently.We had the same caveat: the title may also poll
XInputGetStatethrough the HLE in places where a permanently present pad could change behaviour. We are running under Wine/vkd3d-proton on Linux, so that path may differ from native. We have not seen it cause problems in our run, but it has only been tested on one title.Happy to test any further changes on this machine if it is useful. Linux/Wine/vkd3d-proton, RTX 3080 10 GB, driver 615.78.08.