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 519bdd5
Browse filesBrowse the repository at this point in the historyBrowse files
feat(ppu): Option 2 octal-latch scaffold behind mc-ppu-bus-addr-hybrid (attempt, does not yet pass) (#234)
* feat(ppu): Option 2 octal-latch scaffold behind mc-ppu-bus-addr-hybrid (attempt; does not yet pass)
The v2.0.1 "Option 2" attempt from ADR 0030 — Mesen2's persistent-PPU-bus-address
model — to pass the two new AccuracyCoin PPU tests ("Hybrid Addresses" $0492,
"ALE + Read" $0491). Landed as a flag-gated scaffold: it does NOT yet pass the two
tests, but the shipped build is byte-identical and it is the shared `bus_addr`
prerequisite for the Option 1 (2-cycle-ALE) effort that follows.
Implementation (entirely `#[cfg(feature = "mc-ppu-bus-addr-hybrid")]`-gated, a new
default-off feature threaded rustynes-ppu -> rustynes-core -> rustynes-test-harness):
- `bus_addr: u16` on `Ppu`, fed by every `read_vram` (Mesen2's `_ppuBusAddress`;
its low 8 bits are the octal-latch value). Not snapshotted (self-heals next fetch).
- `hybrid_pending: Option<u16>`, set by the `$2006` case-6 render-time hook to
`(v & 0x3F00) | (bus_addr & 0xFF)` and consumed once by the next `fetch_nt`.
Outcome (measured):
- Flag OFF (shipped): AccuracyCoin 139/141, `cargo test -p rustynes-test-harness
--release --features test-roms` = 0 FAILED across all suites, no_std clean, clippy
0/0, fmt OK. Byte-identical to main by construction (all state is cfg-gated out).
- Flag ON: clippy 0/0, but AccuracyCoin is STILL 139/141 — both new tests fail.
Why it does not converge (confirms ADR 0030): the `$2006` hybrid hook fires, but
`bus_addr`'s low byte at the write instant is not the tuned `$19` the test's
504-cycle clockslide targets. RustyNES drives each fetch address at whole-dot
granularity in a single `read_vram`, so the "last driven address" when the CPU
`$2006` write interleaves is not reliably the `$2C19` NT fetch — it may be the
group's AT/pattern fetch or land a dot off. Faithfully reproducing the sub-cycle
octal latch needs the per-cycle 2-cycle-ALE bus model (Option 1); the delayed-`v`
refinement corrects only the `0x41F` scroll bits, not the full low byte.
Kept (not reverted) as the documented Option-2 attempt + the `bus_addr` foundation
Option 1 builds on. See ADR 0030 for the full analysis and the two-track plan.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs(ppu): adopt #234 review — accurate feature comment + hybrid_pending snapshot note
Three bot threads on the Option-2 scaffold, all doc-only:
- rustynes-ppu/Cargo.toml (gemini + Copilot): the feature comment claimed the
bus_addr/octal_latch tracking is 'always-on and inert', but in this PR ALL of it
(the bus_addr tracking AND the corruption hooks) is #[cfg(feature=…)]-gated, so
the default build compiles none of it. Corrected the comment to say exactly that.
- rustynes-ppu/src/ppu.rs hybrid_pending (gemini HIGH): documented the known
flag-on-only limitation — hybrid_pending is transient one-shot state (not
self-healing like bus_addr) and is deliberately not snapshotted, so a save-state
captured in its narrow window under the experimental feature would drop it on
restore. Harmless in the shipped build (feature off ⇒ field compiled out); must be
resolved when the Option 1 (2-cycle-ALE) work promotes this path. Tracked in ADR 0030.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments