# Restart rules This repository is a restart. The earlier `gba-python` was written with NanoBoyAdvance 1.8.3's source (GPL-3.0) open: its modules followed NanoBoyAdvance's structure and named its functions (the 2026-11-13 provenance audit, family wave 1). On 2026-11-19 the owner chose a clean rewrite over relicensing it GPL. The old repository is archived as `zzz-gba-python` (GitHub `alewman/zzz-gba-python`, private, archived; locally `/data/emu/zzz-gba-python`). This one restarts from its first three commits, which hold only the pinned references, the fetch script, the save census and the closed-box drivers for mGBA, NanoBoyAdvance and MAME: - `c6f6491` pin the references, test ROMs and tools - `dc8f290` the referee builds and drivers (harnesses that run the emulators as closed boxes) - `2f10615` the save census script Everything else (the Phase 0 documents, the board, its tools and tests) is rebuilt under these rules. ## The rules 1. **No GPL, LGPL, MPL or unlicensed source is read.** Not to learn a mechanism, not to check a constant, not to settle a doubt. For this machine that covers NanoBoyAdvance, mGBA (MPL-2.0: file-level copyleft, so closed box only), Hades, GBA_MiSTer, FuzzARM's source, MAME's GPL files, Normmatt's BIOS, GBAHawk/BizHawk's C++ cores (no licence on the files; their repository calls them "a minefield"), and anything `/data/emu/emulator-lineage/docs/sources.md` lists as closed box only. The checkouts sit under `reference/src/` because the drivers are built from them: building is allowed, opening a file is not. 2. **The archived repository is not read**, in any form: not its code, tests, tools, documents or commit messages, locally or on GitHub; nor the owner's old notes about it (the memory file `gba-phase0-plan.md`); nor anything written by a session that worked on it, including scratch folders under `/tmp`. The only things taken from it are listed under "Carried over" below. 3. **Translating a program statement by statement is copying**, whatever the language. 4. **Permitted sources** (cite section and version): - GBATEK (Martin Korth; facts only), CowBite (Tom Happ; facts only), gbadoc (CC0), Tonc (facts only; its text is CC BY-NC-SA), ARM's ARM7TDMI data sheet and TRM. - Test suites whose source is permissive: jsmolka `gba-tests` (MIT), alyosha-tas `gba-tests` (MIT; its readmes say "tested on GBP": hardware facts in prose), `hw-test` (BSD-3-Clause; hardware results), the mGBA `suite` (MIT), destoer `gba_tests` (MIT), GBA-Test-Collection (MIT). Their sources and readmes may be read, with their notices kept beside anything taken. - Test programs with no stated licence or a copyleft one (ARMWrestler, PeterLemon/krom, DUST, FuzzARM, mGBA `gbatests`, Hades-Tests unless its licence is confirmed) are run, not read. - Permissive emulators, readable with their notice: SkyEmu (MIT), ares (ISC), MAME's BSD-3-Clause GBA files (check each file's first line). A behaviour learned there is an emulator fact (OBSERVED tier, named), not a hardware fact. - The cartridges' own code, Nintendo's aging cartridges and Backup LIB sample (run). - The CPU is arm7tdmi-python and the Game Boy sound channels gb-apu-python (its AGB row), pinned by revision; they are audited in their own repositories, with their own open items (arm7tdmi-python's audit found NBA-described behaviour in its documents). Use them through their public interfaces: their READMEs, `gb-apu-python/docs/contract.md` except its section "The AGB row" (which describes other emulators' code), and the docstrings of what you call. Do not read their `docs/undocumented-behavior.md`, `docs/timing.md`, `docs/validation.md` or `docs/handoff-brief.md`, which describe other emulators' code paths and the archived board. A core behaviour the board needs changed is reported to the owner, not patched here. 5. **An emulator may be run, never read.** NanoBoyAdvance, mGBA and MAME are built and driven through the drivers here. Owner's rulings of 2026-11-13: a closed box may be a detector and a measuring instrument; a value got that way is tagged `OBSERVED` (emulator and revision named), and a document, a hardware test or a hardware result that disagrees overrules it. 6. **A difference from a closed box is written down, not fixed**, unless a document or a hardware-calibrated test independently says the board is wrong; then cite that. 7. **Every rule in the code names its source** with an evidence tag (MEASURED, TEST ROM, DOC, OBSERVED, FITTED, HYPOTHESIS). 8. **The middle rule.** A fact is usable when someone established it on real hardware and says so in prose; cite them. Code fragments in any document stay unread. 9. **An author who objects to AI use of their work is left out**, even where the licence would allow it. ## Carried over (owner's decision, 2026-11-19) Copied from the archive by the session that set up the restart; nothing else was: - `tests/smoke_set.txt` (39 commercial ROMs) and `tests/games_set.txt` (57), with their checkpoint frames and key scripts; the free-text reason column was dropped. - The archived board's judge scores, as targets only (`docs/handoff-brief.md`). They say how far a board got, not how; a target the rebuild does not reach is reported, never chased by guessing. ## The order of work 1. Phase 0 again, from the permitted sources: the hardware documents and the plan (`docs/handoff-brief.md`). 2. The board, rung by rung, judged as the brief says. 3. The charter's obligations: SPDX headers, LICENSE and NOTICE, the lineage line, `docs/status.md`, evidence tags, `docs/provenance.md`. If you meet a source whose licence or author's wishes you are unsure of, stop and report.