Metadata-Version: 2.5 Name: colecovision-python Version: 0.1.0.dev0 Summary: Readable, pure-Python ColecoVision board built on z80-python, tms9918-python and sn76489-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: sn76489-python @ git+file:///data/emu/sn76489-python@c0d88a62107d18746ab09176e127c28ac9e05f5c Requires-Dist: tms9918-python @ git+file:///data/emu/tms9918-python@df9d8ae504d7b7a77f373e9f13ee1b73a4cf8c1a Requires-Dist: z80-python @ git+file:///data/emu/z80-python-m1-hook@f97c0f57115e7a59c2e046e4262e03e0c78007e0 Provides-Extra: dev Requires-Dist: pytest>=8; extra == 'dev' Requires-Dist: ruff==0.16.8; extra == 'dev' Description-Content-Type: text/markdown # colecovision-python A readable, pure-Python emulator of the **ColecoVision** (Coleco, 1982): a board on the family's cores, [z80-python](../z80-python) for the Z80A (with its M1-cycle hook), [tms9918-python](../tms9918-python) for the TMS9928A/TMS9929A, and [sn76489-python](../sn76489-python) for the SN76489A (not yet wired: its pin is missing, below). The board owns everything around them: memory and I/O decode with mirrors, the 8K BIOS and 1K RAM, the one-clock wait on every M1 cycle, the sound chip's READY wait, the VDP's interrupt as an NMI edge, the controller ports with keypad and spinner circuit, the cartridge slot and its boards, and sockets for the expansion port. **Status (2026-11-12): M1-M3, M5 (less the Super Controller Tester), M6, M7 met; M4 partly (sound chip not wired: its pin is missing); M8 not started.** Every number is in [docs/results.md](docs/results.md); provisional behaviours and their switches in [docs/claims.md](docs/claims.md); the story in [docs/worklog.md](docs/worklog.md); core gaps in [docs/core-issues/](docs/core-issues/). | Milestone | Result | | --- | --- | | M1 CPU, bus, BIOS | MAME's 2 s BIOS trace in lockstep: 945,993 instructions, 17,821 port writes, 1 read, 0 differences | | M2 VDP background | BIOS, Zaxxon and Final Test screens equal to MAME and Gearcoleco by colour index (0 pixels); Final Test prints ROM CHECKSUM D483, ROM GOOD, RAM GOOD | | M3 sprites and status | 12-title smoke list at gameplay: 44 of 48 pictures equal to MAME (MAME's switches); all port-access replays end at a sprite-status read (core issue 0003) | | M4 sound | 6 games' sound streams equal to MAME's for 12.8-17.1 s of game sound each; periods 0/1 audible in 8 titles; **chip wiring blocked** (pin `1eeb583` absent) | | M5 controllers | BIOS DECODER and UPDATE_SPINNER, Final Test controller screen, Turbo and Slither respond; Super Controller Tester not done | | M6 cartridge boards | MegaCart, X-in-1, Activision + 24C02/24C256 on synthetic images | | M7 sweep, PAL, long replays | 584 of 600 sweep pictures equal to MAME, all 16 others triaged; PAL BIOS lockstep 0 differences, 23 of 24 Europe-only pictures equal; 6 games' port replays 0 differences over 20.1-26.2 M CPU steps | | M8 Super Game Module | not started: an add-on, no image in the library | ```sh python -m venv .venv && .venv/bin/pip install -e '.[dev]' pypy3.11 -m venv .venv-pypy && .venv-pypy/bin/pip install -U pip && .venv-pypy/bin/pip install -e '.[dev]' .venv/bin/python -m colecovision_python "Zaxxon (USA, Europe).zip" --frames 300 --png out.png .venv/bin/pytest # unit tests, and the M1 lockstep if the MAME trace is present .venv/bin/pytest -m slow # the detector picture comparisons ``` The package imports as `colecovision_python`. Cores are pinned by commit from local clones (`git+file`): z80-python `f97c0f5` (branch `m1-fetch-hook-rebased`), tms9918-python `df9d8ae`. The PyPy venv needs a current pip (24.0 rejects `git+file` URLs with a commit). Speed (reference board, correct first): about 0.3-0.5 x real time on CPython and 0.6-2.9 x on PyPy (`PYPY_GC_NURSERY=1M`), by title. BIOS and cartridges are bring-your-own, read in place: the BIOS by SHA-1 from the local MAME sets (or `$COLECO_BIOS`), cartridges from raw, zip or 7z files. Nothing third-party is committed. | Machine | State | | --- | --- | | ColecoVision NTSC (TMS9928A, 262 lines): the reference | M1-M6 | | ColecoVision PAL (TMS9929A, 313 lines, its own BIOS): a machine-table row | BIOS lockstep and 8 Europe-only images (M7) | | Super Game Module (AY-3-8910 + RAM): expansion socket, a later add-on | sockets and fakes only | | Expansion Module 1, the ADAM, clones | out of scope | ## Scripts | Script | What | | --- | --- | | `scripts/fetch_references.py` | the pinned references (Phase 0) | | `scripts/count_carts.py` | the library census (Phase 0) | | `scripts/mame_trace.py` | MAME per-instruction trace and I/O log ([docs/mame-oracle.md](docs/mame-oracle.md)) | | `scripts/lockstep_mame.py` | replay a MAME instruction trace against the board | | `scripts/mame_io.py`, `scripts/replay_io.py` | MAME port-access log with scripted inputs; its replay against the board | | `scripts/mame_frames.py`, `scripts/libretro_run.py` | detector pictures at chosen frames with scripted inputs (MAME, Gearcoleco) | | `scripts/smoke_pictures.py` | a smoke list against both detectors by colour index (`--io` adds the port replay) | | `scripts/compare_pictures.py` | one run against detector pictures | | `scripts/sound_streams.py`, `scripts/psg_sweep.py`, `scripts/psg_streams.py` | sound-write streams; the library's periods 0 and 1 | | `scripts/final_test.py`, `scripts/spinner_games.py` | Coleco's Final Test Cartridge; Turbo and Slither under spinner input | The Python floor is 3.11 (the newest PyPy supports); PyPy must work. Licence: MIT.