# Provenance ## Licence provenance (audit 2026-11-13) Audit against the family charter: an MIT project takes nothing copied or transcribed from GPL/LGPL code, and GPL emulators are run as closed boxes, their source not opened while writing the code it would inform. This repository's own rule (validation.md "Licences, and what may be copied") was "GPL sources read for facts, cited by file, never copied"; the charter is now stricter. The audit found **no board code whose behaviour rests on GPL source**: ANTIC, GTIA and the board are written from the Altirra Hardware Reference Manual, ijor's die-derived ANTIC schematics, Atari's manuals and data sheets, and judged by Acid5200 (MIT) and Atari's diagnostic cartridges. GPL sources appear only in the documentation, explaining where a detector differs. The audit read this repository's files, commits and pin records only; MAME file licences were read from the files' first two lines (ANTIC, GTIA, `atari400.cpp`: GPL-2.0+; `bus/a800/bbsb.cpp`, `a5200_supercart.cpp`, `rom.cpp`, `sound/pokey.cpp`: BSD-3-Clause). No Atari800, Altirra, MAME-GPL or MiSTer source was opened. **Firmware:** no BIOS is shipped. `bios.py` reads the player's own copy by SHA-1 and never copies it. (House-rule note, not a licence matter: `bios.py` `DEFAULT_PLACES` names a machine path and a mirror; the family rule is an environment variable.) | Module | Behaviour source | Licence of source | Verdict | | --- | --- | --- | --- | | `antic.py` | [AHRM] ch. 4 (Avery Lee, all rights reserved, free to read: facts), [IJOR] ANTIC schematics from the die (no licence stated: facts), [DS-A] | documents | clean | | `gtia.py` | [AHRM] ch. 6 (priority equations, Table 18 delays), [DS-G]; delays tuned by Acid5200 tests | documents; MIT tests | clean | | `board.py`, `machine.py`, `system.py` | [FSM], [HM], [AHRM] ch. 13 memory map | documents | clean | | `controllers.py` | [AHRM] 13.3, [FSM] Figure 1-6, [BUCH], [FAQ]; pokey-python's RC helper (since 2026-11-14 the restarted core's `PotRC`, below) | documents; family core | clean | | `media.py` | computed YIQ palette ("a frontend choice"), PNG/WAV writers | own | clean | | `acid.py` | runs Acid5200 (MIT) and reads its results | MIT | clean | | `state.py`, `debug.py` | own | own | clean | | `bios.py` | bring-your-own by SHA-1 ([AHRM] F.2 hashes) | facts | clean (see house-rule note) | | `cartridge/walk.py` | own static walk ("no emulator's detection code is used") | own | clean | | `cartridge/__init__.py` | CART header type numbers from [A800] `DOC/cart.txt` (a documentation file in a GPL project: a list of numbers, a format fact) | facts | cite: say in the comment that only the documented numbers are used | | `cartridge/mappings.py` | Bounty Bob and Super Cart from [A800] `DOC/cart.txt` (prose, citing the board designer's post) and MAME `bus/a800/bbsb.cpp`, `a5200_supercart.cpp` | doc facts; MAME files BSD-3-Clause | clean (cite the BSD-3 licence of the two MAME files beside the citation) | | `cartridge/table.json` | MAME 0.285 `hash/a5200.xml` and `.hsi` (CC0-1.0, per file), measured rows from `scripts/observed_boot.py`; three `bios_notes` cite "[MAME] atari400.cpp comment; [AHRM] F.2" | CC0; own; one GPL-file comment beside [AHRM] | cite: let [AHRM] F.2 carry the 4-port-BIOS note alone | | `scripts/atari800_run.py` (until 2026-11-22; History below), `compare_atari800.py`, `sweep_atari800.py`, `mame_trace.py`, `lockstep_mame.py` | drive Atari800 (GPL-2.0+) and MAME as closed boxes | own tools | clean | | `scripts/count_carts.py`, `build_cart_table.py`, `dma_charts.py` | own; read MAME's CC0 hash files and the [AHRM] PDF | own | clean | | docs: undocumented-behavior.md C12 (`memory.c`), C15 (MAME `antic.cpp` line numbers) | GPL source read to explain detector differences; the board follows [AHRM] and Acid5200 | GPL (documentation only) | cite: from now on describe detectors by running them, not by their source | **Counts (rows):** clean 13, cite 4, rewrite 0, unclear 0. ## Wave 2 (specification-tier close-out, 2026-11-13) **Rewrites:** none. Wave 1 found no **rewrite** row (counts above), so no board behaviour had to be re-derived and no value changed. **The one Altirra fact.** Altirra's `cartdetect.cpp` (GPL-2.0+) is present in the ignored `reference/research-tmp/altx/` (extracted by Phase 0 on 2026-11-11, never committed). One fact was recorded from it: that Altirra decides a 16K image's class by tracing from the start vector under both readings and scoring them. That fact rests on the GPL source alone: no document in `reference/` states it ([AHRM] describes hardware, not Altirra's loader), and Altirra cannot be run here as a closed box (Windows only, no Wine: undocumented-behavior.md U12). So it is **withdrawn**, not re-established: [cartridge.md](cartridge.md) now says "not established here". Nothing depends on it: the walk (`cartridge/walk.py`) is this repository's own algorithm, judged by its results (0 contradictions against the 60 16K images MAME's CC0 list classifies; 1 wrong of the 39 observed boots). The file was not opened in this session. The Atari800 row beside it (raw 16K images carry no type) was also read from GPL source in Phase 0; it is marked HYPOTHESIS there for the same reason, and nothing depends on it either (every Atari800 run passes `-cart-type`). **The cite rows** are handled with the licence headers (scope item 3, same date): | Wave-1 cite row | What was done | | --- | --- | | `cartridge/__init__.py` CART type numbers from [A800] `DOC/cart.txt` | the comment now says only the documented type numbers (a format fact) are used, nothing of Atari800's code | | `cartridge/mappings.py` Bounty Bob and Super Cart from MAME `bus/a800/bbsb.cpp`, `a5200_supercart.cpp` | the BSD-3-Clause licence and copyright holders are named beside the citation; the notice is in NOTICE | | `cartridge/table.json` bios_notes citing a MAME GPL-file comment | the three notes now rest on [AHRM] F.2 (mechanism) and this repository's own milestone 6 runs (the titles); `build_cart_table.py` writes the new text; the CC0 seed is attributed in the file's `about` and in NOTICE | | undocumented-behavior.md C8, C12, C15 (GPL source line references) | the source references are replaced by what a closed-box run shows, or marked as Phase 0 source reading where no run replaces them | **Permissive material kept**, all listed with its notice in `NOTICE`: MAME's `hash/a5200.xml` and `hash/a5200.hsi` (CC0-1.0; the seed rows of `cartridge/table.json`, attribution kept although CC0 asks none); facts restated from MAME's BSD-3-Clause `bus/a800/bbsb.cpp`, `a5200_supercart.cpp`, `a800_slot.cpp`; the Acid800 suite (MIT, Avery Lee: `acid.py` relies on its label names and verdict codes; the ROMs are fetched, never committed). **Historical records kept as written:** docs/handoff-brief.md and docs/phase0-progress.md are Phase 0's dated record and keep their source references and machine paths; they are not instructions. docs/mame-oracle.md's description of MAME's ANTIC timing was Phase 0 source reading (2026-11-11) and is labelled so there. ### History No files were ever deleted (`git log --all --diff-filter=D`); nothing fetched was committed (`reference/` is ignored). Local repository, no remote. ## The POKEY core: the restarted pokey-python (2026-11-14) The pokey-python this board pinned until 2026-11-14 (`5a06587`, then `e276d27`) was archived that day for provenance: its build had read an unlicensed VHDL's source. It was rebuilt from documents (Atari's data sheet, [AHRM] ch. 5, Acid800, recordings) and closed-box measurements of the VHDL model's pins (pokey-python `docs/restart.md`, `docs/provenance.md`). The board now pins the restarted core at **`6ed1ffa`** (`pyproject.toml`), the commit its `docs/status.md` names for boards, and is wired as its `docs/adoption.md` says. Neither venv holds the old core any longer: it was uninstalled before the new pin was installed, and its files were not opened to compare. The board's glue was adapted from adoption.md alone (`board.py`: `POKEY(C012294)`; `controllers.py`: the core's `rc.PotRC` helper on `pot_level` and `on_dump`; `state.py`: save-state version 3 with the capacitors' charge). The archived core's code reached the board only through its interface; no board code was derived from its source, so nothing in `src/` needed re-deriving beyond the call sites. `controllers.py`'s row above now reads "the restarted pokey-python's RC helper (`PotRC`, its B5.8)". ### Sources not to use for code MAME's ANTIC/GTIA/`atari400.cpp` (GPL-2.0+), Atari800 (GPL-2.0+), Altirra's source (GPL-2.0+): closed box only. MiSTer `Atari800_MiSTer` a8core files carry Mark Watson's "non-commercial use" notice: not open source, excluded for code. MAME's `sound/pokey.cpp` and `bus/a800/*` are BSD-3-Clause: code OK with notice. ## History rewrite (2026-11-22, wave G) The family's history clean-up (wave G) removed `scripts/atari800_run.py` from every commit with `git filter-repo`; every other change kept its commit. The script declares libatari800's C API through ctypes (the key codes and state-block offsets of its public header), so by the family's rule of 2026-11-19 it is a GPL tool, like the Mesen2 drivers moved out of famicom-python and snes-python. It is kept with the family's other GPL tools (emu-tools-gpl, `tools/a5200-python`). On 2026-11-24 it moved to the GPL-2.0-only tool repository `emu-tools-gpl2` (parts of libatari800 as built are GPL-2.0-only, and the driver loads the library into its own process). `compare_atari800.py` and `sweep_atari800.py` run it at its fixed path, `$EMU_TOOLS_GPL2/tools/atari800/atari800_run.py` (one variable per tool repository, emu-tools `docs/contract.md` section 5; the old `A5200_GPL_TOOLS` is retired), with this checkout as `A5200_PYTHON_ROOT`, and stop with status 3 when `EMU_TOOLS_GPL2` is unset. Run it by hand from this checkout as `python "$EMU_TOOLS_GPL2/tools/atari800/atari800_run.py" CART ...`. Commit hashes cited 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. Moved aside unopened, out of the repository, not deleted: - the MiSTer core, https://github.com/MiSTer-devel/Atari800_MiSTer @ `87b8f4093f18b859dc619608161a2c5f3f677609` (Mark Watson's non-commercial notice): pin removed; - Altirra 4.40's source archive, https://www.virtualdub.org/downloads/Altirra-4.40-src.7z (SHA-256 `77ff8057e92c17127cc1f5b70084f11ac13d56d6c896d2439b52574deec961ca`, GPL-2.0+): removed from `scripts/pinned_files.json`; - MAME's GPL-2.0+ files from the `mame0285` sparse checkout (`f379cd060ac3`): `src/mame/atari/atari400.cpp`, `antic.*`, `gtia.*` and `src/devices/bus/a800/atarifdc.*` (no longer in the sparse list; the BSD-3 cartridge devices, POKEY and the CC0 hash files stay). Nothing built from them. docs/mame-oracle.md's Phase 0 description of MAME's insides lost its internal names and is marked HYPOTHESIS where it rests on that reading; validation.md's quote of a driver comment (file and line) became the three titles, marked HYPOTHESIS. **Kept, with a question for Aubrey:** Atari800 (`reference/src/atari800` at `98cc2dc`, GPL), because libatari800 has no shipped build and the detector is built from it by hand (docs/validation.md, "Atari800 build recipe"); the built library lives outside the tree at `reference/build-atari800/libatari800.so`. Its code is never opened; `DOC/cart.txt` is documentation. Whether the build and its pin move to emu-tools-gpl2 beside the driver is open. Aubrey's answer (decisions page T3, 2026-11-25): they move; done on 2026-11-25 (below). ## libatari800's build moved to emu-tools-gpl2 (2026-11-25) Decisions page T3: libatari800 is now built by emu-tools-gpl2's `tools/atari800` (atari800-build 0.1.0, GPL-2.0-only: `build.py`, the same pin `98cc2dc` and the recipe this repository's docs/validation.md gave, written as a script), at `$EMU_TOOLS_GPL2/tools/atari800/build/libatari800.so`, which the driver there (`atari800_run.py`) now loads by default. The pin left `scripts/pinned_repos.json`. Moved unopened to a backup outside the repository (not deleted): `reference/src/atari800` (the checkout) and `reference/build-atari800` (the hand build, with its library, sha1 `61fb4f41`). Identity check, 2026-11-25: the tool's library is byte-identical to the hand-built one (sha1 `61fb4f41` both), and `atari800_run.py` on Pac-Man (USA) and Ms. Pac-Man (USA), 600 frames, every 60th reported, `--pgm` and `--wav`, gives the same report, picture and sound with either (the report's two "wrote" lines aside, which name the output files; OBSERVED). No closed-box build is left here.