denise: early-DDF lo-res picture placement is linear in DDFSTRT#106
Merged
Conversation
Remove the lo-res FMODE=0 "-1 sample" phase correction for DDFSTRT values before the standard $38 slot. Real hardware places a DDF-$30 lo-res picture exactly one 8-cck fetch period (16 lo-res pixels) left of the $38 picture: in the vAmigaTS Agnus/DIW/OLDDIW/diw1 A500 photos (OCS and ECS) the block-1 staircase pairs DIWSTRT hstart values ($94,$95)($96,$97) ($98,$99)($9A,$9B) on shared first-visible-stripe cells with plateau lengths [6,6,6,6,3,4] lines, matching only the linear grid, and the first plateau's indent against the standard rows measures 40 framebuffer px where the corrected grid predicts 36. The correction was compensating for the display window edge sitting one lo-res pixel too far right (2H-194 instead of the hardware's 2H-196, measured on the sblit0_A500_ECS.jpeg partial swatch columns): the too-wide window overran the fetched row's right edge on early-DDF screens. The window-edge anchor is fixed separately. vAmigaTS scores (vs vAmiga 4.4 refs): OLDDIW diw1 59.4%->1.5%, diw7 67.2%->0.4%, diw9 58.6%->0.0%, diwvert1 64.5%->1.2%; DIWH minmax 9.1%->0.6%, diwtim1b-4b 14.2%->0.5%; Agnus/DDF lupo1 39.8%->9.2%, hwstop7 22.1%->2.3%; Denise/Sprites improve broadly (sprites7 36.7%->24.9%). Gen-X, Hamazing, kicka1200 (hires fm3) and Zool (AGA) screenshots are byte-identical to main; Inside the Machine's overscan bitmap moves exactly 2 px left as predicted.
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
Remove the lo-res FMODE=0 "-1 sample" phase correction for DDFSTRT values
before the standard
$38slot (fetch_origin_native_shift,src/video/bitplane.rs). Early-DDF picture placement is linear in DDFSTRT:
a
$30picture sits exactly one 8-cck fetch period (16 lo-res pixels) leftof the
$38picture. This is the dominant residual behind theAgnus/DIW/OLDDIW/Denise/DIW/DIWHvAmigaTS buckets and half of the"first word after display window start" bug class (issues #68/#69).
Hardware arbitration
Copperline and vAmiga 4.4 disagree by exactly 1 lores px on early-DDF
picture phase, so the verdict was read off real A500 photos in the vAmigaTS
tree (
Agnus/DIW/OLDDIW/diw1, OCS and ECS photos).The discriminating observable is the diw1 block-1 staircase: 10 copper
steps (one per 3 lines) shrink the window by 1 lores px per side
(DIWSTRT hstart
$94..$9C,$9E). Which hstart values share afirst-visible-stripe cell depends on the DDF-
$30stripe grid phase:(
$94,$95)($96,$97)($98,$99)($9A,$9B)($9C)($9E)Both photos show [6,6,6,6,3,4] (dense subpixel scan; plateau boundaries at
OCS y = 95.5/112/128/144.5/161/169.5, line pitch 2.76 px). Independently,
the first plateau's indent versus the standard rows measures 41.0 fb px
(OCS) / 40.0 fb px (ECS); the linear grid predicts 40, the corrected grid
36. Verdict: real hardware is linear.
The correction (eeb2fe0, "lores HAM edge") was compensating for a separate
error: Copperline's display window edge sits one lores px too far right
(2H-194 for DIWSTRT hstart H; the sblit0_A500_ECS.jpeg partial-swatch
measurement shows the hardware edge at 2H-196, the vAmiga model). With the
too-wide window, a standard DIW overran the fetched row's right edge on
early-DDF screens, and the correction hid that by shifting the picture
right. The window-edge anchor fix lands separately; until then standard-DIW
early-DDF screens show background in the window's last lores px (as the
too-wide window makes unavoidable without the wrong phase).
vAmigaTS scores (Copperline vs vAmiga 4.4 refs, X_SHIFT=0)
diw5/diw6 (21-22%) and oldhwstop1-4 (50-60%) remain: separate divergence
classes (the diw1 photos additionally show two behaviours NEITHER emulator
models: DIW register writes take effect only from the next line, and
hstop
$A1/$A0in block 1 caused no right-edge narrowing at all).Verification
cargo test --releasegreen (1269 tests; expectations updated in 2tests with hardware-verdict comments, new linearity regression test),
cargo clippy,cargo fmt --checkclean.cargo test --release --test image_regression -- --ignored: 7 pass(ocs_bpu7_ham is the documented host-flaky perf test, fails on clean
main too).
110/150/220/620s (issue Demo issues #69 scene map), Hamazing, kicka1200 (A1200 KS3.1,
hires FMODE=3) and Zool (AGA) are byte-identical. Inside the Machine's
overscan bitmap (early DDF) moves exactly 2 px left, per-row verified
(content left edge 76 -> 74, colour-anchored effects unmoved) - the
predicted hardware-correct shift.