# Handoff brief: a7800-rust **Lineage:** a7800-python → **a7800-rust** · fixes start in a7800-python and flow down by merges · [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) ## What this is The `x-rust` tier of the Atari 7800 board: a line-by-line transcription of [a7800-python](../external/a7800-python) at **`d6b220d`** (the commit its docs/status.md names for a7800-rust), proven identical to it by a per-slice lockstep gate (charter, "Proof obligations": every bus cycle and every picture, per slice). It is not a second design. Behaviour is defined and fixed in a7800-python; anything here that looks wrong is reported there with a repro, never fixed here. ## The reference and its dependencies, and their Rust tiers | Reference (Python) | Pinned by a7800-python | Rust tier used here | How | | --- | --- | --- | --- | | a7800-python | `d6b220d` (this crate's reference) | this crate | the reference clone at `external/a7800-python` (checked out at `d6b220d`), run on a7800-python's own `.venv-pypy` (which holds the three pins below) | | a2600-python | `28fb095` | a2600-rust `f9af024` (crate `a2600`, transcribing `28fb095`) | path dependency `../a2600-rust` (no remote yet) | | 6502-python | `741419a` | 6502-rust `129e742` (crate `sixfiveohtwo`; code as `71747eb`, docs since) | path dependency `../6502-rust`, the same copy a2600-rust uses, so the two crates share one `Mos6502` | | pokey-python | `6ed1ffa` | pokey-rust `b37263d` (crate `pokey`) | path dependency `../pokey-rust`, feature `serde` | `scripts/ladder.sh` checks that each sibling is at its pin with a clean tree before it runs anything. ## The sockets a2600-rust gives a 7800 - `Board::new(machine, cartridge, Some(tia), Some(riot), cycles)`: the 7800's TIA and RIOT handed over with the RIOT's Φ2 count. - `System::with_cpu(board, machine, cpu: Mos6502)`: SALLY adopted as it stands. SALLY runs on this crate's board type, so at the hand-off it is moved onto a `Mos6502` through 6502-rust's `capture_state` / `restore_state`, and the rest of its frame (the stall and DMA fields `restore_state` does not carry) is copied with it, so nothing of the CPU changes at the hand-off. - The rows `NTSC_7800`, `PAL_7800` (`tia_clocks_cpu` false), `Audio::on_sample`, and the gates (`die_traces`, `timer_roms`, `serial_tables`, `lockstep`, `run_hashes`, `smoke_names`) callable with this crate's factories. ## Scope (the brief this repository was started from, 2026-11-19) 1. Module for module: machine, MARIA, the board, the system, the cartridge schemes (linear, SuperGame and its options, Activision, Absolute, mirror RAM, banksets, the POKEY socket, the High Score Cartridge), the confirmed table, the A78 header, the one loader and the BIOS's own test, controllers (ProLine, light gun, paddles, trak-ball), sound (the TIA + POKEY mix), the television stage, 2600 mode through a2600-rust's sockets. Rust-forced differences in each module's header. 2. The gate, `scripts/ladder.sh`: the reference's unit tests transcribed; per-slice lockstep against the reference (CPU state, board time, CRC of every bus cycle, picture CRC, audio CRC of the TIA + POKEY mix) over `scripts/cases.tsv`; a2600-rust's gates run through the 7800's own TIA construction and 2600 mode; seeded faults. 3. A desktop window `a7800-play` (feature `frontend`, SDL2), the reference's controls, judged headless. 4. LICENSE (MIT), SPDX headers, NOTICE carrying the reference's notices, the lineage line, docs/status.md, romsets by `NO_INTRO_DIR` / `MAME_ROMPATH`, CI as gameboy-rust has it (cheap; the lockstep is local only). ## Save states The reference has **no whole-machine save state** (its docs/status.md, "The POKEY core swap": "the board has no whole-machine save state yet"); only the cartridge has `snapshot()` / `restore()`. A Rust save state is added here only if the gate proves it: saved half way through a case, loaded into a fresh console, the rest of the trace identical to the reference's uninterrupted run (`--save-at-half`). ## Rules Transcribe, do not redesign. Local git only. Never modify a7800-python, a2600-rust, 6502-rust, pokey-rust or their references. ROMs and BIOS images are read in place. No `rm -rf`, `sed -i`, `ln -sfn`, `pkill -f`; at most three processes, `nice -n 19`, `PYPY_GC_NURSERY=1M` for the reference, every long run under `timeout`. Progress: [build-progress.md](build-progress.md). Status: [status.md](status.md).