# Documents Read in this order. | Document | What it holds | | --- | --- | | [start-here.md](start-here.md) | The machine; buses, memory map and wait states; the Game Pak prefetch buffer; DMA; timers; interrupts, HALT, STOP; keypad and serial; the BIOS, its read protection and open bus; the PPU; the sound unit and the Game Boy channels' extraction; CGB mode (out of scope); a module shape | | [timing.md](timing.md) | How each core callback becomes clocks; the prefetch buffer's rules; DMA, IRQ latency, timers, the PPU's line, sound clocks; each rule with its source and judge | | [undocumented-behavior.md](undocumented-behavior.md) | Quirks 1–22 with judges and measured detector results; contradictions C1–C11; open items | | [cartridge.md](cartridge.md) | ROM, header, save chips (SRAM, Flash 64K/128K, EEPROM), GPIO and the RTC; the census of the local No-Intro set | | [validation.md](validation.md) | Every oracle by tier with pins; what was run here and what it showed; the rung plan | | [mame-oracle.md](mame-oracle.md) | The verified MAME 0.285 recipe and what it can and cannot tell | | [handoff-brief.md](handoff-brief.md) | The task for the session that builds the board: decisions, how the board uses arm7tdmi-python's bus contract, rungs, tooling, the user's decisions | ## Findings made while gathering (2026-10-21) These came from running things, not from any single document: 1. **NanoBoyAdvance moved to Codeberg, and its HEAD is not usable as a referee.** The 2.0 rewrite (`9894c66`) segfaults in `PPU::DrawMergeImpl` in 40–85 % of runs, depending on the ROM, and its audio thread overruns a buffer under ASan. The v1.8.3 release is pinned instead: 0 crashes in 30 runs. 2. **NanoBoyAdvance 1.8.3 is the strongest detector, by a wide margin.** With the retail BIOS it scores the mGBA suite's timing 2,020/2,020, timer count-up 936/936, timer IRQ 90/90 and multiply-long 72/72, and passes 95 of 143 r12-protocol hardware ROMs. mGBA at HEAD scores 1,768, 744, 70, 52 and 49. NBA still fails 48 hardware ROMs, so **the hardware tests stay the judges**. 3. **The BIOS changes test results, not just boot** (C3). The same emulator loses 120 timing and 89 timer count-up cases with the free BIOS. Judge runs need the retail BIOS; Cult-of-GBA is for CI and people without a dump. 4. **alyosha-tas's tests ran on a Game Boy Player**, whose own BIOS variant does not boot standalone (every ROM stalls on NBA). Tests sensitive to boot phase may encode the GBP's hand-over timing (C4). 5. **Both detectors fail the suite's six "H-blank bit start" cases**, and GBATEK, NBA and mGBA give three different cycles: 1,006, 1,007 and 1,008 (C1). 6. **mGBA at HEAD fails jsmolka `arm.gba` test 522** (STMFD with the base in the list), which NBA passes: a core item for arm7tdmi-python (C6). 7. **MAME 0.285 does not boot with the free BIOS** and fails most CPU and memory tests even with the retail one. It is a detector for gross faults only. 8. **There is no die-level model of the GBA**: no netlist, no decap-derived simulator, nothing like dmg-sim. The MiSTer core is hand-written RTL. 9. **NBA's PPU tests are judged by photographs.** The `hw-test` `expected.png` files are photos of a real screen (4000×3000), so they are hardware-captured, but comparison is by eye until a frame-exact capture exists. 10. **The save census** (3,487 licensed ROMs, read in place): EEPROM 44.5 %, no save 26.8 %, SRAM/FRAM 19.9 %, Flash 64K 6.3 %, Flash 128K 2.5 %; 60 with the RTC; 46 name two save families; 138 are not a power of two in size. Every save type is needed for the games. 11. **The AGS aging cartridges are in the local set** (v7.0, v7.1, v9.0, v10.0 and the older AGB one), all with an EEPROM. On a fresh save, both detectors stop at "CHECK SUM ERROR! DEFAULT IS SAVED" and need the menu procedure. AGBEEG, the free re-implementation, passes on NBA and fails every group on mGBA. 12. **`mgba-headless` cannot be the referee as shipped**: it sets no video buffer, and its Lua cannot see the debug-port log. `scripts/mgba_driver.c` replaces it. It must be compiled with exactly the `-D` flags mGBA was built with, because `struct mCore`'s layout depends on them; with the wrong flags it crashes on the first call. 13. **The two detectors disagree on Flash chip IDs** (C7) and on ROM out-of-bounds reads (C5), each with a test to settle it.