1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 17:06:04 +00:00
nescript/tests
Claude b708eb5554
main: write the real mapper byte into the iNES header
The CLI's build path was calling `Linker::new(mirroring)`, which
hardcodes the mapper number to NROM (0) regardless of the source
file's `mapper:` declaration. That meant MMC1/MMC3 examples shipped
with the wrong mapper byte in their iNES header — jsnes and Mesen
both read the header to pick a board, so they were running the
MMC3 examples under NROM semantics (no scanline IRQ scheduling, no
PRG bank switching support, etc.). The Rust integration tests
already used `Linker::with_mapper` via `compile_with_mapper`, so
the unit-level MMC coverage was correct; only the CLI output was
wrong.

Swap to `Linker::with_mapper(program.game.mirroring, program.game.mapper)`
so the header matches the source. Confirmed by inspecting the
rebuilt example ROMs:

  mmc3_per_state_split.nes: flags6=40 (mapper=4)  ← was 00
  scanline_split.nes:       flags6=40 (mapper=4)  ← was 00
  mmc1_banked.nes:          flags6=11 (mapper=1)  ← was 01
  hello_sprite.nes:         flags6=00 (mapper=0)  unchanged

Under real MMC3 semantics jsnes now runs the scanline IRQ path
for the two scanline examples, which ends up producing 9 more
audio samples (~200 μs) in the 180-frame capture window — a
timing difference that falls out of how the IRQ handlers
interact with the audio frame counter. Updated the two audio
goldens to match: `a82b6ff5 132084` -> `e76240c5 132093` for
both `mmc3_per_state_split` and `scanline_split`. PNG goldens
are unchanged — the visible output is the same.

All 19 emulator goldens now match. 381 unit tests + 43 integration
tests green. Clippy and fmt clean.

https://claude.ai/code/session_015WfaDttE3DpWn9rpyfpQd8
2026-04-13 01:27:42 +00:00
..
emulator main: write the real mapper byte into the iNES header 2026-04-13 01:27:42 +00:00
integration Implement NEScript compiler Milestone 1 ("Hello Sprite") 2026-04-11 22:07:56 +00:00
integration_test.rs audio: complete the subsystem — asset pipeline, user decls, tracker-style driver 2026-04-13 01:10:21 +00:00