# Sound: CPUs, chips, clocks, and which cores exist Every sound subsystem here is a CPU with a ROM and a little RAM, a latch from the main CPU, and two to four sound chips. The family has some of the cores and not others. ## dec0 (and stadhero, actfancr) | Part | Clock | Evidence | Family core | | --- | --- | --- | --- | | 65C02 ("65C02A", MBD; MAME: Rockwell R65C02) | 1.5 MHz | DOC (MBD p. 1), OBSERVED | w65c02-python `R65C02` row (captured on a real R65C02); `G65SC02` if the part has no bit instructions (U5) | | or HuC6280 (Sly Spy, Midnight Resistance, Boulder Dash) | 3 MHz on the Sly Spy sheet and in MAME; MAME says 2 MHz for `midres` (C4) | JTSLY, OBSERVED | huc6280-python (CPU); the on-die timer, IRQ controller and PSG are in pcengine-python (decision 4) | | YM2203 (OPN: 3 FM channels + an SSG) | 1.5 MHz | JTSLY ("1.5MHz", `~CS_OPN`), OBSERVED | none (decision 6); its SSG is the YM2149's programmer's model (ay8910-python) | | YM3812 (OPL2: 9 two-operator channels, waveform select) | 3 MHz | JTSLY ("3MHz", `~CS_OPL`), OBSERVED | none (decision 7); ym2413-python (OPLL) is the nearest relative, a different register set | | YM3014B DACs (one per Yamaha chip) | | JTSLY ("Y3014B" twice) | in the FM cores' output stage | | MSM6295 (4-voice ADPCM) | 1.0 MHz (1.056 on some sets) | OBSERVED; JTSLY ("M6295" pins 3, 5, 8, 37) | msm6295-python (Phase 0 complete, no core yet) | | HuC6280 PSG | the HuC6280's | MAME instantiates it on every HuC6280 set | whether Data East wired the PSG's output to the amplifier is U17 (JTSLY's sound sheet: to read) | Karnov and Chelnov use a YM3526 (OPL) in place of the YM3812 (MAME), and an NMOS 6502. Sample rates at these clocks, with the divisors commonly used for these chips (an FM sample every 72 input clocks for the OPN at its default prescaler and for the OPL; the pinned YM2203 and Y8950 documents name the prescaler but do not state the divisor: HYPOTHESIS, for the arithmetic in [domains-and-speed.md](domains-and-speed.md) only): the YM2203 at 1.5 MHz about 20.8 kHz, the YM3812 at 3 MHz about 41.7 kHz. The MSM6295 at 1 MHz makes 7.6 kHz or 6.1 kHz (clock / 132 or / 165 by its pin 7: msm6295-python's start-here); which level each board uses is U18. ## deco16 | Part | Clock (MAME) | Sets | Family core | | --- | --- | --- | --- | | HuC6280 | 2.685, 4.0275, 6, 8.055 MHz (the HuC6280's input clock, per set) | 77 of 94 | huc6280-python | | Z80 | 3.58 or 4 MHz | 10 (Double Wings, Super Shanghai, the Caveman Ninja and Robocop 2 bootlegs) | z80-python | | 6809E | 1.3425 MHz | Lemmings | m6809-python (Phase 0; no core) | | YM2151 | 3.58 MHz | 88 | ym2151-python (Phase 0 restarted; no core) | | YM2203 | 4.0275 MHz | 32 | none | | MSM6295 x 2 | 1.007 and 2.014 MHz (the second at twice the first: music and effects banks) | most | msm6295-python | ## The sound latch and the interrupt dec0: a "Generic 8-bit latch" (`soundlatch`) and an "Input Merger (any high)" (`audio_irq`) in MAME's device list: the 68000 writes the latch, which interrupts the sound CPU; the merger ORs the YM chips' timer interrupts with it (HYPOTHESIS from the device names). deco16: the DECO 104/146 carry the latch (MAME's log: "LOAD SOUND LATCH"). JTSLY's sound sheet names `~IRQ1`, `~IRQ2`, `~NMI` on the HuC6280: which source drives which line is U9. ## What this asks of the family 1. **An OPN core** (YM2203; YM2608 and YM2610 are its relatives). The PC-88 Phase 0 (`../pc88-python`, started 2026-11-26, read at its `cfdbaea`) needs the YM2203 and YM2608 too and pins the same YM2203 data sheet (SHA-256 `4be9ffd5...`, the same file as here) plus the OPN YM2203 Application Manual's OCR from the Internet Archive; ym2610-python's Phase 0 covers OPNB from Yamaha's manuals. Decision 6 recommends one `ym2203-python` core (OPN, with the YM2608 as a later variant), its SSG built on ay8910-python. 2. **An OPL core** (YM3812, YM3526 as a variant, the Y8950 later). Decision 7. 3. The HuC6280's on-die PSG, timer and IRQ controller as something a second board can pin (decision 4). 4. msm6295-python and ym2151-python built (both have their Phase 0). Sound is less exact than pictures by Aubrey's rule ("sound: good enough"): the board's first milestones run with the sound CPU and its latch exact and the chips as stubs that answer their status reads, so the CPU programs run as on hardware.