# Provenance Every source the restarted Phase 0 (2026-11-19) used, its terms, and how it was used. The rules are [restart.md](restart.md) and the family [charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) ("Licences and provenance"); the verdicts follow emulator-lineage's `docs/sources.md`. **No emulator source was opened in writing these documents or scripts.** The archived `zzz-gba-python`, its GitHub repository, the memory file `gba-phase0-plan.md` and other sessions' scratch folders were not read. Nothing from the archive informs this work except what restart.md lists as carried over (the two ROM lists, the targets, and the first three commits' scripts). ## Documents (facts only unless the licence says more) | Source | Version | Terms | Verdict | How used | | --- | --- | --- | --- | --- | | GBATEK (Martin Korth) | 2025-04-16 revision (`reference/docs/gbatek.txt`, sha256 in `scripts/pinned_files.json`) | no licence stated, documentation | facts only | the main source for every document, cited by section; its quoted register tables are restated, not copied wholesale; code fragments (its BIOS disassembly, the solar-sensor example) were read as prose about behaviour, nothing taken | | CowBite Virtual Hardware Specifications (Tom Happ) | rev. 3.5, Wayback snapshot of 2026-07-12 | no licence, "free to read" | facts only | cross-checks: WAITCNT, H-draw/H-blank lengths, DMA rating table | | gbadoc (gbadev-org) | `35a281a` | CC0-1.0 | code OK | cross-checks and the contradictions noted (H-blank IRQ in V-blank, FIFO size, sound DMA burst, DMA mapping to FIFOs) | | ARM7TDMI Technical Reference Manual DDI 0029G | in arm7tdmi-python's fetched references | ARM document | facts only | bus cycle types (§3.3) as cited by the core's docstrings; not reread beyond that | | Tonc (gbadev-org) | `36b7def` | text CC BY-NC-SA | facts only | not used | ## Test suites (readable where permissive) | Source | Revision | Terms | Verdict | How used | | --- | --- | --- | --- | --- | | hw-test (fleroviux / nba-emu) | `fbc9914` | BSD-3-Clause | code OK (with notice) | sources and READMEs read for what each test measures and its expected values (quoted with attribution in timing.md, memory-map.md, video.md); ROMs run on the detectors; expected pictures viewed | | alyosha-tas `gba-tests` | `66f5f1d` | MIT (Julian Smolka's notice) | code OK (with notice) | readmes quoted; a few test sources read for structure (`prefetcher_full_thumb`, `Sprite_Disable_Midline`) and the shared library's `m_test_eval` (why r12 is not a verdict) | | jsmolka `gba-tests` | `a7113b6` | MIT | code OK (with notice) | README, unsafe/README quoted; `lib/macros.inc` read; `lib/glyphs.asm` read at run time by `scripts/judge_text.py` (not copied; the font is tonclib's per its comment) | | endrift's mGBA `suite` | `e694203` | MIT | code OK (with notice) | test tables read for what they expect (memory.c out-of-bounds values, timing.c modes); run as a judge | | destoer `gba_tests` | `d714cda` | MIT | code OK (with notice) | README, source comments and `.sav` files inspected; `lyc_midline/expected.jpg` viewed | | GBA-Test-Collection (ladystarbreeze) | `61527ec` | MIT | code OK | `retAddr` run; source not needed | | Hades-Tests | `206d550` | **GPL-2.0** (its LICENSE file was opened to check, nothing else) | run only | four ROMs run; README and sources left unread (sources.md said "check": now confirmed) | | PeterLemon/krom GBA | `efdb535` | none stated | run only | BIOS ROMs run, screens read | | ARMWrestler (destoer fix) | `802e55a` | none stated | run only | not run (interactive) | | FuzzARM (DenSinH) | `a675329` | GPL-3.0 | run only | prebuilt ROMs run | | mGBA `gbatests`, DUST | `c24b8e2`, `70738f1` | none stated | run only | file names listed only (source-only repositories; not built) | | AGBEEG aging cartridge (zaydlang) | v0.0.2 release ROM | "see repository" (not checked) | run only | ROM run on detectors | | Nintendo's AGS/AGB aging cartridges, Backup LIB sample | No-Intro dumps | Nintendo's copyright | run in place, never copied | located in `$NO_INTRO_DIR`; not run in Phase 0 | | Commercial ROMs (No-Intro GBA set) | local | makers' copyright | read in place | `scripts/count_saves.py` reads ID strings and sizes only | ## Emulators (closed boxes) | Source | Revision | Terms | Verdict | How used | | --- | --- | --- | --- | --- | | NanoBoyAdvance | 1.8.3, `8c3b159` | GPL-3.0 | closed box only | built by emu-tools-gpl's nanoboyadvance tool since 2026-11-25 (`scripts/build_referees.py --nba` runs it; built here before, no file opened) and run through our `nba_driver` (a GPL tool kept outside the repository since 2026-11-22, at `$EMU_TOOLS_GPL/tools/nanoboyadvance/build/gba/nba_driver`); results tagged OBSERVED | | mGBA | `fd9dc5c` | MPL-2.0 | closed box only | built headless and run through our `mgba_driver` (here as `scripts/mgba_driver.c` until 2026-11-25; since then built with mGBA by emu-tools-gpl's mgba tool); results tagged OBSERVED | | MAME | 0.285 | GPL-2.0+ / BSD-3 per file | closed box only | not run in Phase 0 | | SkyEmu, ares | pinned | MIT, ISC | code OK (with notice) | not read | | GBA_MiSTer, Hades, Normmatt's BIOS, GBAHawk/BizHawk | GBA_MiSTer `93790a02`, Hades `873d5c3e`, Normmatt `388c2f98` (unpinned 2026-11-24) | GPL / unlicensed | excluded from reading | not opened; not fetched since 2026-11-24 | ## The family's own cores | Source | Revision | How used | | --- | --- | --- | | arm7tdmi-python | `51bb589` | README.md and the docstrings of `ARM7TDMI`, `CPUState`, `access` (via `pydoc`); its other documents not read (restart.md rule 4: undocumented-behavior, timing, validation, handoff-brief excluded; docs/README, start-here, debugging, disassembly, provenance also left unread as outside "public interface") | | gb-apu-python | `7523b48` | README.md and docs/contract.md except "The AGB row" | ## The BIOS images Cult-of-GBA's BIOS (MIT, `a30e9a9`, its prebuilt `bios.bin`) and the player's own Nintendo dump (No-Intro, read in place from `$NO_INTRO_DIR`, unpacked only to a temporary file for the drivers). Neither is committed. ## Scripts written or changed in Phase 0 | File | Licence | Notes | | --- | --- | --- | | `scripts/judge_text.py` | MIT | new; reads jsmolka's `glyphs.asm` at run time, embeds nothing from it | | `scripts/count_saves.py`, `referee_run.py`, `build_referees.py`, `fetch_references.py`, `mame_run.py` | MIT | SPDX headers added; census default directory now `$NO_INTRO_DIR`-relative (no machine path) | | `scripts/mgba_driver.c`, `scripts/nba_driver/` | `mgba_driver.c` MIT; `nba_driver/` GPL-3.0-or-later (owner, 2026-11-20) | carried over from the archive's first commits; they link mGBA (MPL-2.0, file-level copyleft, so our own file can be MIT) and NanoBoyAdvance (GPL-3.0). Per charter rule 6 the built `nba_driver` is a GPL work and stays local. `nba_driver/` left the repository and its history on 2026-11-22 (below) and is found at `$EMU_TOOLS_GPL/tools/gba-python/nba_driver/` (`EMU_TOOLS_GPL` names a checkout of emu-tools-gpl; until 2026-11-24 the folder was named by `GBA_GPL_TOOLS`); both move to the family's tool repos (emu-tools / emu-tools-gpl) once the repos settle | ## The board, rungs 0-1 (2026-11-19) Written by the Specification agent from the documents in this folder and the sources below. **No emulator source was opened**, and nothing of the archive, its GitHub repository, the memory file `gba-phase0-plan.md` or other sessions' scratch folders was read. | Source | Terms | How it was used | | --- | --- | --- | | GBATEK (pinned) | facts only | §GBA System Control (HALTCNT) reread; everything else through this folder's documents | | hw-test (`fbc9914`) | BSD-3-Clause | test sources read for what each test does and expects: `lib/source/test.c`, `ui.c`, and `main.c` of timer/start-stop, timer/reload, dma/start-delay, dma/burst-into-tears, bus/128kb-boundary, irq/irq-delay, haltcnt; nothing copied; the console's tile = ASCII convention is read from the screen at run time | | endrift's mGBA `suite` (`e694203`) | MIT | read: `src/main.c` (how scores are drawn, `savprintf`), `src/mgba.c`, `src/io-read.c` (readable masks), `src/timing.c` and `include/macros.s` (the timing frame and expected rows), `src/timer-irq.c`, `src/timers.c`, `src/tests/*.s`. `tests/programs.py` re-expresses its START/END frame as instruction words and `tests/test_timing.py` takes expected values from `timing.c`: both carry its MIT notice | | alyosha-tas `gba-tests` (`66f5f1d`) | MIT | readmes (Bus, DMA, Interactions, irq, prefetcher, timer, timing) and the sources of `irq/IE`, `irq/IF`, `DMA/DMA_ROM_Fixed`, `DMA/DMA_pause_timing_mid_1`, `prefetcher/prefetcher_branch_thumb` read for what they measure; nothing copied | | jsmolka `gba-tests` (`a7113b6`) | MIT | `save/flash.asm`, `flash.inc`, `flash64/128.asm`, `sram.asm`, `none.asm` read for the save-type strings and expectations | | GBA-Test-Collection, PeterLemon/krom, Hades-Tests | MIT / none / GPL-2.0 | run only; screens read; no source opened | | arm7tdmi-python `69aceb2` | MIT (family) | README, and the docstrings of `ARM7TDMI`, its methods, `gba_access`, `access`, `CPUState`, `state` read through `inspect`; nothing else | | gb-apu-python `904c5d8` | MIT (family) | README, `docs/contract.md` outside "The AGB row", and the exported constant `READ_MASKS_AGB` (used, not copied) | | NanoBoyAdvance 1.8.3 driver | GPL-3.0, closed box | run once with the retail BIOS at frames 150-540 (`--reg r15`) to see when the BIOS reaches the cartridge; it showed the board's boot taking twice as long, which led to finding the board's own halt-release bug; no value was taken from it | New files in this stage carry `# SPDX-License-Identifier: MIT`. No outside code is in them; `tests/programs.py` and `tests/test_timing.py` add the mGBA suite's notice for the frame and the expected values they hold. ## The board, rung 2 (2026-11-21) Written by the Specification agent for rung 2 (saves and the clock). **No emulator source was opened**, and nothing of the archive, its GitHub repository, the memory file `gba-phase0-plan.md` or other sessions' scratch folders was read. | Source | Terms | How it was used | | --- | --- | --- | | GBATEK (pinned) | facts only | §GBA Cart Backup IDs, SRAM/FRAM, EEPROM, Flash ROM; §GBA Cart I/O Port (GPIO); §GBA Cart Real-Time Clock; §DS Real-Time Clock (the serial protocol, command table, register layouts) reread; facts restated in docs/cartridge.md and cited in the code | | Nintendo's Backup LIB Sample v1.04 | Nintendo's copyright | run in place from `$NO_INTRO_DIR` (unpacked only into the ignored `tests/referee_runs/` for the closed-box drivers); its screens read; nothing copied. Its own code was not disassembled | | Pokémon Emerald (USA, Europe) | Nintendo / The Pokémon Company copyright | run in place; its screens read (main menu or the battery message); its code was not disassembled, and no decompilation project was consulted | | mGBA, NanoBoyAdvance 1.8.3 drivers | MPL-2.0 / GPL-3.0, closed boxes | run on the sample and Emerald to see the menus and the two outcomes (mGBA has a clock, NBA's driver none); no value was taken from them | | jsmolka `gba-tests` `save/` | MIT | already judged at rungs 0-1 (sources read then); not reread | New files (`cartridge/rtc.py`, `cartridge/battery.py`, `scripts/board_saves.py`, `tests/test_saves.py`) carry `# SPDX-License-Identifier: MIT` and hold no outside code. ## Checks `provenance_check.py` (pcengine-python) was not run: no emulator source was open while the board was written. Run it before the board's first release. ## The board, rung 3 (2026-11-21) Written by the Specification agent. **No emulator source was opened**, and nothing of the archive, its GitHub repository, the memory file `gba-phase0-plan.md` or other sessions' scratch folders was read. NanoBoyAdvance was run only through our `nba_driver` (closed box); its pictures are compared dot by dot and tagged `OBSERVED`; no rule was changed toward it. | Source | Terms | How it was used | | --- | --- | --- | | GBATEK (pinned) | facts only | §LCD I/O Display Control through §LCD Color Palettes reread; every rule in `ppu/line.py` cites its section | | Tonc (`36b7def`) | text CC BY-NC-SA, facts only | `content/lab.md` §24 "The object-priority bug" and `regobj.md` attribute 2 read as prose (U-VID-12); no code taken | | gbadoc (`35a281a`) | CC0-1.0 | `registers.md` "Priority" (the contradiction in U-VID-12) | | hw-test (`fbc9914`) | BSD-3-Clause | `ppu/bgpd`, `bgx`, `dispcnt-latch`, `greenswap`, `sprite-hmosaic` sources and READMEs read for what they draw; their expected pictures measured by `scripts/hw_pictures.py` (read at run time, nothing copied) | | alyosha-tas `gba-tests` (`66f5f1d`) | MIT | `ppu/Sprite_Disable_Midline.asm`, `Sprite_Last_VRAM_Access.asm`, `stripes.asm` read for what they set up | | jsmolka `gba-tests` (`a7113b6`) | MIT | `ppu/shades.asm` read (it uses no colour effects) | | destoer `gba_tests` (`d714cda`) | MIT | `window_midframe/source/window.s` comment and `expected.png` (an emulator-sized 240x160 image) viewed | | GNU Arm toolchain 14.3 (pinned under `reference/tools/`) | GPL (a tool; running it does not touch our licence) | builds `tests/scenes/*.c`, our own MIT programs; no library code is linked except libgcc's runtime (GCC runtime exception) | New files (`ppu/line.py`, `scripts/board_pictures.py`, `scripts/hw_pictures.py`, `scripts/build_scenes.py`, `tests/scenes/*`) carry `SPDX-License-Identifier: MIT` and hold no outside code. ## The board, rung 6 (2026-11-23) Written by the Specification agent for rung 6 (the aging cartridges). **No emulator source was opened**, and nothing of the archive, its GitHub repository, the memory file `gba-phase0-plan.md`, arm7tdmi-python's `docs/handoff-brief.md` or other sessions' scratch folders was read. | Source | Terms | How it was used | | --- | --- | --- | | Nintendo's AGS Aging Cartridge v7.0, v7.1, v9.0, v10.0 and AGB Aging Cartridge (No-Intro) | Nintendo's copyright | run in place from `$NO_INTRO_DIR` (unpacked only into ignored or scratch folders for the closed-box drivers); their screens read. Their code was neither disassembled nor read: what a failing test does was learned by logging the I/O register writes and some RAM writes (the result text buffer in IWRAM, the DMA tests' EWRAM buffers) the board saw while it ran (a logic analyser's view of the I/O bus), and the test located by when its result mark was written | | GBATEK (pinned) | facts only | §GBA DMA Transfers (Video Capture Mode, "Capture Enable=AutoCleared ???"), §GBA Keypad Input (KEYCNT) reread | | alyosha-tas `gba-tests` (`66f5f1d`) | MIT | `fifo_dma/*.asm` and `DMA/DMA_pause_timing_mid_1.asm` read for what they measure and expect (the FIFO DMA timing study) | | NanoBoyAdvance 1.8.3, mGBA `fd9dc5c` drivers | GPL-3.0 / MPL-2.0, closed boxes | run on the five cartridges for their result screens (`OBSERVED`), and mGBA's `--word` read EWRAM after AGS DMA test 9 (the timer values its two DMAs wrote); no rule was changed toward either | New file `scripts/board_aging.py` carries `# SPDX-License-Identifier: MIT` and holds no outside code. ## History rewrite (2026-11-22) The history clean-up (wave E) rewrote this repository's history with `git filter-repo`, keeping every commit: the owner's full name in commit metadata became the handle, and `scripts/nba_driver/` (our driver linking NanoBoyAdvance, GPL-3.0-or-later) was removed from every commit and is kept outside the repository. `scripts/build_referees.py --nba` builds it from `$EMU_TOOLS_GPL/tools/gba-python/nba_driver/` (named by `GBA_GPL_TOOLS` until 2026-11-24), passing the pinned tree as `NBA_ROOT`; the rebuilt driver gives byte-identical output. Commit hashes cited in these documents from before that date refer to the old history, which is kept privately. ## Closed-box sources removed (2026-11-24) Aubrey's rule of 2026-11-24: an MIT repository does not download or keep the source of anything the family's `sources.md` marks closed box only, unless it is built into a program with no shipped build. Three pins that nothing built were removed and their trees moved aside unopened, out of the repository (not deleted): Hades (https://github.com/hades-emu/Hades @ `873d5c3e91a89697c15536701e5f667d86e69570`, GPL-2.0), GBA_MiSTer (https://github.com/MiSTer-devel/GBA_MiSTer @ `93790a023395bbd90e5eaf4dfb2cb5910afd55f5`, GPL-2.0) and Normmatt's BIOS (https://github.com/Normmatt/gba_bios @ `388c2f98ba7236de92bd9b5bca02a47f824abee3`, no licence). Hades-Tests (run only) stays. **Kept, with a question for Aubrey:** NanoBoyAdvance (`8c3b159`) and mGBA (`fd9dc5c`): the drivers link their cores (`build_referees.py --nba`, and `libmgba.a` with `mgba-headless`), and no shipped build provides those pieces. Never opened (restart.md rule 1). Whether their builds and pins move to emu-tools-gpl beside the NBA driver is open; `scripts/mgba_driver.c` links MPL-2.0 code and is itself a tool kept here. Aubrey's answer (decisions page T3, 2026-11-25): both move, one tool at a time. Both moved on 2026-11-25 (below). ## NanoBoyAdvance's build moved to emu-tools-gpl (2026-11-25) Decisions page T3: NanoBoyAdvance's pin (`8c3b159`, v1.8.3) and the `nba_driver` build moved to emu-tools-gpl's `tools/nanoboyadvance` (nanoboyadvance-drivers 0.1.0, GPL-3.0-or-later: `build.py --machine gba`, the same pin, the same CMake/Ninja Release build of the same driver source). `scripts/build_referees.py --nba` runs that build as a program, and `scripts/referee_run.py --emu nba` runs `$EMU_TOOLS_GPL/tools/nanoboyadvance/build/gba/nba_driver`. The pin left `scripts/pinned_repos.json`. Moved unopened to a backup outside the repository (not deleted): `reference/src/NanoBoyAdvance`, `reference/build/nba` (the driver, sha1 `b0e0e835`) and `reference/build/nba.old-2026-11-23`. Identity check, 2026-11-25, with Cult-of-GBA's MIT BIOS: the old and new drivers on jsmolka's `arm.gba` and `thumb.gba` (600 frames, `--reg r12`, `--png`) and arm7tdmi-python's `thumb_undefined.gba` (`--sram`, `--png`) give byte-identical output, pictures and save memory; and `scripts/referee_run.py r12 --emu nba` (143 ROMs, 300 frames each) gives the same JSON before and after, 79 of 143 passing (OBSERVED). ## mGBA's build moved to emu-tools-gpl (2026-11-25) Decisions page T3: mGBA's pin (`fd9dc5c`, MPL-2.0), Lua 5.4.7 (MIT, which only mGBA's build used), our `scripts/mgba_driver.c` (MIT) and the build of all three moved to emu-tools-gpl's `tools/mgba` (mgba-tools 0.1.0: `build.py --machine gba`, the same pins, the same CMake switches and the same driver compile with mGBA's own defines). `scripts/mgba_driver.c` left the tree (it is that tool's `mgba_driver/mgba_driver.c`); `scripts/build_referees.py` now only runs the two tools' builds as programs; `scripts/referee_run.py` (and `judge_text.py` through it) runs `$EMU_TOOLS_GPL/tools/mgba/build/gba/mgba_driver`. The mGBA pin left `scripts/pinned_repos.json` and Lua's left `scripts/pinned_files.json`. Moved unopened to a backup outside the repository (not deleted): `reference/src/mgba`, `reference/build/mgba` (the driver, sha1 `96e5223b`), `reference/build/lua`, `reference/tools/lua-5.4.7` and its tarball (Lua is MIT and could have stayed, but nothing here uses it any more). Identity check, 2026-11-25, with Cult-of-GBA's MIT BIOS: the old and new drivers on jsmolka's `arm.gba`, `thumb.gba` and `memory.gba` (600 frames, `--reg r12`, `--png`) and arm7tdmi-python's `thumb_undefined.gba` (`--sram`, `--png`) give byte-identical output, pictures and save memory; `scripts/referee_run.py r12 --emu mgba` (143 ROMs) gives the same JSON before and after, 59 of 143 passing (OBSERVED). No closed-box build is left here.