Skip to content

Fake input: keep last-known-good snapshot instead of a fabricated 0#586

Open
Xnick417x wants to merge 3 commits into
WinNative-Emu:mainfrom
Xnick417x:input
Open

Fake input: keep last-known-good snapshot instead of a fabricated 0#586
Xnick417x wants to merge 3 commits into
WinNative-Emu:mainfrom
Xnick417x:input

Conversation

@Xnick417x

Copy link
Copy Markdown
Collaborator

The seqlock snapshot reader gave up after 8 non-yielding spins and returned all-zeros, which capture_keyframe then streamed to the guest as a full neutral controller state — a one-frame input drop under contention (worst with on-screen touch controls). read_snapshot now spins up to 128 attempts with a yield hint on each retry and reports success/failure; on a failed read capture_keyframe keeps the previous keyframe instead of publishing zeros. Reader-side only; ring layout and protocol unchanged.

Xnick417x added 3 commits July 1, 2026 05:58
…tral keyframe

The seqlock snapshot reader gave up after 8 non-yielding spins and returned
all-zeros, which capture_keyframe then streamed to the guest as a full neutral
controller state — a one-frame input drop under contention (worst with on-screen
touch controls). read_snapshot now spins up to 128 attempts with a yield hint on
each retry and reports success/failure; on a failed read capture_keyframe keeps
the previous keyframe instead of publishing zeros. Reader-side only; ring layout
and protocol unchanged.
Touch: recover ScreenTouchStick when its pointer is captured by a control it drifted onto or is no longer down; reconcile from the controls view on every event so a missed or unforwarded UP no longer strands the right stick.

Reader: on ring overflow only arm a keyframe from a fresh snapshot. A fresh keyframe now discards the surviving ring window so an older push can't overwrite a newer release, and a failed snapshot read replays the window instead of re-asserting a stale absolute frame.
On ring overflow the reader dropped the surviving window by default, so
while a keyframe was mid-stream it discarded fresh delta events without
refreshing the full state. A quiet axis whose last event had aged out of
the window then stayed pinned to the stale keyframe value until the
flooding axis stopped. Replay the window by default and drop it only when
a fresh full keyframe (a true superset) was captured this call.
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.

1 participant