Repository navigation
Apply due APU port writes without advancing past the guest clock - #258
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a CPU port write is queued exactly at the requested APU clock,
apu_runToGuestCycleexecutes an extra SPC cycle just to drain the event. A second write at the same guest timestamp can then rebase the mapping. With an exact cycle budget, synchronization can instead return false with the boundary write still pending.Drain writes due at the current clock before testing the target. Port updates at the boundary need no SPC instruction, timer or DSP advancement, and repeated synchronization stays at the same clock. This applies by default to both portable and native APU implementations. It does not claim full cycle parity or a hardware input-delay model.
Validation:
The added cases fail on engine main
fb8cf15dand pass with the fix in bothSNESRECOMP_APU_NATIVE=0and=1.Cover same-timestamp word bytes, unchanged clock/CPU-cycle residue, partial budgets, a write exactly at the budget limit, and idempotent zero-budget synchronization.
Combined automated regression passes on
40ddfb3e: 884 Python checks (two skips), nine PPU harnesses, three strict GLSL programs, 772 GPU comparisons, and supported MMX/ALttP/SMW/Super Metroid gameplay/current-build save-load/runtime checks. Super Metroid uses its compatible stable consumer for this stock-engine comparison; current title main requires a separate mod-runtime pin. The new owner visual/play check remains pending, so this stays draft.Found while reviewing the new timing notes on #205 and #241. The same boundary repair is now on PR #241 at
3856deb1, retaining its access-exact hold/cleanup behavior and passing all four portable/native and instruction-start/access-exact combinations. This does not close #205 or supply the still-missing Secret of Evermore replay recipe. Tracking: beads-8wg.2.199.