# vectrex-python A readable, pure-Python emulator of the **GCE / Milton Bradley Vectrex**, to be built as a board on the family's cores: [m6809-python](../m6809-python) for the 68A09 (approved; its Phase 0 is done, the core is not built yet) and [ay8910-python](../ay8910-python) for the AY-3-8912 (built). This repository will own everything else: the decode, RAM and system ROM, the **6522 VIA** that drives the whole machine, the **DAC, multiplexer, sample-and-holds and X/Y integrators** as a parameterised model that emits timed beam segments, the DAC voice, the two controller ports (analog joysticks, buttons, light pen, 3D Imager) and the cartridge port. **Status (2026-11-12): Phase 0, groundwork only, no emulator code.** The documents in [`docs/`](docs/README.md) hold what the build needs, every fact with its source and tier; [docs/handoff-brief.md](docs/handoff-brief.md) is the plan (9 milestones M0-M8, 20 unknowns, 10 conflicts, 9 open decisions). Measured while gathering: MAME 0.285 runs the `vectrex` driver headless with a per-instruction trace and a cycle-stamped VIA access log (boot plus three cartridges); the library census; the two system ROMs we have by checksum. **No hardware-tier oracle exists** for this board; the analog stage is compared against five emulators' named models, never judged. ## The picture is not pixels The board's video output is a list of beam segments (start and end in integrator units, brightness, start and end cycle). A rasteriser, outside the board's imports, turns them into a picture. Two emulators are compared exactly on the digital side (instruction stream, VIA accesses, VIA pins) and with a tolerance on the analog side, under a preset that reproduces each detector's own assumptions ([docs/analog.md](docs/analog.md)). ## What is fetched Nothing third-party is committed; the system ROM and cartridges are bring-your-own. `scripts/fetch_references.py` rebuilds `reference/` from `scripts/pinned_files.json` (45 files by SHA-256: the Service Manual and Troubleshooting Guide, the CC BY-SA logic-board redraw, Tomlin's Executive disassembly with cycle counts, Toal's Test Cartridge disassembly, Salomon's programming tutorial, Johannsen's lab pages, four 6522 data sheets) and `scripts/pinned_repos.json` (5 repositories at full commit SHAs, sparse where large: MAME 0.285's Vectrex and 6522 sources, Vide's documents and help pages, Vectrexy, ScopeTrex, VICE's VIA test programs). vecx, libretro-vecx, VecXGL, Vectrexia, the MiSTer core and VICE's source are closed boxes, not fetched (Aubrey, 2026-11-24; docs/provenance.md): ```sh python3 -I scripts/fetch_references.py # everything missing (~90 MB) python3 -I scripts/fetch_references.py --verify # check what is present ``` ## Scripts | Script | What | | --- | --- | | `scripts/fetch_references.py` | the pinned references | | `scripts/census.py` | the cartridge and system-ROM census, read in place (`tests/census/census-2026-11-11.txt`) | | `scripts/mame_trace.py` + `mame_trace.lua` | MAME 0.285 headless: instruction trace, VIA access log, vector fetches, snapshot ([docs/mame-oracle.md](docs/mame-oracle.md)) | ## Licence MIT ([LICENSE](LICENSE)) for this repository's own documents and scripts. Fetched references keep their own licences, recorded per entry in the pin files.