Fix TV aperture and bitplane edge timing#76
Merged
Conversation
Open
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.
1852168 to
4daf2f6
Compare
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
Verification