Copper: COPxLC writes retarget a dormant Copper's PC#128
Merged
Conversation
Real Agnus reloads the Copper PC from COP1LC at every vertical-blank strobe whether or not Copper DMA is enabled, and while the Copper has not been active in the current field - DMA off at that strobe and no COPEN 0->1 edge since - a write to the location register the PC was last strobed from moves the PC directly instead of only loading the latch. Once the Copper has been active in the field, location writes are latch-only until the next strobe, as before. (vAmiga models the same rule via activeInThisFrame in pokeCOPxLC; the vAmigaTS Agnus/Copper/lc family photographs it: a VERTB handler that rewrites COP1LC and then enables Copper DMA runs the NEW list.) Copperline tracked neither the active-in-field state nor which list the PC was strobed from, so location writes never retargeted and the lc tests ran the stale list. Also refresh a pending vertical-blank strobe's address on COP1LC rewrites in the wrap-to-strobe window (the restart now uses the live COP1LC value instead of the wrap-time capture). vAmigaTS: lc1/lc1b 49.5->0.0% (exact), lc2/lc4 70.3->0.0%, lc2b 39.6->0.0%, lc3 30.7->0.0%; copvbl3 23.4->7.2%, Copper/Irq/irq3 32.7->19.5%; Agnus/Copper family summed 1060->687%. No collateral (the remaining copvbl/oldJump movement reproduces on main and is the known PR #125 IRQ-delivery trade). Demo screenshot set byte-identical. Save states: STATE_VERSION 19 (two new Bus fields).
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.
Real Agnus reloads the Copper PC from COP1LC at every vertical-blank strobe whether or not Copper DMA is enabled, and while the Copper has not been active in the current field (DMA off at that strobe, no COPEN edge since), a write to the location register the PC was last strobed from moves the PC directly instead of only loading the latch. Once the Copper has been active in the field, location writes are latch-only until the next strobe, as before. vAmiga models the same rule (
activeInThisFrameinpokeCOPxLC); the vAmigaTS Agnus/Copper/lc family photographs it.Copperline tracked neither the active-in-field state nor which list the PC was strobed from, so location writes never retargeted and the lc tests ran the stale list. A pending vertical-blank strobe's address is now also refreshed by COP1LC rewrites in the wrap-to-strobe window.
Results
No collateral: the remaining copvbl/oldJump movement in the family reproduces on main and is the known PR #125 IRQ-delivery trade.
Gates
copper_lc_write_retargets_dormant_copper_pc;copper_dma_enable_gates_current_pc_until_copjmp_strobenow establishes its parked-Copper state as active-in-field, which is what its fabricated history implies on hardware); clippy + fmt clean.