# Provenance Where every module's rules come from, and its verdict under the family's source rules (emulator-lineage `docs/sources.md`, the wave-2 rewrite rules, docs/restart.md). ## Restart 2026-11-19 The board was rebuilt from the Phase 0 documents (docs/restart.md). Sources used: Sega's hardware manual through docs/manual-registers.md (DOC); KRIKzz's prose notes and drive logs (DOC / hardware recordings); ares 9408cb4 `ares/md/mcd` (ISC, read, behaviour used with its notice in NOTICE; OBSERVED); MAME f379cd0's BSD-3 Sega CD files (read, OBSERVED); Genesis Plus GX, BlastEm and MAME as closed boxes (results only); mcd-verificator's binary as a closed box (its rows: TEST ROM). | Module | Sources | Verdict | | --- | --- | --- | | `disc.py` | CDRWIN manual App. A; Redump layout (carried over, audited clean) | clean | | `console.py`, `__main__.py` | own glue (carried over, audited clean) | clean | | `memory.py` | hardware manual p.11-18, p.23, p.54 (DOC); ares for cell-image writes (OBSERVED) | clean, MIT | | `gatearray.py` | hardware manual p.19-34, p.56-60 (DOC); KRIKzz notes (DOC); ares (OBSERVED, ISC) | clean, MIT AND ISC | | `graphics.py` | hardware manual p.34-54 (DOC); ares gpu.cpp behaviour (OBSERVED, ISC) | clean, MIT AND ISC | | `megacd.py` | hardware manual p.5, p.12-16, p.24, p.56-61 (DOC); ares mirrors (OBSERVED, ISC); Motorola UM 6.3.1 | clean, MIT AND ISC | | `cdc.py` | LC8951 design manual (DOC; the decoder interrupt's pulse from §12.6 and appendix E since 2026-11-24); KRIKzz forum t=3166 (DOC, hardware prose); hardware manual p.26-27 (DOC); ares cdc.cpp, cdc-transfer.cpp (OBSERVED, ISC); mcd-verificator rows (TEST ROM) | clean, MIT AND ISC | | `cdd.py` | hardware manual p.30-33 (DOC); KRIKzz notes (DOC) and drive logs (FITTED, seek times included since 2026-11-23, the seek's visible structure and the paused loop since 2026-11-24); ECMA-130 for built pregap blocks and the disc's geometry; your own BIOS's boot (FITTED, interoperability) | clean, MIT (ares's seek curve, ISC, replaced 2026-11-23) | | `pcm.py` | Sega's PCM Sound Source manual (DOC, page images, since 2026-11-23); hardware manual p.15, p.iv (DOC); MAME rf5c68.cpp (OBSERVED, BSD-3) and ares pcm.cpp (OBSERVED, ISC) for what the manual leaves out | clean, MIT AND BSD-3-Clause AND ISC | | `state.py` | megadrive-python's `state` module and docs/save-states.md (our own family, MIT; used through its API and private classes, nothing copied) | clean, MIT | | `ramcart.py` | hardware manual p.5 (DOC); layout unsourced, memory not modelled | clean | | `wiring.py` | own | clean | Nothing in the board is tagged MEASURED from hardware here (there is no Sega CD hardware here); the one MEASURED tag, `cdc.py`'s DMA periods, rests on a third party's recording of a real Mega-CD (the MiSTer repository's SignalTap captures, read off as pictures). ## Session 2 (2026-11-19): rules added, and their sources | Rule | Module | Source | | --- | --- | --- | | IFL2 reaches the sub CPU 14 sub clocks after the main CPU's write | `gatearray.py` | FITTED to mcd-verificator IRQ TEST (TEST ROM; passes for 9-19); write-cycle latch from Motorola's UM (DOC); mechanism HYPOTHESIS | | Sub CPU hangs on 2M word RAM it does not own, and on $0C0000 in 2M | `megacd.py` | hardware manual p.24 (DOC); KRIKzz `random notes.txt` (hardware prose, DOC); WORD RAM error 20 (TEST ROM) | | The hung access completes when the RAM is given to the sub CPU | `megacd.py` | WORD RAM error 21 (TEST ROM), against p.24's "only a forced reset"; ares `bus-internal.cpp` holds /DTACK the same way (OBSERVED, ISC) | | A host transfer ends (EDT, DTEI) when the last word is latched | `cdc.py` | hardware manual p.26's EDT wording (DOC); CDC FLAGS error 22 (TEST ROM) | | DMA periods: 10 sub clocks a word to PRG RAM and word RAM, 40 to PCM | `cdc.py` | MiSTer SignalTap captures `dma_prgram_continue.PNG`, `dma_wordram.jpg`, `dma_pcm_continue.PNG` (hardware recordings, pictures; MEASURED, third party) | | A transfer of an odd byte count moves whole words; PCM DMA moves bytes (20 sub clocks each) | `cdc.py` | CDC DMA2 errors 04 and 12 (TEST ROM); p.26's per-byte DSR for PCM (DOC); the PCM capture (MEASURED, third party) | | The other CPU's host data register shows the latched word without taking it | `cdc.py` | CDC DMA3 error 28 (TEST ROM); not taking it is HYPOTHESIS | | A main-CPU write to $A12008 takes a word | `gatearray.py` | CDC DMA3 60 -> 62 (TEST ROM); mechanism HYPOTHESIS | | Word-RAM DMA waits while the main CPU owns 2M RAM; PRG-RAM DMA waits while SBRQ | `cdc.py` | CDC DMA3 errors 44 and 48 (TEST ROM); switch A, p.6-7 (DOC); ares holds the word-RAM DMA (OBSERVED) | | The write protect does not stop the PRG-RAM DMA | `cdc.py` | CDC DMA3 fails with 56 when it does (TEST ROM); ares protects DMA writes (OBSERVED, overruled) | | DTTRG leaves DTEI set; only DTACK clears it | `cdc.py` | LC8951 §11.3 (DOC); CDC FLAGS error 26 (TEST ROM); ares clears it at DTTRG (OBSERVED, overruled) | | SYIEN inserts a block sync (DECI) every 1/75 s with no data | `cdc.py` | LC8951 design manual, CTRL1 SYIEN and Figure 9 (DOC); with the drive stopped: CDC FLAGS error 30 (TEST ROM), HYPOTHESIS | | HINT vector override at $400070-$400073 in mode 1 | `megacd.py` | REG 2006 run as a mode-1 cartridge (TEST ROM); ares `bus-external.cpp` (OBSERVED, ISC) | | Backup RAM formatted by your own BIOS | `scripts/format_backup_ram.py` | BIOS manual ch.7 p.38-41 (DOC); `_BURAM` $5F16, BRMINIT 0, BRMFORMAT 6, scratch $640 bytes from megadev `lib/sub/bram.def.h`, `bram.h` (MIT); the bytes are the user's BIOS's, never committed | Run-time observation in session 2: mcd-verificator's register and mailbox traffic and the program counters of its accesses were logged (not its code); the user's BIOS's back-up RAM entry was called as documented (no instruction of it was disassembled). The MiSTer captures were viewed as images only; the repository's HDL was not opened. Debugging notes that touch other programs: mcd-verificator was run only, and its bus traffic to the gate array was logged at run time to see where a row waits (its source and its binary's code were not read). Your own BIOS (US v2.00W) was run, its register traffic logged, and about forty instructions of its sub-CPU program around a drive check were disassembled from PRG RAM at run time to see which status it expected -- an interoperability fact (the first exchange after HOCK must read "00.000000.0F"), which a real drive's log (KRIKzz, BI-mcd-tst/bios-start.txt, line 1) independently shows. ## Session 3 (2026-11-23): sources used | Rule or tool | Module | Source | | --- | --- | --- | | Save states on megadrive-python's state version 2 | `state.py` | megadrive-python efd80fc `state.py`, `docs/save-states.md` (MIT, family; its private encoder borrowed, not copied) | | Seek and play times, log2 of the tracks crossed | `cdd.py` | FITTED to KRIKzz's real-drive logs (`cd-log/`, hardware recordings) by `scripts/cdd_seek_times.py`; disc geometry ECMA-130 (DOC); 1.3 m/s HYPOTHESIS | | The fader's gain, FD09-FD02 / 256 | `cdd.py` | hardware manual p.31 through docs/manual-registers.md (DOC) | | The RF5C164's registers, sample format, mixing, sample period | `pcm.py` | Sega's PCM Sound Source manual ver. 1.0 (1991-10-14), pages 1, 6-14, read as images from the pinned 1999 HTML transcription and the pinned scan (DOC) | | A picture and sound referee | `scripts/referee.py`, `scripts/compare_audio.py` | Genesis Plus GX 49c5847 run as a libretro core (closed box; non-commercial licence, source never opened) | No emulator source was opened in session 3. ares and MAME files were not reopened (the PCM's remaining OBSERVED rules cite the session 1 reading). mcd-verificator was run only. ## Session 4 (2026-11-24): sources used | Rule | Module | Source | | --- | --- | --- | | The seek's visible structure: start busy, jumps, landing 14 short, play-in, the new state 3 sectors early | `cdd.py` | FITTED to KRIKzz's real-drive logs (`cd-log/`, hardware recordings), counted per phase | | The paused loop's 8 sectors and its jump back | `cdd.py` | FITTED to the logs (seek.txt, read-pause-resume.txt); KRIKzz's notes' "seek pos 250, loop range 240-247" (DOC) agree | | The decoder interrupt as a pulse of about 2,750 / 1,800 / 1,500 us, cleared by reading STAT3 or DECEN off | `cdc.py` | LC8950/LC8951 design manual §12.6 (p.63) and appendix E (p.108), read as page images (DOC) | | A sub-CPU write to $FF8008 takes a word | `gatearray.py` | mcd-verificator's CDC DMA3 row (TEST ROM), found by logging its register traffic at run time | | Which CDC chips fail CDC FLAGS 40 | docs | Mike Pavone, forum t=3166 (prose; hardware reports) | No emulator source was opened in session 4; mcd-verificator was run only. ## Closed-box sources removed (2026-11-24) Aubrey's rule of 2026-11-24: an MIT repository does not download or keep the source of anything the family's `sources.md` marks closed box only. Pins removed from `scripts/pinned_repos.json`, trees moved aside unopened, out of the repository (not deleted): Genesis Plus GX (`49c58476`), BlastEm (`ab743653`), jgenesis (`d41e2d97`), clownmdemu-core (`88ef45a6`), PicoDrive (`26ecb2b6`), KRIKzz's lib_mcd (`23dbd5ef`, no licence), and the MiSTer core's `rtl/MCD` (the pin keeps the SignalTap captures). The full clones `scripts/build_referees.py` made under `reference/build/` moved aside too; the two libretro cores built from them stay at their paths and the script now only checks they are there (docs/validation.md, "Emulators"). URLs and revisions are in validation.md. Kept, for Aubrey: mcd-verificator (no licence stated: run only, its source unread), and the US BIOS disassembly (`scd-bios-disassembly`, Sega's program, no licence: read as a commented listing of what the BIOS does), both test or reference material rather than emulators; flagged because the rule names unlicensed code. ## The 2026-11-13 audit (history) The wave-1 audit of the archived board (its own docs/provenance.md, archived with it and not read again) found the CD-ROM decoder written with Genesis Plus GX's `cdc.c` open and about twenty rules across the gate array, the memories, the drive, the graphics unit, the RAM cartridge and the port device taken from Genesis Plus GX (non-commercial) or BlastEm (GPL-3.0) by name; the wave-2 review found the archived board's citations of mcd-verificator error numbers came from reading its GPL-3.0 source. Verdict: restart (docs/restart.md). This section is reconstructed from docs/restart.md's summary, since the archived file is not read. ## The BIOS disassembly out; mcd-verificator run only (2026-11-25, decisions L2 and L5) Aubrey approved decisions L2 and L5 (emulator-lineage `docs/proposals/2026-11-decisions.md`) as recommended, which settles the two "kept, for Aubrey" items above: - **US BIOS 2.00W disassembly** (https://github.com/DarkMorford/scd-bios-disassembly @ `41acd10fe9d6b8ac699f0da5dceadf8efe018ea2`, no licence, Sega's program): a disassembly of console firmware is firmware in another form (charter, licences point 9). Its tree moved, unopened, from the git-ignored `reference/src/` to `/data/backup/segacd-python-closed-2026-11-25/scd-bios-disassembly/`, and its pin left `scripts/pinned_repos.json`. No script read it (searched). The facts already taken (the backup RAM format's marks, validation.md) stay, cited to it. - **mcd-verificator** (KRIKzz, `krikzz/mega-ed-pub` @ `8b72838f`; the repository's LICENSE is GPL-3.0, as sources.md records): a test program, **run only**. Its source, `mcd-verificator/src/` (C, assembly, linker scripts and built objects), was in the checkout (the pin's cone-mode sparse took the whole folder); it moved, unopened, to `/data/backup/segacd-python-closed-2026-11-25/mcd-verificator/src/`, and the pin now uses `sparse_patterns` for the prebuilt `mcd-verificator.bin` (sha256 `8433a0b5...`), its `readme.txt`, `cd-log/` (hardware recordings, data) and `notes/` (prose), plus the root LICENSE and README. The scripts use only the `.bin` (`libretro_run.py`, `mame_cd.py`, `referee.py`) and `cd-log/` (`replay_cdd_log.py`), both kept. Done on branch `licence-tidy` from `main` (the checkout was on another agent's branch, `drive-rules`); the reference trees are shared by every branch, so they moved in the main checkout. Not changed (decision T3, the tools agent's): the 240p Test Suite's pin here (GPL-2.0) fetches only its Sega CD data files (PCM samples, CD-DA tracks, cue), no source, Sega's security blocks excluded; whether even those belong in emu-tools-gpl is for that wave. Nothing under `reference/` is or ever was tracked (`git ls-files`, `git log --all`).