# ym2151-python A future pure-Python, cycle-level reference core of the Yamaha YM2151 (OPM) FM sound chip, with the YM2164 (OPP) as a variant, under the MIT licence. **Status: Phase 0, restarted 2026-11-19.** There is no core yet: the repository holds the specification, a closed-box referee harness and measurement scripts. See [docs/phase0-status.md](docs/phase0-status.md) and [docs/start-here.md](docs/start-here.md). ## Lineage One of a family of chip cores and boards built as readable references (Python) with faster transcriptions later. The first consumer will be `cps1-python` (Capcom CPS-1); MAME 0.285 lists 2,322 machines with a YM2151 ([docs/users.md](docs/users.md)). The first `ym2151-python` was archived unread after an audit found its documents rested on an LGPL model's source; this repository started again from its first commit ([docs/restart.md](docs/restart.md)). ## Sources Read and used, with their notices ([NOTICE](NOTICE)): - Yamaha's YM2151 catalogue (1991) and application manual: facts, cited by page. - **IKAOPM** by Sehyeon Kim (Raki), BSD-2-Clause, commit 08a5b40: a YM2151 in Verilog reverse-engineered from the die shot and the data sheet, with a traced schematic. The die-level source of the tables (log-sine, exponent, frequency, DT1) and the behaviour. - **ymfm** by Aaron Giles, BSD-3-Clause, commit 81aec25, and MAME 0.285's BSD-3 `ymopm` files: a cross-check and detector. Run, never read (closed boxes): - **Nuked-OPM** (LGPL-2.1, nukeykt/Nuked-OPM at f209e6e; its source is not fetched here, Aubrey, 2026-11-24): driven only through its public header `opm.h` by nuked-harness's `opm-events` (a GPL tool kept outside this repository, built in emu-tools-gpl and run at `$EMU_TOOLS_GPL/tools/nuked/build/opm-events`), as the referee. Values from it are tagged OBSERVED and give way to any document or hardware number. - **jt51** (GPL-3.0) and MAME's old `ym2151.cpp` (GPL-2.0+): not used; if ever used, run, never read. Every rule in the specification carries an evidence tag (DIE, DOC, OBSERVED, ...) and a citation; [docs/provenance.md](docs/provenance.md) records the source of every file. ## Quick start (Phase 0 tools) ```sh python -I scripts/fetch_references.py # pinned references into reference/ (ignored) sh validation/build_referee.sh # checks the closed-box referee (EMU_TOOLS_GPL) nice python -I scripts/referee_freq.py # every KC/KF step and DT1 size, measured ``` Licence: MIT ([LICENSE](LICENSE)); third-party notices in [NOTICE](NOTICE).