# Provenance Where this core's facts came from, the decisions taken where no source settles a question, what was deliberately left unread, and what was seen and not used. The rules behind all of it are in [restart.md](restart.md). ## Where each kind of fact came from The full source table, with each source's licence, tier and how it was read, is [phase0.md](phase0.md). In short: - **The register map, the write protocol, the divide-by-16 tone clock, the noise rates, the 2 dB attenuator and the 32-clock READY time**: Texas Instruments' data sheets (S1, S2) and Sega's manuals for the Mark III, the Game Gear and the Genesis (S3, S4, S5), tier 2. Sega's Game Gear manual is the best manufacturer source for Sega's part (16-stage noise, n = 1 as the top note, the stereo port, silence at power-on). Its pages are stamped "CONFIDENTIAL" and "PROPERTY OF SEGA"; it circulates online through SMS Power's archive of official documents and is cited and quoted a sentence at a time, with no table or page copied. - **The discrete chip's noise register and white-noise sequence**: John Kortink's capture of a BBC Micro's chip (S9), tier 1, the one hardware capture the core is judged against. - **What is specific to Sega's part** (16 stages, taps 0 and 3, a data byte reaching the attenuation and noise registers, tone values 0 and 1): Maxim's SMS Power page and notes (S6, S7), resting on captures by Maxim and Charles MacDonald that are not published; and MacDonald's own hardware notes (S10, S11), tier 3. - **The Mega Drive's test bits**: one paragraph on Plutiedev (S15), tier 3. - **Provisional defaults where nothing above tier 5 speaks**: MAME's `sn76496` device (S19, BSD-3-Clause), read, and marked emulator tier wherever used. - **Closed-box observations**: Nuked-PSG, run and not read (restart.md rule 8). Its outputs are recorded in [validation.md](validation.md) as a detector's opinions; no constant of the core was fitted to them (claims.md, C5). Every rule in the code names its spec section or says CHOICE or PROVISIONAL, and every spec statement names its source. ## Decisions taken Where no source settles a chip-level question, the core takes the decision below, marks the behaviour **provisional** in the code and the spec with the source's tier, and holds it as data on `PSGVariant`, so that a later measurement changes one value and not the structure. The D numbers are cited from the code, the spec and the tests. | | Decision | Why | |---|---|---| | D1 | emu-russia's traced netlist of the Mega Drive's PSG (SEGAChips, CC0) may be **run** as a closed box under rule 8, never read. It was not needed for the first build and has not been run. | The licence allows reading it, but its topology page credits the cell map to the author of the Nuked models, whose view of AI use is not known (rule 7), and a netlist of this exact circuit is as close to a blueprint as a source gets. | | D2 | The annotated SN76489A die photograph (gchiasso) stays unread. | Its licence line is non-commercial (CC BY-NC), and the spec does not need it. | | D3 | On Sega's parts tone value 1 toggles every tick, and value 0 behaves as value 1. Provisional. | Sega's manual says n = 1 is the top note; MAME's note, "Verified on SMS hardware", has value 0 act as value 1. This halves the level of sample playback against Maxim's "constant +1"; the README says so. | | D4 | On the discrete chip tone value 0 is a period of 1,024. Provisional, emulator tier. | MAME's note, consistent with TI's description of a down counter reloaded on borrow. | | D5 | The discrete chip is not reset at power-on: it powers up sounding (attenuations 0, tone values 0), and a board may ask for a silent start. Provisional. | That it sounds is MacDonald's observation on an SC-3000H (S10); the values are MAME's rendering. | | D6 | Sega's parts latch tone 0 at power-on. Provisional. | Maxim's 2003 text says tone 0; MAME says the second tone channel's attenuation. Neither publishes its test, MAME's two comments disagree about which register is meant, and no known program depends on it. | | D7 | `write_test` exists only on `YM7101_PSG` and follows the one published paragraph literally: bit 9 enables, bits 11-10 choose the channel whose attenuation level replaces all four outputs. Provisional, untested. | Plutiedev's paragraph is the only source. | | D8 | Recordings from a Sega console are deferred. Rung 4 stays empty, and the README says so. | No console recordings have been made. validation.md lists the probes that would settle most of the unknowns for the Mega Drive's part. | | D9 | Models run as detectors in rung 5: Nuked-PSG (run only) and MAME's device. Genesis Plus GX is not run. | Rule 8 names GPL and LGPL models; Genesis Plus GX is under a non-commercial licence and is left out entirely. | | D10 | Sega's manuals are cited and quoted a sentence at a time; no tables or pages are copied. The tests carry the numbers they check, with the page named. | They are © Sega, and the Game Gear manual is marked confidential. | | D11 | The core ships the ideal 2 dB volume table. A console's measured curve is a table a board passes in. | No measured curve is in hand for any Sega part. | | D12 | Nothing has been posted to SMS Power about its mislabelled noise files (C9). | Both downloads are Kortink's BBC Micro data; SMS Power's stance on AI-written posts has not been checked. | | D13 | The live SMS Power page was compared with the snapshot before the spec relied on it. | It was unreachable during Phase 0. Fetched on 2026-11-12, it is byte-identical to the snapshot (spec section 15). | ## What was deliberately not read, and why | What | Why | |---|---| | Nuked-PSG's source (`ympsg.c`) and every other Nuked model, wherever a copy sits | GPL or LGPL: rule 1. Nuked-PSG is compiled and run as a closed box (rule 8); only its header, licence and README were opened. | | Genesis Plus GX, Gearsystem, openMSX, BlastEm, jt89 (a GPL Verilog SN76489) | GPL, LGPL or non-commercial: rule 1. | | The withdrawn core, in Python and Rust, and anything derived from it | Rule 2. It is not published and is not in this tree. | | megadrive-python's `src` audio and PSG code, and descriptions of chip internals in megadrive-python's and sms-python's documents | They may describe the chip in the withdrawn core's terms (rule 2). | | emu-russia SEGAChips' netlist, Verilog, Logisim and cell files for the PSG | Decision D1. | | The annotated SN76489A die photograph, beyond one reduced view | Decision D2. | | siliconpr0n's photograph of an SN76489AN die | A photograph settles nothing without tracing it. Not opened. | ## Material seen and not used | What was seen | What was done | |---|---| | One line of C from PicoDrive's copy of an old MAME `sn76496.c`, shown in the summary of a web search result | Nothing from it is in the code or the spec. It was not sought, and the file was not opened. | | One 1,400-pixel reduction of the annotated SN76489A die photograph, viewed to find its licence, which is written only on the image. At that size the block labels are legible (a noise row labelled Q0 to Q14 with an XOR cell, tone rows Q0 to Q9, dividers); no annotation text was read | Nothing from it is in the code or the spec. The register lengths rest on Kortink's capture (15 stages) and on Sega's manual and Maxim's page (16). | | The names of the fields of Nuked-PSG's state structure, which its public header declares alongside the calls the harness uses | The harness uses only the calls, and no part of the core was shaped by the field names (claims.md, C4). | ## History On 2026-11-22 (the family's history clean-up, wave G) `validation/nuked_harness.c` left this repository and was removed from every commit with `git filter-repo`; every other change kept its commit. The harness is linked with Nuked-PSG (GPL-2.0-or-later), so by the family's rule of 2026-11-19 it is a GPL tool. It is kept with the family's other GPL tools (emu-tools-gpl, `tools/sn76489-python`), and `validation/closed_box.py` found it through `SN76489_GPL_TOOLS`. Commit hashes cited from before that date refer to the old history, which is kept privately. On 2026-11-24 (one variable per tool repository, Aubrey) this repository stopped compiling the harness: emu-tools-gpl regrouped it as nuked-harness's `psg-stream` (the same command line and records), built there by `tools/nuked/build.sh` with its own fetch of Nuked-PSG at the same pin. `validation/closed_box.py` runs it at `$EMU_TOOLS_GPL/tools/nuked/build/psg-stream` (emu-tools/docs/contract.md, section 5) and stops with exit status 3 when the variable is unset or the harness is not built. Gated before and after: `closed_box.py` gave byte-identical output. On 2026-11-24 (Aubrey: MIT repositories hold no Nuked model's source) the four Nuked-PSG pins left `scripts/fetch_references.py` (`LICENSE`, `README.md`, `ympsg.h`, `ympsg.c`); nothing here built from or ran from them after the harness moved. The copy fetched before was moved, unopened, out of `reference/`, aside and outside the repository, not deleted. The header, licence and README the claims cite stay pinned as at `d15a168c676f4669e23660be9225b34ad7c1764e`. Gated before and after: `fetch_references.py --verify`, the tests and `closed_box.py --sweeps` gave the same results.