# lynx-python **Lineage:** lynx-python → (lynx-rust, planned) · fixes start in lynx-python and flow down by merges · [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) A readable, pure-Python emulator of the **Atari Lynx** (Lynx I and Lynx II), built as a board on the CPU core `w65c02-python` (`G65SC02` = the Lynx I's cell, `Lynx2Cell` = the Lynx II's). The core owns the instruction set; this repository owns everything around it: Mikey (timers, audio, video DMA and palette, UART, interrupts, the bus controller, the boot ROM overlay), Suzy (sprite engine, collision, math, inputs, the cart port), the 16 MHz tick timeline that ties them together, and the cartridge loader. This repository was restarted on 2026-11-14 under [docs/restart.md](docs/restart.md): no GPL, LGPL or unlicensed source is read; emulators are run as closed boxes only; every behaviour in the code names its evidence. What changed is in [docs/provenance.md](docs/provenance.md). ## Status Measured numbers, with the commit they were measured at, are in [docs/status.md](docs/status.md); how to resume is in [docs/build-progress.md](docs/build-progress.md). Milestones (from [docs/handoff-brief.md](docs/handoff-brief.md)): M0 formats passed; M1 the CPU through the boot ROM passed (5 titles in lockstep with MAME, host decryption: all 113 distinct frames of the licensed sets identical, 2026-11-19); M2 passed (52 of 52 hardware-test cases on each row, with the bus costs decoded from the logic-analyser captures); M3 passed (line and frame periods equal the captures to the tick on 15 of 15 measurable settings, and the four captured titles' frame periods equal theirs); M4 passed (the sprites1-5 CRCs 40 of 40 on each row); M5 partial, exit not met (15 of 40 sprite durations inside the hardware windows with Suzy's row timeline measured from a game capture, the default; 16 of 40 with the older fitted model behind `LYNX_SUZY_TIMELINE=paths`); M6 suites 32 of 34 on each row (audio 6/6, audio2 7/7, UART 15/17, constants fitted), the mix and `--wav`; M7 the cart EEPROM (three titles keep their saves across runs; AUDIN banking and the sweep not done); M8 `lynx-play` (pygame-ce), judged headless only: no human has looked at it. All hardware suites: 95 of 122 on each row. Measured 2026-11-14 at the commits named in status.md. The 2026-11-19 library sweep's four issues are settled (status.md): no bus read can crash the board, Mines 2 (Demo) boots from both its files, and BLL `.o` programs boot behind the BLL kit's own cart loader. Run a cart (bring your own boot ROM through `$MAME_ROMPATH`): python -m lynx_python CART --frames 600 --png out.png --wav out.wav lynx-play CART # needs pygame-ce: .venv-pypy/bin/pip install pygame-ce ## Scope | Machine | Phase | | --- | --- | | Lynx II (bit opcodes, stereo; the default row) and Lynx I (65SC02 subset, mono) | machine rows from the start | | Carts: 256/512/1024/2048-byte blocks, AUDIN banking, 93Cxx EEPROM | milestones 0 and 7 | | Formats: `.lnx`, `.lyx`, BLL `.o`, each loose or in `.zip`/`.7z` | milestone 0 | | ComLynx between two consoles | later; the UART and its own echo are in | What stands in for a console (there is none here): the Epyx/Atari specification, logic-analyser captures of a Lynx II published with Gearlynx (recordings of hardware), and drhelius' Lynx Hardware Tests, whose expected values were taken on real machines. No die-level model of Mikey or Suzy exists. ## Romsets and firmware Found through environment variables only, read in place: `NO_INTRO_DIR` (the cart sets `$NO_INTRO_DIR/Atari - Atari Lynx (...)`), `MAME_ROMPATH` (the boot ROM inside `lynx.zip`, found by hash), optionally `LYNX_BOOT_ROM`, `LYNX_EXTRA_SETS` and `LYNX_NOINTRO_DAT`. The boot ROM (`lynxboot.img`, SHA-1 `e4ed47fae31693e016b081c6bda48da5b70d7ccb`) and every cartridge are bring-your-own; without a boot ROM the loader frame is decrypted by the host. ## What is fetched Nothing third-party is committed. `scripts/fetch_references.py` rebuilds `reference/` and `tests/test_roms/` from `scripts/pinned_files.json` and `scripts/pinned_repos.json` (narrowed in the restart so nothing the rules forbid is fetched). `scripts/build_lynx_tests.py` builds the hardware tests from their MIT sources with the pinned cc65. ## Working on it python3 -m venv .venv && .venv/bin/pip install -e ".[dev]" pypy3.11 -m venv .venv-pypy && .venv-pypy/bin/pip install --upgrade pip && .venv-pypy/bin/pip install -e ".[dev]" .venv/bin/python -m pytest # the quick loop .venv/bin/ruff check . && .venv/bin/ruff format --check . ## Licence MIT (see `LICENSE` and `NOTICE`). The fetched material keeps its own terms, recorded per entry in the pin lists.