Skip to content

Expose guarded resolved digital-pad snapshots to opt-in mods - #780

Open
michaelm-afk wants to merge 1 commit into
RetroPortingToolKit:masterfrom
michaelm-afk:feat/resolved-digital-pad-snapshot-20261027
Open

michaelm-afk wants to merge 1 commit into
RetroPortingToolKit:masterfrom
michaelm-afk:feat/resolved-digital-pad-snapshot-20261027

Conversation

@michaelm-afk

Copy link
Copy Markdown
Contributor

A title may consume an older emulated SDK pad packet even though the runtime
already has a newer resolved host sample. This adds a main-thread, opt-in API
for checked title adapters to consume that sample without another device poll,
SIO packet change, guest update or rendering operation.

Per-consumer history preserves observed short taps and press/release separation.
Repeated reads in one guest frame are idempotent. Device/session discontinuities,
frame gaps and excessive backlog re-prime from the original result. Host history
is not serialized into guest savestates; actual state loads invalidate it while
render-only restore paths retain the current host observations.

Scope and safeguards

  • Standalone digital P1 only; default title behavior is unchanged.
  • Original fallback for analog, registered controller policies/transforms/sources,
    multiple configured pads, multitap, netplay/resimulation, replay and input guards.
  • No SDL event pumping in a guest hook, new threads, input prediction or frame queue.
  • Unknown guest-only multiplayer patches are outside the verified contract.

Validation
Reuses the completed C/C++ edge-history tests, SIO digital tests (2099), multitap
variants (2119 each), rumble/JogCon/NeGcon, pad-apply and input-gate regressions.
The CTest regression is digital_pad_snapshot_test. Title integration measurements
and short LOAD checks are in the companion TombaRecomp description.

No further small, demonstrably safe reduction was found in the final review;
the validated production implementation is unchanged. Windows runtime evidence
is available; Linux/macOS end-to-end execution is not claimed.

Base: psxrecomp master ffbd9d1, remotely rechecked 28 October 2026.
Separate companion title PR; merge this API first. Source and tests only.

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