# Restart rules This repository is a restart. The earlier `pokey-python` was built (2026-11-12) by a session that read the source of Nick Mikstas's POKEY VHDL while writing the core. That VHDL carries no licence (all rights reserved). Its own audit found nothing transcribed, but pieces of the clocks, polynomial counters, timers and interrupt latch had been learned by reading it. On 2026-11-14 the owner chose to archive that repository (`zzz-pokey-python`, private, archived) and restart from the last commit before the build began: Phase 0 and the owner's decisions (`195e002`). Everything after that point is rebuilt under these rules. ## The rules 1. **No GPL, LGPL or unlicensed source is read.** Not to learn an algorithm, not to check a constant, not to settle a doubt. For this chip that covers Nick Mikstas's VHDL and Verilog (`atari_pokey`), Atari800 (`pokey.c`, `pokeysnd.c`, `mzpokeysnd.c`), ASAP, Altirra's source code, MAME's POKEY device, and Mark Watson's FPGA POKEY (non-commercial terms). Check /data/emu/emulator-lineage/docs/sources.md for anything else. 2. **The archived repository is not read**, in any form: not its code, not its tests, not its documents written after `195e002`, not its commit messages. 3. **Translating a model statement by statement is copying**, whatever the language. Code here is written from a written description of behaviour, never from another program's source. 4. **Permitted sources:** Atari's POKEY data sheet (C012294) and schematic sheets; the Altirra Hardware Reference Manual (a document, distinct from Altirra's code); the Acid800 and AcidSAP test sources and their expected results (MIT); recordings of real chips; community documents that report hardware findings; code under a permissive licence, with its notice kept. 5. **A model may be run, never read.** The VHDL may be built under GHDL and driven by a harness written here (testbenches drive pins and print pins, nothing else); its source files are not opened, searched or quoted, including when a comparison fails. Owner's rulings of 2026-11-13: a closed box may be used as a detector **and as a measuring instrument** (fitting a value to its outputs, building a stand-in row from them). A value got that way is tagged `OBSERVED` (closed box, model and pinned commit named), never `DOC` or `MEASURED`, and a document or a hardware number that disagrees overrules it. 6. **A difference from a closed box is written down, not fixed**, unless a document or a hardware measurement independently says the core is wrong; then cite that. 7. **Every rule in the code names its source** with an evidence tag (charter methodology: MEASURED, DIE, TEST ROM, DOC, OBSERVED, FITTED, HYPOTHESIS). A reader must be able to follow any number back to where it came from. 8. **The middle rule.** A fact is usable when someone established it on real hardware and says so in prose, whatever first suggested it; cite them and note the history. Code fragments in any document stay unread; tables a source says were copied from a GPL program are out unless established independently. 9. **An author who objects to AI use of their work is left out**, even where the licence would allow it. 10. **The Phase 0 documents inherited from `195e002` were written under the older rule** ("GPL source: read, cite, never copy"). Before any code is written, every statement in them that rests on reading the VHDL's or another implementation's source is struck or re-sourced, and that is recorded in `docs/provenance.md`. The pins, the closed-box harness design and the facts from documents stay. ## The order of work 1. Scrub the inherited Phase 0 documents (rule 10). 2. Build the core to the rungs in `docs/handoff-brief.md`, one rung per commit, from the documents and closed-box measurements. 3. The charter's obligations: SPDX headers, NOTICE, lineage line, `docs/status.md`, evidence tags, modelling level. 4. Adoption by a5200-python and a7800-python, then the Rust transcription `pokey-rust`. If you meet a source whose licence or author's wishes you are unsure of, stop and report. ## Amendments **2026-11-19, the owner's ruling on ijor's POKEY schematic** (recorded in emulator-lineage `docs/sources.md`, 34b0b2f). Jorge Cwik's (ijor's) die-derived schematic `PokeyReSchem-13.pdf` (version 1.3, 2023) is the **one exception** to rule 1's "unlicensed source". It may be read for facts only, as his ANTIC schematics are: read it for circuit behaviour, cite it as `[DIE: ijor PokeyReSchem-13, sheet/area]`, never reproduce the drawing, and never take its net names or its cell structure as the structure of code. The file lives in `reference/byo/` (gitignored) and is never committed. Nothing else in these rules changes: the Mikstas VHDL stays a closed box that is never opened, GPL and LGPL source stays unread, and `/data/backup` and every `zzz-*` repository stay unread. The PDF's sheets are numbered here by PDF page (page 1 is ijor's notes; 2 bus and address decode; 3 IRQ, SKCTL, SKSTAT, keyboard; 4 pots and the two clock prescalers; 5 timers, polynomial counters, audio; 6 serial; 7 cell legend and clock generator).