# tools/ The root is **`EMU_TOOLS_GPL`**, a checkout of this repository (one variable per tool repository: `EMU_TOOLS` for the MIT `emu-tools`, `EMU_TOOLS_GPL` here, `EMU_TOOLS_GPL2` for the GPL-2.0-only `emu-tools-gpl2`). Every tool below sits at the fixed path given, and a consumer calls it there. A tool's README may offer an optional per-tool override; nothing more. Two kinds of folder. **Tools by upstream** (the refactor's target, from 2026-11-23): one folder per upstream program, speaking the contract (`emu-tools/docs/contract.md`), each with its README, CHANGELOG, build script and smoke test. **Folders by consumer** (gathered 2026-11-22, the family's history clean-up, wave G): one per emulator repository that uses GPL tools, holding exactly what that repository's `_GPL_TOOLS` variable expects. Those variables keep working until each consumer moves: point the variable at the folder. Where a consumer's tool has been regrouped, its old file is a thin shim over the upstream's tool, with the same command line and outputs, or a relative link to its new folder here; where it moved to `emu-tools-gpl2` (2026-11-24), its old file is a relative link into that repository, which works while the two are checked out side by side (`../docs/consumer-migration.md` says what each consumer changes later). ## Tools by upstream | Path | Tool | Upstream (pin) | Replaces | | --- | --- | --- | --- | | `$EMU_TOOLS_GPL/tools/mesen2/run.py` (build: `tools/mesen2/build.sh`; smoke: `tools/mesen2/tests/smoke.py`) | mesen2-runner 0.4.0: NES (with the FDS), SNES, Cx4 and PC Engine adapters, `run.py` on the contract (single runs and `--batch`), the Mesen2 patch; two pinned cores (`--core mesen2`, the default, or `--core mesence`; `build.sh --core mesence`) | Mesen2 (`b9fa69d`, GPL-3.0); MesenCE (`4b8a196`, GPL-3.0, since 2026-11-25: run only, its community bans AI contributions) | the Mesen2 drivers of famicom-, snes-, pcengine-, huc6280-python and `hg51b-mesen-harness` (famicom- and huc6280-python's now shims; the other three retired to `../attic/`, 2026-11-24) | | `$EMU_TOOLS_GPL/tools/nuked/run.py` (build: `tools/nuked/build.sh`, which writes the binaries `tools/nuked/build/opn2-stream`, `opn2-events`, `opll-stream`, `psg-stream`, `psg-events`, `opm-events`; smoke: `tools/nuked/tests/smoke.py`) | nuked-harness 0.1.0: six harnesses (stream and event forms) for four chip models, `run.py` with the contract's manifest | Nuked-OPN2 (`335747d`), Nuked-OPLL (`1269cf5`), Nuked-PSG (`d15a168`), Nuked-OPM (`f209e6e`) | the Nuked harnesses of ym2612-, ym2413-, sn76489-, ym2151- and megadrive-python (now include shims) | | `$EMU_TOOLS_GPL/tools/ay-die-model/build/ay_ref` (run with `vvp`; build: `tools/ay-die-model/build.sh`, which applies `patches/trireg-keepers.patch` to a copy; contract: `tools/ay-die-model/run.py`; smoke: `tools/ay-die-model/tests/smoke.py`) | ay-die-model 0.1.0: the AY-3-8910 die model's Icarus testbench (pins per clock, reads) | lvd2/ay-3-8910_reverse_engineered (`cf8d14d`, GPL-3.0-or-later) | ay8910-python's `ay_tb.v` (now a link) and its `icarus_port.py` step (now the patch) | | `$EMU_TOOLS_GPL/tools/ym2203-lle/build/ssg_ref` (build: `tools/ym2203-lle/build.sh`; contract: `tools/ym2203-lle/run.py`; smoke: `tools/ym2203-lle/tests/smoke.py`) | ym2203-lle 0.1.0: the YM2203 SSG harness (three outputs per step) | YM2203-LLE (`817387f`, GPL-2.0-or-later) | ay8910-python's `ssg_ref.c` (now a link) | | `$EMU_TOOLS_GPL/tools/nanoboyadvance/build/arm7tdmi-sst/nba_sst` and `.../build/gba/nba_driver` (build: `tools/nanoboyadvance/build.py --machine arm7tdmi-sst` or `gba`, which fetches the machine's pin; sources `nba_sst/`, `nba_driver/`; smoke: `tools/nanoboyadvance/tests/smoke.py`) | nanoboyadvance-drivers 0.1.0 (2026-11-25): the SingleStepTests ARM7TDMI referee and the headless GBA driver | NanoBoyAdvance (`e8482c1` and `8c3b159`, GPL-3.0-or-later) | arm7tdmi-python's `nba/` and gba-python's `nba_driver/` (now links), and both repositories' own NBA builds | | `$EMU_TOOLS_GPL/tools/mgba/build/gba/mgba_driver` and `.../build/arm-disasm/mgba_disasm` (build: `tools/mgba/build.py --machine gba` or `arm-disasm`, which fetches mGBA's pin and, for `gba`, Lua 5.4.7; sources `mgba_driver/` (MIT), `mgba_disasm/` (MPL-2.0); smoke: `tools/mgba/tests/smoke.py`) | mgba-tools 0.1.0 (2026-11-25): the headless GBA driver and the ARM/Thumb disassembler | mGBA (`fd9dc5c`, MPL-2.0); Lua 5.4.7 (MIT) | gba-python's `scripts/mgba_driver.c` and arm7tdmi-python's `referees/mgba/`, and both repositories' own mGBA builds | | `$EMU_TOOLS_GPL/tools/6502decoder/build/decode6502` (build: `tools/6502decoder/build.py`, which fetches the pin; smoke: `tools/6502decoder/tests/smoke.py`) | 6502decoder-build 0.1.0 (2026-11-25): hoglet67's logic-analyser capture decoder | 6502Decoder (`c32dd60`, GPL-3.0) | w65c02-python's own build (`scripts/build_tools.py --only decoder`) | | `$EMU_TOOLS_GPL/tools/blastem-events/run.py` (nothing to build; smoke: `tools/blastem-events/tests/smoke.py`) | blastem-events 0.1.0 (2026-11-26): BlastEm's hardware event log decoded to the contract's `trace/events` JSON lines and a manifest | BlastEm's log format (`542164d`, GPL-3.0; nothing of BlastEm fetched or built) | the decoder in megadrive-python's `scripts/blastem_events.py` (now a reader of this tool's output) | | `$EMU_TOOLS_GPL/tools/snes-spc/build/spc_dump` (build: `tools/snes-spc/build.sh`, which fetches the archive and checks its SHA-256; source `tools/snes-spc/spc_dump.cpp`; smoke: `tools/snes-spc/tests/smoke.py`) | snes-spc 0.1.0: the S-DSP referee (32 kHz samples, DSP registers per sample, final state) | snes_spc 0.9.0 (archive SHA-256 `dbad8273...83aed`, LGPL-2.1-or-later) | snes-python's and s-dsp-python's `spc_dump.cpp` (now links) | The two stand-alone GPL tool repositories that were never gathered here went straight to `emu-tools-gpl2` on 2026-11-24, with their history, because the upstreams they build are GPL-2.0-only (`../docs/upstreams.md`): the Nuked-MD harness (`$EMU_TOOLS_GPL2/tools/nuked-md`, from `megadrive-nuked-md-harness`) and the WinUAE CPU-tester referee (`$EMU_TOOLS_GPL2/tools/winuae/build/winuae_referee`, from `m68000-winuae-referee`). The third, `hg51b-mesen-harness`, had been folded into `mesen2/` here on 2026-11-23; its history was merged here on 2026-11-24. ## Folders by consumer Each path is under `$EMU_TOOLS_GPL/tools/`; for the tools not yet regrouped it is also the tool's documented path until it is. | Folder | Variable | Tools (files) | | --- | --- | --- | | `65816-python/` | `W65C816_GPL_TOOLS` | P65C816 testbench (GHDL): `tb_p65c816.vhd` | | `a5200-python/` | `A5200_GPL_TOOLS` | link: `atari800_run.py`, the Atari800 driver, now at `$EMU_TOOLS_GPL2/tools/atari800/atari800_run.py` | | `arm7tdmi-python/` | `ARM7TDMI_GPL_TOOLS` (retired: arm7tdmi-python runs `tools/nanoboyadvance`, 2026-11-25) | link: `nba/`, now `../nanoboyadvance/nba_sst/` | | `ay8910-python/` | `AY8910_GPL_TOOLS` (ay8910-python now joins `EMU_TOOLS_GPL` and this folder) | links: `ay_tb.v` (to `ay-die-model/ay_tb.v`), `ssg_ref.c` (to `ym2203-lle/ssg_ref.c`) | | `famicom-python/` | `FAMICOM_GPL_TOOLS` | shims: `mesen_audio.py` (Mesen2 audio check, run by path), `mesen_run.py` (Mesen2 driver, its module; no code calls it directly any more); `mesen2-detector-fixes.patch` (a link into `mesen2/patches/`) | | `gba-python/` | `GBA_GPL_TOOLS` (retired: gba-python runs `tools/nanoboyadvance`, 2026-11-25) | link: `nba_driver/`, now `../nanoboyadvance/nba_driver/` | | `hg51b-python/` | (none) | README only: the shim `mesen_cx4_trace.py` was retired to `../attic/` on 2026-11-24 (hg51b-python runs `$EMU_TOOLS_GPL/tools/mesen2/run.py --machine snes-cx4`) | | `huc6280-python/` | `HUC6280_GPL_TOOLS` | link: `mednafen-trace.patch`, now at `$EMU_TOOLS_GPL2/tools/mednafen/patches/mednafen-trace.patch`; HUC6280 testbenches (GHDL): `huc6280_vhdl/`; shim: `vanish_probe.py` (Mesen2 probe) | | `m6800-python/` | `M6800_GPL_TOOLS` | n6800 single-step harness: `n6800_harness.py`; link: `sim68xx_harness.c`, now at `$EMU_TOOLS_GPL2/tools/sim68xx/sim68xx_harness.c` | | `megadrive-python/` | (none: no current user) | shims: `validation/opn2_ref.c`, `validation/psg_ref.c` (old Nuked-OPN2 and Nuked-PSG harnesses), built by `validation/build_referees.sh`; the YM2608-LLE harness moved to `$EMU_TOOLS_GPL2/tools/ym2608-lle/` | | `pcengine-python/` | `PCE_GPL_TOOLS` | Mednafen PSG referee: `psg_referees/` (the Mesen2 shim `mesen_run.py` was retired to `../attic/` on 2026-11-24) | | `s-dsp-python/` | `S_DSP_GPL_TOOLS` | link: `spc_dump.cpp`, now at `$EMU_TOOLS_GPL/tools/snes-spc/spc_dump.cpp` (built by `snes-spc/build.sh`) | | `sh2-python/` | `SH2_GPL_TOOLS` | jgenesis harness and its build: `jgenesis_harness/`, `build_jgenesis_harness.py` | | `sn76489-python/` | `SN76489_GPL_TOOLS` | shim: `nuked_harness.c` (Nuked-PSG) | | `snes-python/` | `SNES_GPL_TOOLS` (retired by snes-python) | link: `spc_dump.cpp`, now at `$EMU_TOOLS_GPL/tools/snes-spc/spc_dump.cpp` (the Mesen2 shim `mesen_run.py` was retired to `../attic/` on 2026-11-24) | | `ym2151-python/` | `YM2151_GPL_TOOLS` | shim: `opm_ref.c` (Nuked-OPM) | | `ym2413-python/` | `YM2413_GPL_TOOLS` | shim: `nuked_harness.c` (Nuked-OPLL) | | `ym2610-python/` | `YM2610_GPL_TOOLS` | link: `lle2610_probe.c`, the YM2608-LLE probe, now at `$EMU_TOOLS_GPL2/tools/ym2608-lle/lle2610_probe.c` | | `ym2612-python/` | `YM2612_GPL_TOOLS` | shim: `nuked_harness.c` (Nuked-OPN2) | The two `spc_dump.cpp` were one file in two places; since 2026-11-24 both are links to `snes-spc/spc_dump.cpp`. As gathered on 2026-11-22, files were byte-identical to the repositories they left, except these, each described in its folder's README: `famicom-python/mesen_run.py`, `pcengine-python/psg_referees/build_mednafen.py` and `snes-python/mesen_run.py` (find the board's checkout; changed when parked), `a5200-python/atari800_run.py` and `sh2-python/build_jgenesis_harness.py` (the same, 2026-11-22), and `pcengine-python/mesen_run.py` and `huc6280-python/vanish_probe.py` (a path on one machine replaced by `MESEN_CORE`, 2026-11-22).