#!/usr/bin/env python3 # SPDX-License-Identifier: MIT """The reference's rung 4 summary for one MAME trace, as ``mame_replay`` prints it. reference_mame.py GAME_DIR Runs 65816-python's own ``tests/mame_replay.py`` ``replay`` on the game's ``cart.sfc`` and ``error.log`` (the directory ``scripts/mame_trace.py --io`` made) and prints the game's name and the report's ``summary()``. Run it with the reference's interpreter; ``W65C816_PYTHON`` names the checkout. """ from __future__ import annotations import os import sys from pathlib import Path sys.path.insert(0, str(Path(os.environ["W65C816_PYTHON"]) / "tests")) from mame_replay import replay # noqa: E402 def main() -> int: folder = Path(sys.argv[1]) report = replay((folder / "cart.sfc").read_bytes(), folder / "error.log") print(folder.name) print(report.summary()) return 0 if __name__ == "__main__": sys.exit(main())