**Lineage:** pokey-python → (pokey-rust, planned) · fixes start in pokey-python and flow down by merges · [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) # pokey-python A readable, pure-Python reference core for Atari's POKEY (C012294): four audio channels with polynomial counters and dividers, timers and interrupts, RANDOM, the pot scan, the keyboard scan, and the serial port's audio-affecting parts (two-tone, asynchronous hold of timers 3+4), advanced one O2 period at a time. It is a chip core of an emulator family: boards (Atari 5200, Atari 7800 cartridges, later the 8-bit computers and arcade boards) compose it and pin it by commit. **Modelling level: cycle.** This repository was restarted on 2026-11-14 ([docs/restart.md](docs/restart.md)): it is written only from documents (Atari's data sheet, the Altirra Hardware Reference Manual, Acid800, recordings) and from closed-box measurements of a VHDL model's pins. Where every fact comes from: [docs/provenance.md](docs/provenance.md); the behaviour rule by rule: [docs/behaviour.md](docs/behaviour.md). from pokey_python import POKEY, C012294 chip = POKEY(C012294) chip.write(0x0F, 0x03) # bus access first (SKCTL: leave initialisation mode)... chip.tick() # ...then the tick of the same cycle chip.levels() # (c1, c2, c3, c4): volume if the channel's output is 1, else 0 chip.mix() # the four codes through the fitted output curve, 0.0-1.0 **Status** (measured 2026-11-14 at 6ed1ffa, the commit boards should pin; details, commands and commits in [docs/status.md](docs/status.md)): rungs 1-7 and 9-10 built. 123 tests pass on CPython 3.14 and PyPy 3.11, among them AcidSAP's POKEY tests run on 6502-python (9 of 10 on both IRQ-delay machines; two-tone needs the serial output shift register, which is not built). Against the closed box: 0 differences on RANDOM, fires, the four channel codes and /IRQ over 10 M cycles each; the keyboard's pins and status over 12.6 M cycles, 499 of 501 streams equal; pots cannot be judged by it. Seeded faults 64/64 caught. Speed: PyPy 9.5 M cycles/s (5.3x NTSC real time), CPython 0.61 M. Rung 8 (music excerpts) waits for the boards' register logs. How a board wires the chip: [docs/adoption.md](docs/adoption.md); where work resumes: [docs/build-progress.md](docs/build-progress.md). python -m pytest # the rungs' tests (CPython or PyPy); pip install -e .[acid] for AcidSAP python -I scripts/conformance.py # the conformance kit a transcription must reproduce python -I scripts/fetch_references.py # documents, Acid800, the closed box -> reference/ (ignored) OSS_CAD_SUITE=DIR python -I scripts/run_vhdl.py # the closed box under GHDL MAME_ROMPATH=DIR python -I scripts/mame_pokey.py # MAME 0.285 as a binary detector Nothing third-party is committed. Licence: MIT (LICENSE); credits in NOTICE.