Metadata-Version: 2.5 Name: a2600-python Version: 0.1.0.dev0 Summary: Readable, pure-Python Atari 2600 emulator built on 6502-python Author: alewman License: MIT License Copyright (c) 2026 alewman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License-File: LICENSE Requires-Python: >=3.11 Requires-Dist: 6502-python @ git+https://github.com/alewman/6502-python@1ae3610015abcb643294fab986dbfb64a45d79b7 Provides-Extra: dev Requires-Dist: pytest>=8; extra == 'dev' Requires-Dist: ruff==0.16.8; extra == 'dev' Description-Content-Type: text/markdown # a2600-python 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-10-25): milestones 1-4 of 7 pass.** The 6507 runs on the board in instruction lockstep with MAME 0.285 and Stella. The TIA's picture and sound are a half-colour-clock 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. The RIOT timer shows the consoles' results on the Stella-issue timer ROMs, and ale-79's serial HMOVE tests from six consoles are decoded from the board's own port writes and match every cell the consoles agree on. Against Stella, 630 of the 661 licensed dumps whose bank-switching is built agree on every frame of 150-frame runs, 233 of them once Stella is made as late as the die shows it to be on five kinds of write; the 31 left are listed with their causes. Paddles, keypads and `python -m a2600_python ROM --png --wav` work. It runs at about 15 % of real time on PyPy (3 % on CPython): correct, not fast. Details in [docs/validation.md](docs/validation.md) "Certification record". 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) | 1 | | PAL, SECAM | machine rows from the start, certified later | | TIA revision differences (Cosmic Ark, Kool-Aid Man, Pesco, "2 or 3"…) | fields on the machine row, only where evidence shows them | | Atari 7800 | a future board (it reuses the TIA and RIOT) | 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` (256 files pinned by SHA-256: documents, schematics, die photos, hardware captures and photos, test ROMs, Stella issue threads) and `scripts/pinned_repos.json` (9 repositories at full commit SHAs, sparse where large: Stella, Gopher2600, Sim2600, tia-fpga, 6502.ts and others): ```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/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.