Skip to content

Commit 8557044

Browse files
doublegateclaude
andcommitted
docs(mappers): MMC1's module docs state the v2.8.2 write-filter rule
Copilot on #558: the `//!` preamble still said the port inhibits "a second write on the CPU cycle immediately following an accepted write" and drops "writes that fall on the cycle right after another accepted write". Both halves went stale in dae2053, which made an ignored write count as the last write too and made the bit-7 reset immune to the filter; the field comment and the match arm were updated then, the crate docs were not. The preamble now states the rule as implemented and as nesdev words it: only the data bit of a write on the cycle after any serial-port write is ignored, the reset is never ignored, and the read-modify-write instruction is the case both games depend on (Bill & Ted on the dropped data write, Shinsenden on the reset landing). It names the correction and its audit row so a reader of the older behaviour knows why it changed. Comment-only. cargo test -p rustynes-mappers m001 (23 passed), rustdoc -D warnings on the crate and fmt are clean. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014qfTKi2M3swo7qnwvYCkDj
1 parent 5b66686 commit 8557044

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎crates/rustynes-mappers/src/m001_mmc1.rs‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
//! has bit 7 set resets the shift register and ORs the control register
1212
//! with `$0C` (forcing PRG mode 3 = "fix last bank @ $C000").
1313
//!
14-
//! Consecutive-write bug: real hardware inhibits the register from accepting
15-
//! a second write on the CPU cycle immediately following an accepted write.
16-
//! Bill & Ted's Excellent Adventure relies on this. We track the cycle
17-
//! counter via [`Mapper::notify_cpu_cycle`] and drop writes that fall on the
18-
//! cycle right after another accepted write.
14+
//! Consecutive-write bug: on real hardware the serial port ignores the DATA
15+
//! bit of a write that lands on the CPU cycle immediately after another
16+
//! serial-port write, whether that earlier write was accepted or itself
17+
//! ignored (nesdev: it "ignores every write after the first"). A write with
18+
//! bit 7 set is never ignored: the reset takes effect on any cycle. A
19+
//! read-modify-write instruction's two back-to-back writes are the case that
20+
//! matters: Bill & Ted's Excellent Adventure relies on the second data write
21+
//! being dropped, and Shinsenden on a reset in that second write landing. We
22+
//! track the cycle counter via [`Mapper::notify_cpu_cycle`]. Until v2.8.2 the
23+
//! reset was filtered too (RTL audit R-3.5a, which found the `MiSTer` core right
24+
//! and this implementation wrong).
1925
//!
2026
//! The default revision when the cartridge header lacks an NES 2.0 submapper
2127
//! byte is **Sharp** (project policy: Star Trek: 25th Anniversary requires

0 commit comments

Comments
 (0)