# huc6280-python's GPL tools From the emulator family's huc6280-python repository: `tools/mednafen-trace.patch`, `tests/huc6280_vhdl/` and `validation/vanish_probe.py`, parked on 2026-11-21 at huc6280-python's history reset (wave C) as they stood at `f395585` (old history). ## What it measures Mednafen's HuC6280 instruction traces, the FPGA core's bus cycles, and Mesen2's answer to one probe, beside huc6280-python. OBSERVED (each at its pin). ## Who uses it huc6280-python, which finds this folder through `HUC6280_GPL_TOOLS`. `scripts/build_mednafen.py` applies the patch to the pinned Mednafen 1.32.1; `scripts/build_referees.py` elaborates the testbenches; `validation/vanish_vhdl.py` runs them; `scripts/mednafen_trace.py` and `validation/mednafen_votes.py` read the patched Mednafen's traces. ## Contents - `mednafen-trace.patch`: **moved on 2026-11-24** to the GPL-2.0-only repository `emu-tools-gpl2`, at `$EMU_TOOLS_GPL2/tools/mednafen/patches/mednafen-trace.patch` (its README there: `tools/mednafen/`). Why: one of the three files it patches and quotes, `src/pce/huc6280.h`, carries no licence statement beside Mednafen's GPL-2.0 COPYING, so by Aubrey's rule of 2026-11-24 it is GPL-2.0-only, and so is the patch (`../../docs/upstreams.md`). What is left here is a relative link to `../../../emu-tools-gpl2/tools/mednafen/patches/mednafen-trace.patch`, so that `HUC6280_GPL_TOOLS` naming this folder keeps finding the patch beside the testbenches and the probe while the two repositories are checked out side by side. Gated on 2026-11-24: `scripts/build_mednafen.py`, run from scratch copies before and after, patched identical sources and built Mednafens that wrote the same trace of `CPU_Test_10.pce`. - `huc6280_vhdl/tb_huc6280.vhd`, `huc6280_vhdl/tb_vanish.vhd`: GHDL testbenches around srg320's HUC6280 CPU VHDL (with its MMU inside): run code and log the bus. Upstream: srg320's HUC6280 in MiSTer-devel/TurboGrafx16_MiSTer, `827d45f`. The repository has no LICENSE file at the pin and the HUC6280 files carry no notice, so they are treated as **unlicensed, run only** (Aubrey, 2026-11-24): fetched at the pin, never committed or shared; only our testbenches live here (`../../docs/upstreams.md`). - `vanish_probe.py`: A ctypes driver of Mesen2's exported C API for one PC Engine probe. Upstream: Mesen2 (Sour), GPL-3.0, `b9fa69d`. On gathering here (2026-11-22) `vanish_probe.py`'s MesenCore location, a path on one machine, became `MESEN_CORE` (or its `--mesen-core` option); nothing else changed. ## Licence and notices Our code (alewman). The testbenches are MIT text from huc6280-python (`../../notices/MIT-emulator-family.txt`), GPL as built; the probe is a GPL tool; the patch is now in `emu-tools-gpl2` (GPL-2.0-only). Upstream code is not committed here, except where a file above says it carries upstream lines; each tool fetches and builds its upstream at the pin from the consuming repository. This repository is GPL-3.0-or-later (`../../LICENSE`). ## Outputs Every value these tools give is a closed-box measurement: tag it OBSERVED with the upstream and its pin, and let any document or hardware measurement overrule it (`emu-tools/docs/wall.md`). The Mesen2 tools are on the shared contract through `../mesen2`; the others here are not yet (`emu-tools/docs/contract.md`). ## Now shims (2026-11-23) The Mesen2 files here are now thin shims over the Mesen2 tool, `../mesen2` (mesen2-runner 0.1.0): the same file names, command lines, module names and outputs, gated before and after the regrouping with this consumer's own commands (`../mesen2/README.md`). The code they ran is in `../mesen2/mesen2_runner/compat/`; how the consumer moves to the tool's own command line is in `../../docs/consumer-migration.md`. Only `vanish_probe.py` moved then; the testbenches are unchanged (later waves), and the Mednafen patch moved to `emu-tools-gpl2` on 2026-11-24 (above). As parked, the probe stopped at import (it looked for huc6280-python's `validation/` beside itself); the shim finds the checkout through `HUC6280_PYTHON_ROOT`, else the working directory.