You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 76d9f11
Browse filesBrowse the repository at this point in the historyBrowse files
docs(ppu): research mid-scanline HDMA register timing + hi-res color-math, defer both
Confirmed a genuine, previously-undocumented off-by-one-line compositor
bug against ares' per-pixel reference model. ppu/main.cpp's
cycleRenderPixel() (the DAC/compositor output stage) only runs for
hcounter [56, 1078] -- strictly before HDMA's per-line service point
at hcounter 1104 (dot 276, HDMA_RUN_DOT). On real hardware an
HDMA-driven per-line register write during line V therefore lands
after line V has already finished drawing, and can only take effect
starting line V+1 (the mechanism behind Air Strike Patrol's BG3 raster
scroll). RustySNES's compositor instead renders line V at the very end
of that line's own dot loop (Ppu::end_of_scanline, dot 340) --
*after* line V's own HDMA run at dot 276 -- so it observes and paints
the value intended for V+1 across all of line V. Systemic, not
confined to one title: any ROM that HDMA-drives a per-line
scroll/window/CGRAM change is affected.
Corrects two related overclaims this investigation surfaced:
docs/ppu.md's "single-split-per-line effects work" claim (wrong --
even a single split lands one line early), and both that doc's and
lib.rs's claim that the per-scanline compositor is unconditionally
"bit-identical" to a per-dot renderer (only true when no
mid-line-rendered register changes -- false in exactly this case).
Not fixed this pass. The conceptually-correct fix (composite line V
using pre-line-V-HDMA register state) touches the single hottest,
most-tested code path in the engine -- all 29 currently-passing
undisbeliever goldens, every commercial-screenshot test, playable_smoke
-- and needs a dedicated committed test ROM plus a full
--features test-roms re-verification to land safely, neither of which
exist yet. Documented mechanism, root cause, and exactly what a future
fix needs in docs/ppu.md's new "Mid-scanline/HDMA-driven register
timing" section.
Separately confirmed hi-res (Modes 5/6) color-math precision is
blocked entirely on 512-wide hi-res output not existing yet, not a
numeric-precision nuance to layer onto an existing feature. ares'
DAC::run() (dac.cpp) shows hi-res is a dual-half-pixel trick: each PPU
pixel clock emits two output columns by alternating between the
"above" (normal, post-color-math) and "below" (subscreen re-blended)
compositor results, not by computing 512 independently-color-math'd
columns. Since rustysnes-ppu doesn't emit 512-wide output at all yet
(Modes 5/6 currently render at 256-wide), there is no existing hi-res
path to add color-math precision to -- documented as blocked on that
larger feature landing first, in docs/ppu.md's new "Hi-res color-math
precision" section.
No .rs code behavior changed -- only lib.rs's module doc comment was
corrected to match the finding. Verified: cargo fmt --all --check
clean, cargo clippy --workspace --all-targets -- -D warnings clean,
cargo test --workspace (326 passed), cargo test --workspace
--features test-roms (339 passed, zero regressions as expected for a
doc-only change).
Updates to-dos/VERSION-PLAN.md's v0.5.0 bullet with both findings.
0 commit comments