Skip to content

Copper: COPxLC writes retarget a dormant Copper's PC#128

Merged
LinuxJedi merged 1 commit into
mainfrom
fix/copper-dormant-lc-retarget
Jul 6, 2026
Merged

Copper: COPxLC writes retarget a dormant Copper's PC#128
LinuxJedi merged 1 commit into
mainfrom
fix/copper-dormant-lc-retarget

Conversation

@LinuxJedi

Copy link
Copy Markdown
Owner

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 (activeInThisFrame in pokeCOPxLC); 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

case before after
Copper/lc/lc1, lc1b 49.5% 0.000% (exact)
Copper/lc/lc2, lc4 70.3% 0.02-0.04%
Copper/lc/lc2b 39.6% 0.03%
Copper/lc/lc3 30.7% 0.01%
Copper/copvbl/copvbl3 23.4% 7.2%
Copper/Irq/irq3 32.7% 19.5%
Agnus/Copper family (114 cases, summed) 1060% 687%

No collateral: the remaining copvbl/oldJump movement in the family reproduces on main and is the known PR #125 IRQ-delivery trade.

Gates

  • 1320 unit tests green (new: copper_lc_write_retargets_dormant_copper_pc; copper_dma_enable_gates_current_pc_until_copjmp_strobe now establishes its parked-Copper state as active-in-field, which is what its fabricated history implies on hardware); clippy + fmt clean.
  • Demo screenshot set (phooey, tomato, roots-ecs, roots-aga, zool at 4s+8s) byte-identical.
  • STATE_VERSION 18 -> 19 (two new Bus fields).

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).
@LinuxJedi LinuxJedi merged commit a893982 into main Jul 6, 2026
7 checks passed
@LinuxJedi LinuxJedi deleted the fix/copper-dormant-lc-retarget branch July 6, 2026 07:59
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