# Provenance Where each part of this board comes from, under the family charter's "Licences and provenance" and this repository's restart rules ([restart.md](restart.md)). The first build's audit (wave 1, 2026-11-13) described the archived repository; this file describes the restarted one, which takes nothing from it but what [restart.md](restart.md) lists. ## Sources used | Source | Licence | How it is used | | --- | --- | --- | | anomie's SNES timing, registers, memory map and S-DSP documents | none stated (documentation) | facts, cited by section and line (DOC) | | fullsnes (Martin Korth) | none stated (documentation) | facts, cited by section (DOC) | | SNESdev wiki | CC BY-SA (wiki content) | facts, cited by page (DOC) | | ares 9408cb4 (`reference/src/ares`) | ISC | code and formulas may be used with the notice (NOTICE); cited by file and function. Its `sfc/dsp` only for separate formulas | | MAME 0.285 BSD-3-Clause files (`snes.cpp`, `snes_m.cpp`, `snes.h`, `sa1.cpp`, `sdd1.cpp`, `spc700`, `upd7725`, `g65816`) | BSD-3-Clause | readable after the per-file header check; cited by file | | MAME 0.285 (whole program), bsnes 78474e5d, Mesen2 b9fa69d, snes_spc 0.9.0 | GPL-2.0+, GPL-3.0, LGPL-2.1 | closed boxes only, through `scripts/mame_trace.py`, mesen2-runner 0.2.0 (`$EMU_TOOLS_GPL/tools/mesen2/run.py`, a GPL tool run as a separate program since 2026-11-24; `mesen_run.py` through `SNES_GPL_TOOLS` before), `spc_dump` (a GPL tool kept outside the repository since 2026-11-22; since 2026-11-24 the built referee `$EMU_TOOLS_GPL/tools/snes-spc/build/spc_dump`); values OBSERVED. No source of theirs is fetched or kept (below, "Closed-box sources removed"), snes_spc's archive included since 2026-11-24 | | MAME's software list `hash/snes.xml` | CC0-1.0 | the census's record of each cartridge's board and NVRAM size, matched by SHA-1 (`scripts/header_census.py`); data, nothing copied into the board | | gilyon's `cputest`/`spctest`, krom's tests, undisbeliever's probes, blargg's tests | see each | run as programs; their prose about console results is usable | | Aubrey's Super Famicom (CPU 1, PPU1 1, PPU2 1, NTSC) + Super EverDrive X5 | hardware | tier 1: `tests/console/` saves (MEASURED) | ## Rule 10: the inherited documents, scrubbed 2026-11-19 The Phase 0 documents (restart point `bfa810b`) cited bsnes source by file and line. Each citation was re-sourced to ares (read for the purpose; the same behaviour under ISC) or to a document, or struck: | Document | Re-sourced to ares | Struck or reworded | Also | | --- | ---: | ---: | --- | | `start-here.md` | 7 (`cpu.cpp` `power()`, `timing.cpp` `scanline()`/`aluEdge()`/`joypadEdge()`, `memory.cpp` `wait()`/`read()`, `ppu/counter/inline.hpp`) | 2 (the IPL-bytes remark; the "Near reported" attribution) | source table now says which trees are closed boxes | | `timing.md` | 11 (as above, plus `irq.cpp` `nmiPoll()`/`irqPoll()`, `dma.cpp`) | 3 (the scheduler remark, the Mesen2 release-note claim, the logic-analyser comment, which is not a hardware source) | the console's IRQ at (240, 153) and (261, 153) added [hw] | | `undocumented-behavior.md` | 10 | 2 | console results added: Q9, Q12, U3, U5, U8 [hw] | | `validation.md` | 0 | 6 (bsnes's row split into a closed-box row and an ares row; Mesen2 marked closed box; the authority order now puts the console first) | machine paths replaced by `NO_INTRO_DIR`/`MAME_ROMPATH` | | `cartridge.md` | 1 (MSU-1: ares `sfc/coprocessor/msu1`) | 1 (save format) | machine paths replaced | | `handoff-brief.md` | 0 | 3 | the DSP's default power-on table no longer snes_spc's (a policy note for Aubrey) | | `README.md` (docs) | 1 | 0 | | | `probe-suite*.md`, `probe-pack.md`, probe comments, probe-script strings | 39 (ares `sfc/cpu/*`, `sfc/ppu/*`, `wdc65816` files) | 7 (Mesen2 source citations, bsnes formulas) | commit `32e676b`; 8 closed-box observations kept; all eight probe ROMs byte-identical before and after | | `docs/dsp/*` | see `docs/dsp/provenance.md` | | rewritten brief: no transcription | Closed-box observations (what MAME or Mesen2 drew when run) stay, as OBSERVED. ## Per module Filled in as each module is written; every row names its sources. | Part | Behaviour from | Licence | Verdict | | --- | --- | --- | --- | | `board.py` (S-CPU timeline, bus, interrupts, mul/div, auto-joypad, DMA alignment) | anomie timing, fullsnes, wiki (DOC); event positions and poll order ported from ares 9408cb4 `sfc/cpu/*`, `sfc/ppu/counter` (OBSERVED, ISC notice kept); console probe suite (MEASURED) | ISC + own | clean (cite: NOTICE) | | `dma.py` | fullsnes, anomie (DOC); step order from ares `sfc/cpu/dma.cpp` (ISC); WRAM-to-WRAM B-to-A from the console (MEASURED), against ares | ISC + own | clean (cite: NOTICE) | | `ppu.py` (milestone 1: register file) | fullsnes, anomie regs (DOC); access rules from ares `sfc/ppu/io.cpp` (ISC); STAT77 bits from fullsnes against ares | ISC + own | clean (cite: NOTICE) | | `cartridge.py` | fullsnes header and map sections, SNESdev wiki "ROM header" and "Save file formats" (DOC); the header score and the no-header rule are own design, written from fullsnes alone (no Mesen2 rule) and checked against MAME's CC0 software list | own | clean | | `scripts/mame_lockstep.py`, `scripts/header_census.py` | own; MAME run as a closed box; the CC0 software list read as data | own | clean | | `machines.py`, `controllers.py`, `apu.py` (port stub) | fullsnes, wiki (DOC); the console's revision (MEASURED) | own | clean | | `tests/roms.py`, `tests/test_*.py` | test-ROM protocols from the ROMs' own MIT/permissive sources; unit expectations from fullsnes and the console | own | clean | | `scripts/suite_run.py` board mode | re-pointed at the new board | own | clean | | `ppu.py`, `ppu_render.py`, `ppu_png.py` (milestone 2) | fullsnes, anomie (DOC); the cycle schedule, backgrounds, mode 7, mosaic, sprites, windows and DAC ported from ares `sfc/ppu/*` (ISC); CGRAM address and range-over timing from the console (MEASURED); brightness from fullsnes | ISC + own | clean (cite: NOTICE) | | `src/snes_python/dsp/` | anomie r1212, fullsnes, SNESdev wiki (DOC); the Gaussian formula from ares (ISC); referee comparisons (OBSERVED, snes_spc 0.9.0 closed box) | ISC + own | clean (MIT AND ISC in `tables.py`) | | `smp.py` | fullsnes, anomie (DOC); ares `sfc/smp` (ISC) for wait states and timer stages | ISC + own | clean (MIT AND ISC) | | `spc_file.py` | the published SPC File Format v0.30 text | own | clean | | `apu.py` (`APU` bridge) | wiki/Timing (the clock ratio) | own | clean | | `spc_dump.cpp` (`scripts/dsp_referee/` until 2026-11-22; below), `dsp_build_referees.py`, `dsp_run_referee.py` | own driver over snes_spc's documented C API; the built binary is an LGPL-2.1 combined work, never shipped | own driver; LGPL tool | cite | | `scripts/dsp_compare.py`, `dsp_gauss_formula.py`, `dsp_make_spc.py`, `dsp_fetch_*.py`, `ppu_pictures.py` | own (the Gaussian tool: ares's formula, ISC) | own | clean | | `docs/dsp/*` | scrubbed and re-sourced (s-dsp-python `docs/provenance.md`, wave-2 table) | | clean | ## 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/mesen_run.py` (our ctypes driver declaring Mesen2's exported C API, GPL-3.0: a GPL tool by the family's rule of 2026-11-19) was removed from every commit and is kept outside the repository, found through `SNES_GPL_TOOLS` (`scripts/gpl_tools.py`). Commit hashes cited in these documents from before that date refer to the old history, which is kept privately. A second rewrite the same day (wave G) removed `scripts/dsp_referee/spc_dump.cpp`, the S-DSP referee's driver, from every commit the same way: linked with snes_spc (LGPL-2.1-or-later), it is a GPL tool by the family's rule of 2026-11-19 and the tool-repository decision of 2026-11-20 (tools go by licence type). It is kept beside `mesen_run.py` (emu-tools-gpl, `tools/snes-python`), and `scripts/dsp_build_referees.py` finds it through `SNES_GPL_TOOLS` (`EMU_TOOLS_GPL` since 2026-11-24, below). ## The GPL tools through `EMU_TOOLS_GPL` (2026-11-24) By the family's rule of one variable per tool repository (emu-tools `docs/contract.md`, section 5), this repository no longer reads `SNES_GPL_TOOLS` and no longer imports any tool. `scripts/emu_tools.py` joins `EMU_TOOLS_GPL` and each tool's documented path: `tools/mesen2/run.py` (mesen2-runner 0.2.0, machine `snes`), run as a separate program by `smoke.py`, `sweep.py`, `mesen_frames.py`, `detectors_compare.py` and `suite_run.py` (which until then imported the old driver into its own process), and `tools/snes-python/spc_dump.cpp`, compiled by `dsp_build_referees.py` (from 2026-11-24 the built referee `tools/snes-spc/build/spc_dump` instead, below). Only the tools' outputs are read (pictures, `script-log.txt`, `manifest.json`). With the variable unset or the file absent, each script stops with exit status 3 and names the variable (`tests/test_emu_tools.py`). `scripts/gpl_tools.py` is retired. The gate, before and after, is in validation.md "Moved to mesen2-runner". ## 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; such programs are run as built binaries or through emu-tools-gpl/-gpl2, and are cited by upstream URL and commit. Pins removed from `scripts/pinned_repos.json` and `scripts/dsp_pinned_repos.json`, and their trees moved aside unopened, out of the repository (not deleted): - bsnes, https://github.com/bsnes-emu/bsnes @ `78474e5d39f58872dc21aca18cf9eb583b147fe7` (GPL-3.0; two trees: `reference/src/bsnes`, `reference/dsp/src/bsnes`) - Mesen2, https://github.com/SourMesen/Mesen2 @ `b9fa69ddc6d0a331fb103fdb5eef6904305703c2` (GPL-3.0; two trees; built and run by mesen2-runner in emu-tools-gpl) - MesenCE, https://github.com/nesdev-org/MesenCE @ `4b8a196e299b3de297b204fd1208d2981562c89b` (GPL-3.0) - snes9x, https://github.com/snes9xgit/snes9x @ `1bcc369e89f08243e0a462882fb1f3e42e51de3a` (non-commercial; two trees) - SNES_MiSTer, https://github.com/MiSTer-devel/SNES_MiSTer @ `23026830ff8108fda0f32c0616296845f586b8ce` (GPL-3.0) - game-music-emu, https://github.com/libgme/game-music-emu @ `f68963b1de0633149b05732113d3c3113c6f63a1` (LGPL-2.1) - MAME 0.285 (https://github.com/mamedev/mame @ `f379cd060ac3b2bd567ebbd0957aed059d6895ff`): the files whose `license:` line is not BSD-3-Clause leave both sparse lists, as exclusion patterns: GPL-2.0+ `src/mame/nintendo/snescx4.cpp`, `snescx4.h`, `src/devices/video/snes_ppu.cpp`, `src/devices/bus/snes/rom.cpp`, `rom21.cpp`, `spc7110.cpp`, `spc7110.h`, `src/devices/cpu/superfx/superfx.cpp`, `superfx.h` (9), and LGPL-2.1+ `src/devices/sound/s_dsp.cpp`, `s_dsp.h` (in both MAME trees). Only the first line of each file was read, for the check. The 75 files left under `src/` all say BSD-3-Clause (a fresh sparse fetch with the new patterns gave the same 75), and `hash/snes*.xml` are the CC0 software lists. No script here read those trees (searched); the documents cite them as above. Three sibling cores read this checkout's trees in place, and were checked before and after: gsu-python (ares, MAME's BSD-3 files, krom's ROMs, fullsnes), upd7725-python (ares, MAME's BSD-3 files) and hg51b-python (ares, MAME's BSD-3 files, fullsnes, and Mesen2's LICENSE from this checkout's Mesen2 tree, an entry hg51b-python now marks `"fetch": false`). Their `fetch_references.py --verify` and test suites give the same results before and after (validation.md). **Kept, with a question for Aubrey** (as s-dsp-python did the same day): the snes_spc 0.9.0 archive (`scripts/dsp_pinned_files.json`, LGPL-2.1, `reference/dsp/archives/`), because `scripts/dsp_build_referees.py` compiles it, unopened, into `spc_dump` (the S-DSP referee) and no shipped build of that program exists. Whether the archive and the build move to emu-tools-gpl beside the driver is open. **Settled later on 2026-11-24** (Aubrey: no MIT repository downloads or keeps closed-box source): the GPL tool snes-spc 0.1.0 fetches and builds it inside emu-tools-gpl; this repository runs `$EMU_TOOLS_GPL/tools/snes-spc/build/spc_dump`, dropped the archive from `dsp_pinned_files.json` and the fetch and build scripts, and moved the archive, its unpacked tree, the old build and an old patched copy left in `trash/dsp-old/build/` out of the checkout, unopened (outputs identical: validation.md "The S-DSP referee from snes-spc"). Also kept, not closed boxes in sources.md: the 240p test suite's SNES source (GPL-2.0, a test program, not an emulator; not listed in sources.md, so flagged for a verdict), SPLA's documents and krom's ROMs (no licence stated). ## A GPL file seen by grep (2026-11-24) While looking for evidence on U10 (the brightness curve), the full-sweep session ran `grep` for "bright" over MAME's `src/devices/video/snes_ppu.cpp`, assuming it was one of the BSD-3 files; its first line says `license:GPL-2.0+`. Three matching lines were shown (a save-state item, a lookup into a light table, the INIDISP store of the brightness nibble); nothing was read further and nothing from them is in this repository (the board's curve is fullsnes's and unchanged). MAME's PPU file is GPL: it stays a closed box with the rest of MAME's GPL files. ## The 240p Test Suite's source dropped (2026-11-25, decision L2) Aubrey approved decision L2 (emulator-lineage `docs/proposals/2026-11-decisions.md`) as recommended: MIT repositories fetch no GPL source, test programs included. The 240p Test Suite's SNES source (Artemio Urbina, GPL-2.0, `89adfdd6`) is gone from `scripts/pinned_repos.json`, and its fetched tree `reference/src/240pTestSuite/` (never built, run or read here) moved, unopened, to `/data/backup/snes-python-240pTestSuite-2026-11-25/240pTestSuite/`. Nothing from it is in this repository, and nothing under `reference/` or `tests/test_roms/` is or ever was tracked (`git ls-files`, `git log --all`). When the suite is wanted it is built and run from emu-tools-gpl (`tools/240p-snes`, not yet written) and judged as a closed box, by its ROM's output only. The same pass checked the decision L5 kinds here: krom's `SNES`, rainwarrior's `SNES_stuff` and `SnesSpeedTest` (no licence stated) are test ROMs and programs, run only, fetched into the git-ignored `tests/test_roms/` and pinned by commit; SPLA's documents (no licence stated) are read as DOC from the git-ignored `reference/src/spla/` and never redistributed. No change was needed for them.