mirror of
https://github.com/imjasonh/nescript
synced 2026-07-09 01:16:12 +00:00
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 |
||
|---|---|---|
| .. | ||
| arrays_and_functions.audio.hash | ||
| arrays_and_functions.png | ||
| audio_demo.audio.hash | ||
| audio_demo.png | ||
| bitwise_ops.audio.hash | ||
| bitwise_ops.png | ||
| bouncing_ball.audio.hash | ||
| bouncing_ball.png | ||
| coin_cavern.audio.hash | ||
| coin_cavern.png | ||
| comparisons.audio.hash | ||
| comparisons.png | ||
| function_chain.audio.hash | ||
| function_chain.png | ||
| hello_sprite.audio.hash | ||
| hello_sprite.png | ||
| inline_asm_demo.audio.hash | ||
| inline_asm_demo.png | ||
| logic_ops.audio.hash | ||
| logic_ops.png | ||
| loop_break_continue.audio.hash | ||
| loop_break_continue.png | ||
| match_demo.audio.hash | ||
| match_demo.png | ||
| mmc1_banked.audio.hash | ||
| mmc1_banked.png | ||
| mmc3_per_state_split.audio.hash | ||
| mmc3_per_state_split.png | ||
| scanline_split.audio.hash | ||
| scanline_split.png | ||
| sprites_and_palettes.audio.hash | ||
| sprites_and_palettes.png | ||
| state_machine.audio.hash | ||
| state_machine.png | ||
| structs_enums_for.audio.hash | ||
| structs_enums_for.png | ||
| two_player.audio.hash | ||
| two_player.png | ||