# emu-tools-gpl Tools that drive copyleft emulators and chip models as closed-box referees for the emulator family: runners, harnesses and trace hooks for programs such as Mesen2, the Nuked models, NanoBoyAdvance, mGBA, jgenesis, snes_spc and BlastEm. Tools for GPL-2.0-only upstreams (YM2608-LLE, sim68xx, Atari800, Mednafen 1.32.1, and since 2026-11-24 Nuked-MD and WinUAE's CPU tester) are in the sibling repository `emu-tools-gpl2`. **Licence: GPL-3.0-or-later** (`LICENSE`). Here we may read, patch and improve the upstream programs freely, keep our patches, and make tools good enough for others to use. Each tool names its upstream, the upstream's licence and the pinned commit; if a tool is shared, its complete corresponding source (our code, our patches, the pinned upstream) goes with it. Status: **refactor under way** (2026-11-24). The GPL tools that left the family's MIT emulator repositories during the history clean-up (waves B to G) were gathered here on 2026-11-22, one folder per emulator repository in `tools/`, each found by that repository through its `_GPL_TOOLS` variable (`tools/README.md`). The refactor regroups them into one tool per upstream that speaks the shared contract: `tools/mesen2` and `tools/nuked` (2026-11-23), then `tools/ay-die-model`, `tools/ym2203-lle` and `tools/snes-spc` (2026-11-24), each fetching and building its upstream at the pin itself. On 2026-11-24 the tools whose upstreams are GPL-2.0-only moved to the sibling repository `emu-tools-gpl2` (below). The old files stay as shims or links with their command lines and outputs until each consumer moves (`docs/consumer-migration.md`); a shim no consumer uses any more is moved to `attic/` (`attic/README.md`), never deleted. The plan: `emulator-lineage/docs/proposals/2026-11-tool-repos.md`. ## Where the tools are One environment variable per tool repository (Aubrey, 2026-11-24): **`EMU_TOOLS_GPL`** names a checkout of this repository; `EMU_TOOLS` names the MIT `emu-tools` and `EMU_TOOLS_GPL2` the GPL-2.0-only `emu-tools-gpl2`. Each tool sits at a fixed path under its repository's root, and `tools/README.md` lists every one: for example `$EMU_TOOLS_GPL/tools/mesen2/run.py` and `$EMU_TOOLS_GPL/tools/nuked/run.py`. A tool's README may offer an optional per-tool override (Mesen2's library through `MESEN_CORE`, for instance), nothing more. The per-consumer `_GPL_TOOLS` variables keep working, each naming its folder in `tools/`, until that consumer moves. ## The contract Every tool here speaks the family's tool contract, which is specified, under MIT, in the sibling repository: `emu-tools/docs/contract.md` (command line conventions, the run manifest, the trace, frame, audio and snapshot formats). Emulator repositories run these tools as separate programs and read only their outputs. ## The wall (read before working here) `emu-tools/docs/wall.md` is binding. In short: - Work here reads GPL source. An agent or session briefed for this repository does not, in the same brief, write code or documents for an MIT emulator repository or for `emu-tools`. - Nothing is copied from here into an MIT repository. Only the tools' outputs and their README descriptions (written without code fragments) cross. - Tools export documented behaviour only: pins, bus cycles, documented registers, pictures, sound. Never a model's internal node names, state labels or source comments. - Every output is a closed-box measurement (`OBSERVED`), never a hardware fact. ## What may live here GPL-2.0-or-later, GPL-3.0, LGPL-2.1+/3.0, MPL-2.0 (through its secondary-licence clause, unless a file says otherwise) and permissive code. **Not:** GPL-2.0-only code, which goes to `emu-tools-gpl2`; AGPL code (it would need its own repository); non-commercial code (Genesis Plus GX, PicoDrive: run as shipped only); anything by authors who object to AI use (furrtek: not at all). Console makers' firmware is never committed; ROMs and BIOS come from the player's paths or environment variables. **GPL-2.0-only, decided by Aubrey on 2026-11-24:** a file with no "or later" grant, in a repository whose LICENSE is the GPL-2.0 text, is GPL-2.0-only. A tool that compiles, links, loads into its own process, declares the API of, or patches such a file cannot live here. The YM2608-LLE, sim68xx, Atari800 and Mednafen 1.32.1 tools failed that check and moved to `emu-tools-gpl2` (verdicts and evidence: `docs/upstreams.md`). A tool here and a tool there meet only across a process boundary, through files. ## Documents - `docs/adding-a-tool.md`: what a tool here needs beyond the shared bar. - `docs/upstreams.md`: each upstream program, its licence, the commit pinned, the patches we carry, and the GPL-2.0-only verdicts of 2026-11-24. - `tools/README.md`: every tool and its path under `EMU_TOOLS_GPL`, and the folders by consumer. - `docs/consumer-migration.md`: what each emulator repository changes later to use the regrouped tools directly.