# PSG referees Two small C++ harnesses that compile another emulator's PSG unchanged and drive it step by step from a register log, so `scripts/psg_compare.py` can compare this board's PSG with them (docs/m4-record.md). They are **tools**, outside the MIT `pcengine_python` package: nothing under `src/` uses them, and the board installs and runs without them. ## The Mednafen referee: GPL-2.0-or-later `mednafen_psg.cpp` and `mednafen_shim/` are compiled together with Mednafen's `pce_psg.cpp` and `pce_psg.h`, taken from the reference tree (`reference/src/mednafen-pce-dev`, not in this repository's history, never copied here). Mednafen is licensed GPL-2.0 or later, and the harness reaches into its PSG class (`#define private public`), so the referee as a whole is a GPL tool and these files carry `SPDX-License-Identifier: GPL-2.0-or-later` (the same arrangement as huc6280-python's `tools/mednafen-trace.patch`; family charter, licences rule 6). - The harness and the shim files are our own text, written for this harness (checked 2026-11-19 from the files themselves and their commit, 62b3077, without opening any Mednafen source): the shim is a stand-in for `` (C integer type names, empty macros, empty save-state stubs) and an empty `trio.h`; the harness is a `main` that feeds the log and writes the outputs. They name Mednafen's interface (they must, to compile against it) but copy none of its code. They are marked GPL because they exist only to be built into a GPL program. - **Built binaries are never distributed.** `build_mednafen.py OUTDIR` builds one locally, into a scratch directory, for a comparison run. If a binary were ever shared, it would go with its complete source (Mednafen's files and these) under the GPL. - Running the referee is closed-box use: its outputs are measurements, and no code of it enters the board (rule 3 of the charter; docs/restart.md). ## The MAME referee: MIT harness over a BSD-3-Clause file `mame_c6280.cpp` and `mame_shim/emu.h` are our own MIT text, compiled with MAME 0.285's `src/devices/sound/c6280.cpp` (BSD-3-Clause, copyright Charles MacDonald; the notice is in `NOTICE.md`), read from the reference tree, never copied here. The build scripts (`build_mednafen.py`, `build_mame.py`) are MIT: they only run `g++`.