# hg51b-python's Mesen2 Cx4 harness `mesen_cx4_trace.py`: the command line of the separate repository `hg51b-mesen-harness` (GPL-3.0-or-later, alewman; moved out of hg51b-python on 2026-11-19), folded into the Mesen2 tool on 2026-11-23 and kept here as a thin shim over it (`../mesen2`, module `mesen2_runner/compat/hg51b_cx4.py` on the `cx4` adapter). On 2026-11-24 the separate repository's one commit (`4306674`) was merged into this repository's history (a merge that adds no files: the code is the copy above), and the repository was archived as `zzz-hg51b-mesen-harness`. It had moved out of hg51b-python's history (local, never pushed) on 2026-11-19, in provenance wave 2, by the charter session's decision on the "ctypes layouts from Mesen2's headers" question: the declarations follow Mesen2's headers and the script drives Mesen2 as a linked library, so the harness is part of Mesen2's GPL world. If it is ever shared, its complete source and Mesen2 at the pinned commit go with it (as for `../mesen2`). ## What it measures A Cx4 cartridge on Mesen2: the test screen, a per-instruction Cx4 trace, and the S-CPU's accesses to the Cx4 window ($6000-$7FFF), for hg51b-python's closed-box probes and recorded windows. OBSERVED (Mesen2 `b9fa69d`, via mesen2-runner 0.1.0). The formats are described in `../mesen2/README.md` (the `snes-cx4` machine). ## Who uses it hg51b-python's `scripts/cx4_probe.py` and `scripts/record_mesen_windows.py`, which run this file, at `$EMU_TOOLS_GPL/tools/hg51b-python/mesen_cx4_trace.py`, as a separate program (their own change, made on the MIT side, replaced the old `MESEN_CX4_TRACE` variable). The same outputs as the separate repository's copy (gated 2026-11-23: `../../docs/consumer-migration.md`). ## Differences from the separate repository's file Only where it looks when `--out` or the library is not given: the hg51b-python checkout is `HG51B_PYTHON_ROOT`, else the working directory (hg51b-python's scripts run it from there), where the old file used the folder above its own. With `--out` and `MESEN_CORE` set, as hg51b-python's scripts run it, nothing differs. ## Licence GPL-3.0-or-later, as the separate repository was (`../../LICENSE`). ## Retired (2026-11-24) The Mesen2 shim that was here (`mesen_cx4_trace.py`) and its compat module were moved to `../../attic/` with `git mv`: no code in any family repository used it any more (its consumer runs `$EMU_TOOLS_GPL/tools/mesen2/run.py`; `../../attic/README.md` has the search and the details). The sections above describe it as it was.