Skip to content

Fix TV aperture and bitplane edge timing#76

Merged
LinuxJedi merged 10 commits into
mainfrom
fix/bpl1dat-manual-dma-clip
Jul 1, 2026
Merged

Fix TV aperture and bitplane edge timing#76
LinuxJedi merged 10 commits into
mainfrom
fix/bpl1dat-manual-dma-clip

Conversation

@LinuxJedi

Copy link
Copy Markdown
Owner

Summary

  • fix BPL1DAT/DDF edge timing so standard and late bitplane fetches keep their correct visible edges
  • align TV-mode PAL capture/live presentation with reference apertures while preserving true horizontal overscan fetches
  • document the TV aperture/full-overscan split and add focused regression coverage for the hardware-derived behavior

Verification

  • cargo build --release
  • cargo test
  • cargo fmt --check
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • rendered saved states for AmigaDOS, AGA Workbench, and CD32 boot-screen aperture regressions

@LinuxJedi LinuxJedi mentioned this pull request Jul 1, 2026
LinuxJedi added 10 commits July 1, 2026 11:23
Manual BPL1DAT replay now stops when a later DMA BPL1DAT load replaces Denise's bitplane shifter, so manually started bitplane words cannot leak into subsequent DMA playfield output.

Presentation screenshots and frame dumps now preserve whole source-row colours unless raw output is explicitly requested, and the docs describe the raw capture/debugging path.
Apply the low-res FMODE=0 fetch/display phase bias when a late DDF row completes exactly at DIWSTOP, so the last visible DIW sample still includes undelayed planes while BPLCON1 delayed planes retap normally.

Add a focused regression for the DDFSTRT=/DDFSTOP= low-res edge case and document the timing rule in the video internals notes.
Map COLORxx writes before Denise hblank start to the wrapped tail of the previous output row while carrying the palette value into the following row. This restores right-edge border colour changes driven by early-line copper writes.

Preserve completed-frame line counts for render handoff and keep TV overscan masking horizontal-only so vertical border output from the completed frame is not presentation-cropped.

Add focused renderer regressions for pre-hblank colour writes and completed-frame bottom-border presentation, and update the video internals/config docs.
Model late FMODE=0 low-res DDFSTOP as a final fetch-unit hold in the Denise sampler instead of moving the whole row fetch origin. This preserves the last visible DIW sample at the right edge while keeping the left-side fetch phase unchanged.\n\nAdd regressions for both the DIWSTOP hold and the unadvanced left origin.
Keep standard PAL/NTSC framebuffer row zero anchored at the fixed overscan top while leaving the DIW-derived display start responsible for chip-RAM snapshots and bitplane DMA capture. This prevents a later DIWSTRT change from recentering the presented frame and dropping the visible top border.

Replay sprite DMA up to the DIW snapshot line so top-border sprite rows are rebuilt without duplication, and block OCS same-line DIWSTRT writes from opening bitplane DMA retroactively. Document the DIW/display-start split in the video internals notes.
TV overscan presentation now masks the fixed framebuffer source aperture instead of shifting the rendered image left before applying the bezel mask. This preserves the right edge of standard hi-res screens while leaving full-overscan horizontal recentering on the existing DDF-aware path.

Update the TV mask tests and internals documentation to describe the split between anchored TV presentation and full-overscan recentering.
TV-mode screenshots and frame dumps now crop standard PAL fields to a 692x540 aperture centered on the 640-pixel standard display, matching the source-window crop used by reference emulators. Raw capture still writes the 716x570 woven framebuffer and full-overscan output keeps the existing full-buffer presentation scale.

Add a clamped crop helper for apertures that extend slightly beyond the captured framebuffer, plus tests and docs for the PAL TV PNG geometry.
Standard hi-res displays using DIW H= and DDFSTRT=C should begin their fetched 640-pixel row at the display-window edge. The old hi-res reference inserted a four-pixel lead-in, pushing standard Workbench-style rows right and clipping the final vertical border at DIWSTOP.

Move the hi-res fetch reference to the corrected phase, remove the wide-FMODE compensation that depended on the old reference, and update timing tests plus internals documentation for the new DDF/DIW relation.
Keep the rendered TV framebuffer anchored for screenshot and frame-dump parity, but copy the same 692x540 PAL aperture into the centre of the 716-pixel live texture. This makes the interactive window use the reference crop without moving the emulated framebuffer or changing saved PNG output.

Add a regression test for the live aperture copy and document the distinction between saved TV PNG cropping and live-window presentation.
Gate the 692x540 PAL TV aperture on the effective DDF-derived horizontal content, not only on frame geometry. Standard-width fetches inside wide DIW windows still use the reference aperture, while fetches that genuinely reach into the horizontal overscan stay on the full-width TV path.

Latch the aperture decision with the presented frame so screenshots, frame dumps, threaded rendering, and live-window copies make the same decision. Add regression coverage for standard fetches inside wide DIW and true overscan fetches.
@LinuxJedi LinuxJedi force-pushed the fix/bpl1dat-manual-dma-clip branch from 1852168 to 4daf2f6 Compare July 1, 2026 10:29
@LinuxJedi LinuxJedi merged commit 7238511 into main Jul 1, 2026
7 checks passed
@LinuxJedi LinuxJedi deleted the fix/bpl1dat-manual-dma-clip branch July 1, 2026 10:34
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