# emu-tools-gpl2 Tools that drive **GPL-2.0-only** emulators and chip models as closed-box referees for the emulator family: harnesses, drivers and patches for upstreams whose terms cannot be combined with GPL-3.0 code, so they cannot sit in the sibling repository `emu-tools-gpl` (GPL-3.0-or-later). Today: YM2608-LLE, sim68xx, Atari800, Mednafen 1.32.1, Nuked-MD and WinUAE's CPU tester. **Licence: GPL-2.0-only** (`LICENSE`, the GPL-2.0 text). Here we may read, patch and improve these upstream programs, keep our patches, and make tools good enough for others to use, under the upstreams' own terms. 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. Started on 2026-11-24 (Aubrey's decisions of that day, below) from tools that had been gathered in `emu-tools-gpl`. The tools keep the command lines and outputs they had. The first regrouped onto the shared contract is `tools/ym2608-lle` (0.1.0, 2026-11-24): it fetches and builds YM2608-LLE at its pin itself (`build.sh`) and has the contract's `run.py`; the others are not regrouped yet. Also on 2026-11-24 two stand-alone GPL-2.0-only tool repositories were folded in with their history (subtree merges) and archived: `megadrive-nuked-md-harness` is `tools/nuked-md` and `m68000-winuae-referee` is `tools/winuae`; each fetches and builds its upstream at the pin and answers `--version` with the contract's exit codes. ## Where the tools are One environment variable per tool repository: **`EMU_TOOLS_GPL2`** names a checkout of this repository (`EMU_TOOLS` names the MIT `emu-tools`, `EMU_TOOLS_GPL` names `emu-tools-gpl`). Each tool sits at a fixed path under it, listed in `tools/README.md`, for example `$EMU_TOOLS_GPL2/tools/atari800/atari800_run.py`. A tool's README may offer an optional per-tool override of a path it uses; nothing more. The emulator repositories still find these tools through their old per-consumer variables (`YM2610_GPL_TOOLS`, `M6800_GPL_TOOLS`, `A5200_GPL_TOOLS`, `HUC6280_GPL_TOOLS`), which name folders in `emu-tools-gpl`. Those folders hold relative links into this repository at each moved tool's old file name, so they work while the two repositories are checked out side by side (`emu-tools-gpl/docs/consumer-migration.md` says what each consumer changes later). The two tools that were stand-alone repositories are found through `EMU_TOOLS_GPL2` and their documented paths: megadrive-python runs `$EMU_TOOLS_GPL2/tools/nuked-md`, and m68000-python `$EMU_TOOLS_GPL2/tools/winuae/build/winuae_referee`. Their old per-tool variables, `NUKED_MD_HARNESS` and `WINUAE_REFEREE`, are retired (2026-11-24; both consumers have moved). ## Why a separate repository (the rule) Aubrey's decision of 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.** GPL-2.0-only code cannot be combined with GPL-3.0 code, so it cannot sit in `emu-tools-gpl`. A tool that links, includes, loads in its own process, declares the API of, or patches such a file belongs here. Each upstream's verdict, file by file at the pinned tree, is in `docs/upstreams.md`. A file whose own notice grants GPL version 2 with no "or later" is GPL-2.0-only by its own words, rule or not: WinUAE's `include/uae/types.h`, which the WinUAE tool compiles almost everywhere, is such a file. (WinUAE's tree had no licence file at the tool's first pin; its pin since 2026-11-24, `6e0d5ae`, is the commit that adds `COPYING`, the GPL-2.0 text, so the rule now decides that tree too.) ## The contract Every tool here is to speak the family's tool contract, which is specified, under MIT, in `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. `tools/ym2608-lle` speaks it (manifest, `--version`, exit codes); `tools/nuked-md` and `tools/winuae` have `--version` and the exit codes on their build scripts but no manifest (their binaries keep the command lines and outputs their consumers read); the other tools here predate the contract and do not speak it yet. ## The wall (read before working here) `emu-tools/docs/wall.md` is binding, here exactly as in `emu-tools-gpl`: - 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. - Nothing here is combined with GPL-3.0 code: a tool here and a tool in `emu-tools-gpl` meet only across a process boundary, through files. ## What may live here Tools for GPL-2.0-only upstreams (by the rule above), and our own code that goes with them: files first published under MIT in the family's repositories keep their MIT header and notice (`notices/MIT-emulator-family.txt`); our own files that came here under GPL-2.0-or-later (the Nuked-MD driver and build script, the WinUAE build script) keep that header; new files here are GPL-2.0-only. GPL-2.0-or-later and permissive upstream code may be combined with them. **Not:** GPL-3.0, LGPL-3.0, AGPL or Apache-2.0 code (incompatible with GPL-2.0-only), anything that does not need to be here (a tool whose upstream passes the rule belongs in `emu-tools-gpl`), 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 (`NO_INTRO_DIR`, `MAME_ROMPATH`). ## Folded in: the stand-alone GPL-2.0-only repositories `megadrive-nuked-md-harness` (Nuked-MD's whole-board harness) and `m68000-winuae-referee` (WinUAE's CPU-tester referee) were moved out of megadrive-python and m68000-python on 2026-11-19 as repositories of their own. On 2026-11-24 both were folded in here with their history, as `tools/nuked-md` and `tools/winuae`, and the stand-alone repositories were archived (`zzz-megadrive-nuked-md-harness`, `zzz-m68000-winuae-referee`). `emu-tools-gpl`'s `tools/nuked/README.md` says why the Nuked-MD harness is not part of that repository's Nuked chip harnesses. ## Notices - `LICENSE`: the GNU General Public License, version 2. - `notices/MIT-emulator-family.txt`: the MIT permission kept by our files that came from the family's MIT repositories (each tool's README says which). - Each upstream keeps its own notices; none of its files is committed here. What is ours but carries upstream code is under the upstream's terms: the context lines a patch carries (`tools/mednafen/patches/`, `tools/ym2608-lle/patches/`) and two short pieces of WinUAE's cputest code reproduced in `tools/winuae/winuae_referee.cpp` (its README). ## Documents - `tools/README.md`: every tool, its path under `EMU_TOOLS_GPL2`, and its old location. - `docs/upstreams.md`: each upstream, its licence verdict with the evidence, the pin, patches. - `emu-tools-gpl/docs/adding-a-tool.md` applies here too, with GPL-2.0-only in place of GPL-3.0-or-later.