# a2600-python **Lineage:** a2600-python → a2600-rust → a2600-rust-fast → play-2600, a2600-play · fixes start in a2600-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 2600 (Video Computer System)**, to be built as a board on [6502-python](https://github.com/alewman/6502-python): 6502-python owns the instruction set (the 6507 is a 6502 die with 13 address lines and no interrupts); this repository will own everything around it: the TIA's picture and sound to the colour clock, the RIOT's RAM, ports and timer, WSYNC, the cartridge connector and the bankswitching schemes behind it, and the clock that ties them together. **Status (2026-11-14, restart complete): milestones 1-7 pass, the 7800 sockets are in, the charter's obligations are met** (every rung with its command, count and commit: [docs/status.md](docs/status.md)). The 6507 runs on the board in instruction lockstep with MAME 0.285 and Stella. The TIA is a signal-level model of the circuit that matches Sim2600's transistor-level 10444D on every pin, both audio pads included, across 39 die traces; where seven consoles and the die disagree (one HMOVE race) it follows the consoles. Two TIA revision fields derived from ale-79's serial tables make each of the six PAL/SECAM consoles' rows match every cell of its own seven tables. Every bank-switching scheme the licensed dumps use is built from Horton's document and MAME's BSD-3 devices; against Stella 630 of 661 plain-scheme dumps and 41 of 52 others agree on every frame, the rest listed with causes. Joysticks, paddles, keypads, the Driving controller, the Booster Grip and the SaveKey (a 24LC256 a SaveKey game reads back) work, in `a2600-play` (pygame-ce) and headless. It runs at about 18 % of real time on PyPy (3 % on CPython): correct, not fast. The CPU core is 6502-python `741419a`, the commit the rest of the family pins; the 7800 board's four requests after its repin are decided in [docs/api.md](docs/api.md). The commit the Rust transcription and the 7800 board should pin is named in [docs/status.md](docs/status.md). The documents in [`docs/`](docs/README.md) gather what the build needs, every fact with its source and tier: the hardware, the timing, the cartridges, the quirks and contradictions, the oracles (including a transistor-level TIA simulation that runs here), a verified MAME recipe, Stella and Gopher2600 driven headless, and the brief for the session that builds it ([docs/handoff-brief.md](docs/handoff-brief.md)). ## Scope | Machine | Phase | | --- | --- | | NTSC VCS (all console models; reference TIA: the die-photographed 10444D) | the reference, judged by the die | | PAL, SECAM | rows on their own clocks (milestone 7) | | The six #699 consoles (PAL Jr. '84, Jr. '91, light sixer, Vader, SECAM woody, PAL 7800) | rows with TIA revision fields, each matching its own tables | | Other TIA revision differences (Cosmic Ark, Kool-Aid Man, Pesco, "2 or 3"…) | fields only where a table or photo shows them; none yet | | Atari 7800 in 2600 mode | a7800-python, through the sockets in [docs/api.md](docs/api.md) | ## Running ```sh python -m a2600_python ROM --frames 60 --png out.png --wav out.wav a2600-play ROM [--left driving|booster|paddles|keypad] [--right savekey] # pip install '.[play]' ``` The window is a host on the board (keys in `src/a2600_python/play.py`); `SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy a2600-play ROM --frames N --screenshot out.png` runs it headless. SaveKey data lives under `~/.local/share/a2600-python/`. Romsets are found through `NO_INTRO_DIR` and `MAME_ROMPATH` only. Bankswitching lives in this repository behind a connector protocol ([docs/cartridge.md](docs/cartridge.md)): 2K/4K, F8, F6 and Super Chip cover 92 % of licensed No-Intro dumps, seven schemes 95 %, thirteen 99 %. ARM schemes (DPC+, CDF) are out of scope. ## What is fetched Nothing third-party is committed. `scripts/fetch_references.py` rebuilds `reference/` and `tests/test_roms/` from `scripts/pinned_files.json` (257 files pinned by SHA-256: documents, schematics, die photos, hardware captures and photos, test ROMs, Stella issue threads) and `scripts/pinned_repos.json` (6 repositories at full commit SHAs, sparse where large: Sim2600, tia-fpga, 6502.ts's test cartridges, MAME's BSD-3 cartridge files and CC0 software lists, and others). Stella and Gopher2600 are closed boxes run as built programs; their source is not fetched (Aubrey, 2026-11-24; docs/validation.md): ```sh python scripts/fetch_references.py # everything missing python scripts/fetch_references.py --verify # check what is present ``` It needs `git` and `curl`. Live pages (forum threads, issue threads) are reported when changed and kept; everything else must match its hash. ## Scripts | Script | What | | --- | --- | | `scripts/fetch_references.py` | the pinned references and test ROMs | | `scripts/count_bankswitch.py` | scheme, controller and TV census over the local No-Intro sets, read in place, classified by MAME's software list and the pinned Stella binary's `-rominfo` ([docs/cartridge.md](docs/cartridge.md)) | | `scripts/mame_trace.py` | MAME 0.285 per-instruction 6507 trace with TIA/RIOT/hotspot accesses ([docs/mame-oracle.md](docs/mame-oracle.md)) | | `scripts/lockstep_mame.py` | the board beside a MAME trace, instruction by instruction ([docs/mame-oracle.md](docs/mame-oracle.md)) | | `scripts/lockstep_stella.py` | the board beside Stella's trace: registers and beam position per instruction | | `scripts/die_trace.py` | a Sim2600 die trace replayed into the TIA, every pin scored every half clock | | `scripts/die_board.py` | the whole board against Sim2600's 6507: every TIA write's half clock | | `scripts/die_carts.py` | new test cartridges for die traces, built from scratch | | `scripts/picture_compare.py` | the board's picture against Gopher2600's or Stella's, every visible colour clock of every frame, with the TIA writes near a divergence and `--delay-writes` to test an explanation | | `scripts/sweep_stella.py` | every licensed dump whose scheme is built, frame-compared with Stella; `--explain`, `--summary` | | `scripts/serial_699.py` | ale-79's serial test ROMs decoded from the board's SWCHA writes, compared cell by cell with six consoles | | `scripts/serial_consoles.py` | milestone 7's judge: one console's seven tables against its own row, every cell | | `scripts/frame_hashes.py` | pixels, audio and registers of ten games x 600 frames; `--check tests/frame_hashes.tsv` proves a change left the 2600 alone | | `scripts/seeded_faults.py` | one-line faults, each run through its judge, each must be caught | | `scripts/stella_run.py` | a locally built Stella driven headless: libretro core via ctypes (frame digests, PNG, WAV, RAM), or the SDL build's debugger (TIA variants, instruction trace) ([docs/validation.md](docs/validation.md)) | ## Licence MIT (see `LICENSE`), for what is in this repository. The fetched material keeps its own terms, recorded per file in the pin lists.