# lynx-rust **Lineage:** lynx-python → **lynx-rust** · fixes start in lynx-python and flow down by merges · [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) A Rust Atari Lynx board (Lynx I and Lynx II) transcribed from [lynx-python](https://github.com/alewman/lynx-python) at `75b9be7` and proven equivalent to it in lockstep: every CPU bus cycle (address, value, direction, board time), every finished picture and RAM, slice by slice, on a case table of hardware-test ROMs, the smoke titles, EEPROM titles, both machine rows and scripted input, plus a save-state round trip half way through every case. The CPU is [w65c02-rust](https://github.com/alewman/w65c02-rust) (crate `w65c02`) at `99c3e19`, a path dependency: check it out beside this one. "Matches the Python" is execution fidelity; how well the Python matches real consoles is lynx-python's docs/validation.md (95 of 122 hardware tests per row at `bc5f35e`; Suzy's sprite timing partial). A transcription of an uncertain model is still an uncertain model. Each `src/` module is the transcription of one `lynx_python` module (`machine`, `board`, `mikey/{timers,display,uart}`, `suzy/{math,engine}`, `cart/{port,eeprom,formats,table, loader,decrypt,convert}`, `bootrom`, `romsets`, `picture`, `sound`, `testrom`), with the same names, order, structure, comments and evidence tags; where Rust forced a difference, the module header says so. The one addition is `state.rs`: save states (the reference has none). ## 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). ## Build and run ```sh git clone https://github.com/alewman/w65c02-rust # at 99c3e19 git clone https://github.com/alewman/lynx-rust cd lynx-rust cargo test --release # ROM-free tests cargo build --release target/release/lynx CART --frames 600 --png out.png --wav out.wav cargo build --release --features frontend # needs SDL2 target/release/lynx-play CART ``` `lynx CART [--frames N] [--machine lynx1|lynx2] [--png FILE] [--rotation none|left|right] [--wav FILE] [--eeprom TYPE[:ORG]]` runs a cart headless (`python -m lynx_python`). `lynx-play` is the window (`lynx-play` of the reference; SDL2 here instead of pygame-ce): arrows = joypad, Z = A, X = B, 1 / 2 = Option 1 / 2, Enter = Pause, Escape closes; `--flip` for left hands; paced by the frame period the board measures. **No human has looked at it yet**: it is judged headless (`lynx-play CART --judge`, SDL's dummy drivers). `lynx-cart info|convert|override` is the reference's cart tool; `lynx-hwtests` runs the lynx-tests suites on this board; `lynx-trace` is the board side of the lockstep gate; `lynx-sweep` runs one cart of a library sweep (`scripts/sweep.py`, results in docs/sweep-2026-11-19.md). ## Romsets and firmware Found through environment variables only, read in place, as the reference finds them: `MAME_ROMPATH` (the boot ROM inside `lynx.zip`, by hash), optionally `LYNX_BOOT_ROM`; `NO_INTRO_DIR` (the carts). The boot ROM and every cartridge are bring-your-own. EEPROM saves and overrides live under `$XDG_DATA_HOME/lynx-python/` (the reference's directory, so both tiers share them). ## The gate `scripts/ladder.sh` (see docs/status.md): fmt, clippy, tests, the lockstep (`scripts/lockstep.py` over `scripts/cases.tsv`, the reference traced by `scripts/lynx_trace.py` on its own PyPy venv, traces cached by case), the same with `--save-at-half`, and with `FAULTS=1` the seeded faults (`scripts/seeded_faults.py`). The lockstep needs the private reference, so it runs locally; CI runs fmt, clippy and tests. ## Licence MIT (see `LICENSE` and `NOTICE`, which carries the reference's notices).