# Sound: beeper, OPN (YM2203), OPNA (YM2608) ## By model | Models | Sound | Ports (YK-IO) | Source | | --- | --- | --- | --- | | PC-8801, mkII | beeper only (40h bit 5 BEEP, bit 7 FBEEP: the port bit to the speaker) | 40h | YK-IO | | mkII SR, TR, FR, MR | **YM2203 (OPN)**: 3 FM channels, SSG (3 square, noise), two timers, two I/O ports | 44h address, 45h data | YK-IO; MAME `opn` YM2203 @ 3.99 MHz (OBSERVED) | | FH, MH | **OPN** by NEC's FH Programmer's Guide (FHPG: "シンセサイザIC (略称 OPN……FM Operator Type-N)", its chapter written from Yamaha's "YM2203 アプリケーションマニュアル") | 44h, 45h | C1 | | MA, MA2, FA, MC | **YM2608 (OPNA)**: 6 FM, SSG, rhythm (six built-in ADPCM drum sounds from the chip's ROM), ADPCM-B with external RAM | 44h-47h | MAPG ch. 14 ("スーパーシンセサイザ IC (YM2608)"); MAME `opna` YM2608 @ 7.98 MHz (OBSERVED) | | any, with the Sound Board II option | a second OPNA | A8h-ADh, AAh its interrupt mask | YK-IO | **C1: FH/MH's chip.** NEC's own FH guide (tier 2) says OPN and documents it from the YM2203 manual; youkan's I/O map says "FH/MH and later: OPNA" for 44h-47h; MAME's `pc8801mh` fits the `ym2608` device (its ROM list includes `ym2608_adpcm_rom.bin`, OBSERVED). Follow NEC: **FH and MH are OPN machines**, the MA the first with OPNA. Note that MAME has no `pc8801fh` driver. ## Interrupts and clocks - The OPN's/OPNA's timer IRQ reaches the main CPU as **interrupt level 4** ("サウンド割り込み") through the 8214 (YK-IO E4h), masked by 32h bit 7 (SINTM) on the SR and later (YK-IO 32h). - The SSG's I/O ports A and B read the joystick (SR and later); pin 8 is driven from 40h bit 6 (YK-IO). - Clocks: OPN 3.9936 MHz (MAME's 3.99 MHz, the main crystal / 8: HYPOTHESIS on the divider), OPNA 7.9872 MHz (MAME's 7.98 MHz). With OPN's default prescaler of 6 (OPNAM), the FM sample rate is 3.9936 MHz / 72 = 55.5 kHz; the OPNA divides 7.9872 MHz by 144 for the same 55.5 kHz (OPNA; ym2610-python's clocking-and-output.md discusses the family's dividers). ## Which core (decision 2) The family has: `../ym2612-python` (OPN2, built: FM only, no SSG, DAC channel), `../ym2610-python` (OPNB, Phase 0 restarted: FM 4 channels, SSG, ADPCM-A/B), `../ay8910-python` (built: its `YM2149` row is the SSG's programmer's model; the YM2203 sheet says the SSG "is compatible with software of YM2149 and AY-3-8910"), and closed-box die models in the GPL tool repositories: **YM2203-LLE** (`emu-tools-gpl/tools/ym2203-lle`, GPL-2.0+) and **YM2608-LLE** (`emu-tools-gpl2/tools/ym2608-lle`, GPL-2.0-only by the 2026-11-24 rule). ym2610-python's decisions (its decisions.md, items 1-2) already say: "extract a shared OPN core only when a YM2203 or YM2608 is wanted". **The PC-88 is that day.** Options: 1. **A new `ym2608-python` (OPNA) core with the YM2203 as a variant row** (the OPN is the OPNA's part 1 without the second FM bank, rhythm and ADPCM; register map and FM block largely shared, prescaler and channel count differ), its SSG delegated to `ay8910-python`'s YM2149 row behind the OPN's clock divider, YM2608-LLE and YM2203-LLE as closed-box judges (tier 1-equivalent die models) run from the GPL tool repositories, ymfm (BSD-3) as a comparator. ym2610-python then pins the FM block from it when it is built (OPNB = OPNA's FM with four channels plus ADPCM-A). **Recommended.** 2. Extend ym2612-python with OPN/OPNA rows. Not recommended: OPN2 lacks the SSG, the rhythm and ADPCM paths, has the DAC channel and a 9-bit output stage, and its die-specific behaviour (the "ladder effect") is not the OPN/OPNA's; the shared part is the FM operator. 3. Keep the OPN/OPNA inside pc88-python. Not recommended: the PC-98's sound boards (26K: OPN, 86: OPNA; that Phase 0 runs today) want the same chips, and ym2610-python wants the shared FM block, so the chip rule's second consumer is already in sight. What the board needs from the core: register writes and reads by address/data pair (status with BUSY and timer flags), timer IRQ out, the SSG's I/O ports as callbacks, a clock input, the rhythm ROM supplied by the player (`ym2608_adpcm_rom.bin`, 8 KB, SHA-1 50b6c3e288eaa12ad275d4f323267bb72b0445df, census.md: Yamaha's ROM, never shipped).