dma: preserve live linked-list reads with word-cost timing - #304
Merged
mstan merged 4 commits intoSep 3, 2026
Merged
Conversation
3 tasks
Ed1z19
pushed a commit
to Ed1z19/psxrecomp
that referenced
this pull request
Sep 4, 2026
Add passive DMA2 ordering-table counters to dma_state so long or aborted linked-list walks are visible without relying on screenshots. The counters track starts, duplicate starts dropped while a walk is active, completions, cancels, last/max walk size and cycle cost, CHCR poll counts, the initiator PC, and the last eight cancel records. This intentionally does not port PR RetroPortingToolKit#302's superseded walker changes or the PSX_GPU_LL_SYNC diagnostic lever; PR RetroPortingToolKit#304 remains the timing implementation. Co-authored-by: Kevin Kline <9866117+kerokline@users.noreply.github.com>
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.
Summary
Preserve guest-visible GPU DMA2 linked-list slicing while restoring the one-clock cost per transferred 32-bit word.
Each payload word is read from live RAM at its own guest-cycle event. Late service consumes every elapsed boundary. Widescreen prepass metadata is discarded when a live packet or link changes. The obsolete polygon-drop filter is removed.
This combines the reviewed correctness work from Alexbeav#13 with the FF7-compatible transfer cost demonstrated by #299 and #302.
Regression
#277 fixed Vampire Hunter D and Spot Goes to Hollywood by allowing a guest to change later ordering-table data while DMA remained active. Its separate 8-clock header and 5-clock setup charges also kept large Final Fantasy VII ordering tables busy long enough to reach the game's timeout path.
This change keeps the sliced reads but charges one clock for each header or payload word. It does not claim to implement complete physical-bus arbitration.
The DMA snapshot now stores the in-flight payload index. Boot-state version 6 rejects version-5 files at the header before any state section changes the live machine.
Tests
dma_gpu_linked_list_timing_testpasses 20 consecutive runs.ws_prepass_guard_testpasses 20 consecutive runs.savestate_status_protocol_testpasses 20 consecutive runs.mod_runtime_testcrash reproduces on unchanged base22fbbfca.git diff --checkpasses.The earlier correctness head reached frame 616 in fresh Vampire Hunter D and Spot builds. User testing reported correct FF7 geometry after the lower-cost correction. New visible VHD and Spot runs on this exact combined head remain open.
Review
Fork review: Alexbeav#20
Cubic reviewed exact head
9dfb4174adea419c259b132eda512525cf9b8deaand reported no issues across 13 files. Both earlier review threads are resolved.Developed with AI assistance; validated as described (test evidence in PR body). AI writes the code and the PR, but I always test before I send something up. Happy to iterate on this process with your feedback.