# Provenance (licence audit, 2026-11-13) What each part of the board was learned from, the licence of that source, and whether the code may carry the MIT licence. The standard is the family charter's "Licences and provenance": nothing copied or transcribed from GPL, LGPL or unlicensed code; facts (register maps, timings, measured results) are not code; permissive sources are used with their notice kept. ## How this audit was done From the repository's own records only: docstrings and comments, `docs/`, commit messages, `scripts/pinned_repos.json` and `scripts/pinned_files.json`. The only reference files opened were the licence header lines of the pinned MAME files (all `license:BSD-3-Clause`). No GPL source (Gearcoleco, openMSX, the MiSTer core's `vdp18`) was opened for this audit. **Working practice before this audit.** The Phase 0 and milestone work read GPL emulators (Gearcoleco, openMSX, the MiSTer core) as documentation ("read and cite only; never copy" in the pins). The charter now says a GPL project's source is not opened while writing the code it would inform. The places where that matters are listed below as `unclear` where the code could have followed such a source. ## Package (`src/colecovision_python/`) | Module | Behaviour from | Source licence | Verdict | | --- | --- | --- | --- | | `board.py`, `system.py`, `sockets.py`, `machine.py` | Coleco Technical Manual, Boris's and the KiCad schematic tracings, TI data manuals; MAME 0.285 run as a closed-box lockstep detector (`mame_options()` reproduces its choices as measured) | manuals: facts; MAME: run only | **clean** | | `machine.py` `MAME_NTSC_VDP_PHASE`, `mame_video_rounding`, start registers | measured from MAME's trace (closed box) | run only | **clean** | | `audio.py` | own mixer over sn76489-python (the restarted, clean core, pin `c0d88a6`) | MIT | **clean** | | `video.py` | RGB derived here from TI's table 2-3 levels (`tms9918_python.LEVELS_9928A`) | TI data manual: facts | **clean** | | `pictures.py` `DETECTOR_PALETTE` | 16 RGB triples quoted from MAME `tms9928a.cpp` `tms9928a_palette` (l. 695-713) to read detector PNGs back to indices; also equal to Gearcoleco's table | MAME file: BSD-3-Clause | **cite**: name MAME's BSD-3-Clause licence and keep its notice beside the table; drop "= Gearcoleco Video.h kPalette_888_coleco" as a source (it is GPL-3.0; saying the values agree is a fact, but the table must be credited to the BSD source only) | | `controllers.py` (hand controller matrix, spinner, Super Action, driving module) | docs/controllers.md; MAME `coleco.cpp`, `coleco_m.cpp` "comment and code, tier 5" | BSD-3-Clause | **cite**: MAME's BSD-3-Clause notice owed (a NOTICE file listing the MAME files read) | | `cartridge.py` standard board | Technical Manual; MAME `std.cpp` for open bus | manual: facts; BSD-3-Clause | **clean** (MAME named) | | `cartridge.py` `MegaCart`, `ActivisionCartridge`, `SerialEEPROM`, `cartridge_for` | **rewritten clean-room 2026-11-26** (below, "Mapper rewrite") from documents only: colecovision.dk, CVBasic (BSD-2-Clause, facts), rc2014-cv-megacart-ram, cvaddict.com, AtariAge posts (second-hand), Microchip 24LC02B/24LC256 data sheets; `XinOneCartridge` removed (no permitted document) | documents: facts | **clean** | | `images.py` | file loading; BIOS by `$COLECO_BIOS` | own | **clean**, but see "Other findings" (machine paths) | | `mame_log.py` | reader for our own MAME trace format | own | **clean** | ## Scripts, tests, data - `scripts/*` run MAME, Gearcoleco and libretro cores as programs (closed box): **clean**. - `tests/detectors/*`, `tests/smoke/*`: our census and sweep results, no third-party data: **clean**. - No ROM, BIOS or third-party binary is tracked (`git ls-files`). ## Dependencies `z80-python` (M1-hook branch), `tms9918-python`, `sn76489-python` `c0d88a6` (the restart of 2026-11-12, clean). The board never pinned the archived Nuked-derived sn76489 (history of `pyproject.toml`). Cores are audited separately. ## Git history No removed file or reverted change that came from elsewhere (`git log --all --diff-filter=D`, commit messages). Local repository, no remote. ## Other findings (not licence, but the house rules) - Machine paths with the mirror's name in `src/colecovision_python/images.py` (l. 19-20), `scripts/mame_frames.py`, `scripts/mame_trace.py`, `scripts/make_sweep_list.py`, `scripts/psg_sweep.py`, `scripts/count_carts.py`, `docs/mame-oracle.md`, `tests/detectors/census-nointro.txt`: should become `NO_INTRO_DIR` / `MAME_ROMPATH` before any push. - No SPDX headers yet (family-wide pass owed). ## Owed 1. A `NOTICE.md` with MAME's BSD-3-Clause notice (files: `tms9928a.cpp`, `coleco.cpp`, `coleco_m.cpp`, `bus/coleco/cartridge/*`). (ColecoDS's credit is no longer owed: its terms are non-commercial, and the code read beside it was rewritten, 2026-11-26.) 2. `pictures.py`: credit the palette to MAME only. 3. ~~Settle `MegaCart`~~: settled by the clean-room rewrite of 2026-11-26. Verdicts: 10 clean, 3 cite, 1 unclear, 0 rewrite. (2026-11-26: the unclear row is rewritten and clean: 11 clean, 3 cite.) ## 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: - Gearcoleco, https://github.com/drhelius/Gearcoleco @ `2805e70fd56c3bb6a0412a4ddaf210eefc8a5d7c` (GPL-3.0): pin removed. The libretro core built inside that tree (sha1 `684db6e34a64bb5d2e7352acf5dbfa98028ee412`) was copied first to `reference/build-gearcoleco/`, where `scripts/smoke_pictures.py` now loads it (or `GEARCOLECO_CORE`); a fresh checkout uses a shipped libretro build. - openMSX's source files (VDP, sprite checker, access slots, MegaCart, Super Game Module, joystick), from https://github.com/openMSX/openMSX @ `45f1726029658b996680f2629f37a81dcd2b0ff2` (GPL-2.0): the pin keeps only `doc/internal/vdp-status-race*`, hardware result files. - ColecoVision_MiSTer @ `084cf4c88a857812857ea859ec01b507b3641f0c`: everything but Arnim Laeuger's BSD-noticed `rtl/cv_*.vhd` and the README (the GPL `vdp18`, the MiSTer framework, unnoticed files); the pin is narrowed to those. Passages rewritten: `pictures.py` (Gearcoleco's palette symbol and file: now MAME's BSD table, with Gearcoleco's output OBSERVED to match, which settles owed item 2); `cartridge.py` and docs/cartridge.md (openMSX's MegaCart file and quoted comment: HYPOTHESIS); docs/expansion.md (Gearcoleco's port handler: HYPOTHESIS); docs/vdp.md (openMSX's `VDP.cc` comment, kept as what the source said, no file name). For review: those HYPOTHESIS marks. ## Mapper rewrite (clean room, 2026-11-26) **Why.** The provenance wave 2 (2026-11-25, emulator-lineage `docs/sources.md` ColecoDS row) found that the banked boards in `cartridge.py` were written with ColecoDS's source open. ColecoDS's terms are non-commercial (its README allows copying "as long as there is no commercial use"; its Z80 and TMS9918 come from ColEM), so it is closed box only, not the "permissive with credit" this file said. Aubrey approved a clean-room rewrite on 2026-11-26. **What was identified as tainted, without reading it.** From this file's row, the worklog's M5/M6 entry and `grep -n` for `def`/`class` lines and call sites only: `MegaCart`, `XinOneCartridge`, `SerialEEPROM`, `ActivisionCartridge` and `cartridge_for` (everything in `cartridge.py` after `PlainCartridge`), and their tests in `tests/test_cartridges.py`. The Cartridge protocol, `NoCartridge` and `PlainCartridge` (Technical Manual) were kept. Call sites: `system.py` (`cartridge_for`), `board.py` (`read`/`write`/`peek` only). **What the rewriter saw of the old work.** No body of the old classes and no diff or history of them. Seen by accident or by the comparison: one-line `grep` hits in the docs (docs/cartridge.md's three board-table rows, docs/claims.md's two rows, docs/results.md's M6 paragraph), the old tests' names, their import and `cartridge_for` lines (from a `grep`), the old Activision test's lines 51-57 (shown to read the failing assertions) and its two lines that read `$FF80` (a `grep`). The old docs/cartridge.md "Board types" section was replaced without being read past those grep lines. **Sources** (licences per emulator-lineage `docs/sources.md`; rows owed for the new ones): | Source | Terms | Used for | | --- | --- | --- | | Coleco Technical Manual (`reference/docs/`) | facts | the slot has no /RD, /WR or reset; the header test at `$8000` (unchanged) | | colecovision.dk, Bryan Edewaard's MegaCart page | no licence; facts only | 16K fixed + 16K switched; 128K-1M; no 64K board | | CVBasic (Oscar Toledo G.), `manual.txt`, `cvbasic.c`, `cvbasic_prologue.asm`, master on 2026-11-26 (sha256 `8f125a72...` manual, `90b6e081...` cvbasic.c, `fdf86db3...` prologue) | BSD-2-Clause (its LICENSE.txt) | MegaCart layout: fixed bank at size - 16K, bank n at `$C000` selected by reading `$FFC0 | n` masked to the size, top 64 bytes left unused, the start-up read of `$FFC0`. Facts only: no code taken | | ezod/rc2014-cv-megacart-ram README | no licence; facts only | the MegaCart's power-on bank 0, fixed last bank, read-triggered switch | | cvaddict.com, Eric Chartre's open MegaCart PCB article | all rights reserved; facts only | a 64K game is built doubled into 128K | | AtariAge topic 327053 (kevtris's register list) and the Team Pixelboy save threads | forum, no licence; facts only (middle rule) | the Activision board's registers and save chips. **Second-hand**: AtariAge refuses scripted fetches (403) and an archive copy was not fetched, so these reached us as search-engine extracts; each fact is DOC (second-hand) and wants a direct reading | | Microchip 24AA02/24LC02B data sheet DS21709J (sha256 `454a78c2...`) | manufacturer document; facts only | the 256-byte chip: 8-byte page, one address byte, select bits don't-care | | Microchip 24AA256/24LC256 data sheet DS20001203W (a2600-python's copy) | manufacturer document; facts only (row exists) | the 32K chip: 64-byte page, two address bytes, start/stop, acknowledge, reads | No emulator's source (MAME, openMSX, ColecoDS, ColEM, Gearcoleco, CLK, ares, FujiNet) was opened. MAME's cartridge files are still pinned for the rest of the board; they were not read. **Removed.** `XinOneCartridge` (the "31 in 1" / "63 in 1" multicarts): no permitted document describes their selection, so it is gone rather than rewritten from memory; `cartridge_for` raises for `"xin1"`. ColecoDS's pin (`scripts/pinned_repos.json`) is removed and its fetched tree moved out of the repository unopened (to `/data/emu/trash/`), as the 2026-11-24 rule asks. **Before and after** (`tests/test_cartridges.py` and the library's board choice, run as black boxes, CPython 3.14): | Run | Before (old code) | After (new code) | | --- | --- | --- | | old `tests/test_cartridges.py` (13) | 13 pass | 8 pass, 5 fail (below) | | new `tests/test_cartridges.py` (23) | - | 23 pass (CPython and PyPy) | | `cartridge_for` over `$NO_INTRO_DIR/Coleco - ColecoVision` (201 images) | 201 plain | 201 plain (no library image is larger than 32K) | The five old tests that fail, each a difference decided from the documents: 1. `test_xin1`: the board is removed (no document). 2. `test_activision_banks_and_open_area`: the old model read `$FF81-$FFFF` as `$FF` ("dead"); the new one reads all of `$FF80-$FFFF` from bank 2 or 3 by SDA, kevtris's own guess in topic 327053 (HYPOTHESIS: the only statement any source makes). 3. `test_activision_eeprom_write_and_read_back[256]` and `[32768]`: the old model returned the SDA bit itself (0 or 1) at `$FF80`; per kevtris the board returns ROM data from bank 2 or 3, so a game keeps 0 and 1 there. The old test image has 2 and 3 there, so its master sees no acknowledge. The new tests put 0 and 1 in those banks and pass the same sequences. 4. `test_board_choice_by_size_and_header`: an image of 1M with no header was an X-in-1; it is now a MegaCart (HYPOTHESIS default). Choices where the documents are silent (HYPOTHESIS, all marked in `cartridge.py`): writes switch the MegaCart too (the slot has no /WR); a hotspot read returns the newly selected bank's byte; power-on bank 0 on both boards (the slot has no reset); the Activision registers decode 16-byte rows and decode reads; a 256-byte chip when none is named; a 24C256's select pins tied low; the EEPROM's write cycle takes no time; an erased chip reads `$FF`; a MegaCart whose bank count is not a power of two reads open bus in the missing banks; a larger-than-32K image with no header is a MegaCart. To confirm: a direct reading of AtariAge topics 327053 and 216354 (the MegaCart FAQ) by a person (they refuse scripts); a real MegaCart's and Activision board's behaviour on a write to a hotspot, a read of a hotspot, and the bytes at `$FF81-$FFFF`.