# dsp16-python A readable, pure-Python **AT&T WE DSP16A** core, planned: the 16-bit fixed-point digital signal processor (one multiplier, a 36-bit ALU with two accumulators, a 15-instruction loop cache, a parallel and a serial port) at the heart of Capcom's **QSound** chip, the DL-1425, a mask-programmed DSP16A. Its purpose is to run the real QSound program (`dl-1425.bin`) for the CPS-1.5 (`cps1-python`) and CPS-2 (`cps2-python`) boards: Aubrey decided QSound is emulated low-level, on this core. The core itself knows nothing about QSound. **Status (2026-11-12): Phase 0 only.** No core code exists. What exists is the research, the pinned oracles, a working MAME recipe, measurements, and the handoff brief for the session that builds it: - the architecture, encodings and timing from AT&T's January 1989 Information Manual and the DSP16A data sheet ([docs/start-here.md](docs/start-here.md), [docs/instruction-set.md](docs/instruction-set.md), [docs/timing.md](docs/timing.md), [docs/peripherals.md](docs/peripherals.md)); - 10 contradictions and 21 unknowns, each with its tier ([docs/undocumented-behavior.md](docs/undocumented-behavior.md)); - what the boards need around the DSP: host port, register file, sample ROM addressing, output path ([docs/qsound.md](docs/qsound.md)); - every oracle and its tier ([docs/validation.md](docs/validation.md)) and the headless MAME 0.285 recipe ([docs/mame-oracle.md](docs/mame-oracle.md)); - the ladder and the open decisions ([docs/handoff-brief.md](docs/handoff-brief.md)). **There is no hardware-tier oracle for the instruction set**: no AT&T assembler or simulator survives, no per-instruction corpus and no die model were found. The judges are AT&T's documents; MAME's low-level QSound device (reachable only through its `vgmplay` driver), its high-level device and jotego's Verilog DSP16 are detectors. Measured here: MAME's cycle model agrees with the manual on every one of 805,331 traced instructions, and the program's loop is **1,245 machine cycles (24,096 Hz)**, not the widely quoted 1,248. ## What is fetched Nothing third-party is committed. `scripts/fetch_references.py` rebuilds `reference/` from `scripts/pinned_files.json` (the Information Manual, the DSP16A data sheet and addendum, three AT&T application notes, superctr's register gist, all by SHA-256) and `scripts/pinned_repos.json` (MAME 0.285, the documents, captures and test programs of jotego's jtdsp16 (not its HDL), libvgm, at full commit SHAs, sparse). jtcores and FinalBurn Neo are closed boxes whose source is not fetched (Aubrey, 2026-11-24; docs/provenance.md). The QSound program is read in place from MAME's device set (`ROMs (bios-devices)/qsound.zip`), SHA-1 checked. ```sh python -I scripts/fetch_references.py # fetch what is missing python -I scripts/fetch_references.py --verify # check the pins python -I scripts/ocr_reference.py # text copies of the scanned PDFs ``` ## Scripts | Script | What | | --- | --- | | `fetch_references.py` | fetch and verify the pinned files and repositories | | `ocr_reference.py` | text copies of the PDFs under `reference/docs/text/` (pdftotext, or tesseract for scans) | | `mame_lle_trace.py` | write a QSound VGM, run MAME's low-level device headless, trace the DSP16A (`--busy` adds host traffic, `--dasm` writes MAME's disassembly) | | `cycle_audit.py` | charge a MAME trace by the manual's timing rules and compare with MAME's cycle count; sample period; executed opcode classes | | `program_census.py` | a static census of the program's encodings (an upper bound: it decodes data as code) | They need Python 3.11+, `git`, `curl`, poppler-utils and tesseract, and the installed MAME 0.285. No sudo. ## Licence MIT (this repository's own text and scripts). The fetched references keep their own licences, listed in the pin files; none is copied here.