Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.84 KB

File metadata and controls

37 lines (28 loc) · 1.84 KB

Tests

Validation harnesses for the emulator. All test ROM sets are user-supplied and gitignored — download links are in each runner's header.

File What it does
sm83_runner.c Runs the SingleStepTests/sm83 per-opcode suite against cpu.c through a flat MMU (no SDL). The most thorough CPU check.
run-test-roms.sh Runs the c-sp/game-boy-test-roms aggregator (Mooneye + Blargg + acid2) headless and prints a per-suite pass/fail summary.
png-bmp-diff.py Pixel diff between a reference PNG and a --screenshot BMP (pure stdlib). --struct does a palette-invariant diff for CGB-colourised references.
sm83-data/ The SingleStepTests vectors (clone here; gitignored).

Running

make test-sm83                      # SM83 single-step CPU tests (all 500 files pass)
make test-sm83 FILTER="cb 7c"       # one opcode
make test-sm83 SM83_DIR=/path       # override the data dir

make test-roms                      # Mooneye + Blargg + acid2 summary
make test-roms ROMS=/path           # override the ROM dir

make DEBUG=1 test-sm83 adds AddressSanitizer + UBSan.

How each suite reports a pass

  • Mooneye — run with --mooneye; stops on the LD B,B breakpoint and checks the Fibonacci register signature B,C,D,E,H,L = 3,5,8,13,21,34. Multi-model boot ROMs run with the matching --<model> flag.
  • Blargg — serial ROMs print to stdout with --serial; cart-RAM-protocol ROMs (e.g. dmg_sound) report with --blargg.
  • acid2--screenshot to a BMP, then png-bmp-diff.py against the bundled reference (0 = pixel-perfect).

Screenshot suites needing many per-ROM references (mealybug, gbmicrotest, etc.) are reported as NOT-AUTOMATED by run-test-roms.sh rather than guessed.