Skip to content

agnus/denise: overprogrammed BPU fetch and arming rules (DDF sequencer follow-ups)#110

Merged
LinuxJedi merged 3 commits into
mainfrom
fix/ddf-fsm-residuals
Jul 4, 2026
Merged

agnus/denise: overprogrammed BPU fetch and arming rules (DDF sequencer follow-ups)#110
LinuxJedi merged 3 commits into
mainfrom
fix/ddf-fsm-residuals

Conversation

@LinuxJedi

@LinuxJedi LinuxJedi commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-ups to the DDF sequencer work (#109), each photo-arbitrated:

  1. Overprogrammed BPU fetches nothing and never arms the playfield.
    The invplanes1 A500 photo shows black for hi-res BPU=7 even with armed
    BPL5DAT/BPL6DAT latches. Agnus's fetch-unit table schedules at most 4
    plane streams in hi-res and 2 in SHRES - overprogrammed counts fetch
    nothing (unlike lo-res BPU=7's 4-plane fetch), and with no BPL1DAT
    load the playfield never arms, so the latches are not painted. Manual
    BPL1DAT writes still display through the manual-BPL replay.
  2. BPLCON0 reaches the DDF sequencer at +4 colour clocks (vAmiga's
    Agnus-side DMA_CYCLES(4); score-neutral, source fidelity).

Scores (vs vAmiga 4.4 refs)

test before after
Denise/Registers/BPLCON0/invplanes1 20.7% 0.000%
invprio0 / invprio1 / invprio2 / invprio3 16.3 / 14.9 / 11.8 / 20.3% 7.8 / 6.4 / 3.3 / 11.8%
modes0-2 (b/c variants) 10.8-11.1% 4.0%
modes3 / modes3b / modes3c 14-15% 8%

invplanes1 also closes the one regression flagged in the #109 audit
(13.7% pre-FSM), ending well below it.

Verification

  • cargo test --release green (one SHRES plane-count expectation
    re-derived to the fetch-unit table), clippy/fmt clean.
  • KS1.3 boot, Inside the Machine, Hamazing, Zool (AGA), and A1200 KS3.1
    boot screenshots byte-identical to main.

Update: sprite DMA slot geometry (third commit)

Sprite N's two DMA slots now sit at their hardware positions ($15+4N /
$17+4N per the HRM chart and vAmiga's DAS table) instead of a pair-shaped
band four clocks later; capture samples SPREN per slot with the DMACON
commit delay. The corrected band phase-locks the copper's free-running
loops: jumpbpu1-4 go 16.1/7.4/5.9/1.5% -> all 0.00x% (closing the
precession residual documented in #109), and the blitter timing family
net-improves. The sprena/sprdis sweeps still need the two-slot fetch
split (documented follow-up). Demo set byte-identical except Second
Nature's benign animation-phase drift (timing-sensitive; scene
pixel-perfect).

LinuxJedi added 3 commits July 4, 2026 15:48
… write

Align the sequencer's CON strobe with vAmiga's Agnus-side BPLCON0 commit
(DMA_CYCLES(4)); the previous three-cck figure was the legacy coarse
fetcher delay. Denise's own interpretation of BPLCON0 is unchanged.
Score-neutral on the vAmigaTS BPLCON0/DDFTIM buckets; kept for source
fidelity with the hardware-verified sequencer model.
…layfield

Two halves of one hardware rule, verified on the invplanes1 A500 photo
(hi-res BPU=7 with armed BPL5DAT/BPL6DAT latches shows BLACK):

- Agnus's fetch-unit table schedules at most 4 plane streams in hi-res
  and 2 in SHRES; an overprogrammed BPU (hi-res 5-7, SHRES 3-7) fetches
  NOTHING, unlike the lo-res BPU=7 overprogrammed 4-plane fetch. Both
  plane-count decoders (agnus::bitplane_dma_planes and the Denise
  BitplaneMode dma_planes) now follow the fetch-unit table.
- Denise's playfield output arms on BPL1DAT loads: a row whose fetch
  table carries no plane streams never loads BPL1DAT, so the non-DMA
  planes' latches are not painted on their own. Manual BPL1DAT writes
  still display through the manual-BPL replay.

vAmigaTS Denise/Registers/BPLCON0 (vs vAmiga 4.4 refs): invplanes1
20.7% -> 0.000%, invprio2 11.8% -> 3.3%, invprio0 16.3% -> 7.8%,
invprio1 14.9% -> 6.4%, invprio3 20.3% -> 11.8%, modes0-2 b/c variants
10.8-11.1% -> 4.0%, modes3/3b/3c 14-15% -> 8%. KS1.3, Inside the
Machine, Hamazing, Zool, and A1200 boot screenshots stay byte-identical
to main.
Sprite N's two DMA slots sit at colour clocks $15+4N and $17+4N (the
HRM slot chart and vAmiga's DAS table). Copperline reserved a pair-shaped
band four clocks later ($19..$37, two sprites per 8-cck band) and
captured both sprites of a pair at one coarse position. Now each sprite
owns its own two odd slots in the arbiter, capture happens at each
sprite's first slot, and SPREN is sampled per slot (honouring the DMACON
commit delay).

The corrected band phase-locks the copper's free-running loops against
sprite DMA: vAmigaTS Agnus/Copper/oldJump jumpbpu1 16.1% -> 0.016%,
jumpbpu2 7.4% -> 0.000%, jumpbpu3 5.9% -> 0.000%, jumpbpu4 1.5% -> 0.001%
(the precession residual documented in #109). The blitter timing family
net-improves (timing8/9/9f/12/15 -2.2, timing6/10/15l +1..2 - the
remaining spread sits in the blitter model). The sprena/sprdis DMACON
sweeps (29-43%) still need the true two-slot fetch split - the atomic
per-line sprite capture cannot express a word-level SPREN edge between a
sprite's two slots; unchanged here.

KS1.3, Inside the Machine, Hamazing, Gen-X, and Zool screenshots are
byte-identical to main. Second Nature's falling-leaves scene renders
identically with a small animation-phase drift (timing-sensitive demo;
chip-bus contention legitimately changed).
@LinuxJedi LinuxJedi merged commit 7d42708 into main Jul 4, 2026
8 checks passed
@LinuxJedi LinuxJedi deleted the fix/ddf-fsm-residuals branch July 4, 2026 15:42
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