# Sound: the beeper, the PC-9801-26(K) (YM2203) and the PC-9801-86 (YM2608) Sources: UND `io_sound`, `io_tcu`, `io_syste`; Yamaha YM2203 data sheet (November 1989, pinned; **YM2203DS**); Yamaha YM2608 Application Manual, machine translation (pinned, the same file ym2610-python pins; **OPNA**); NEC *PC-9801-86 User's Manual* (pinned text PDF; **86UM**); TDB86 (the YM-2203 interrupt section, OCR lines ~29059-29141); MAME (tier 5). ## The beeper (every model) - On the original, E, F and M: a **fixed tone**, switched on and off by the system 8255's port C bit 3 (I/O 35h/37h; UND `io_tcu` 0073h relates bit 3 of 35h to the beeper). MAME fits a 2,400 Hz `beep` device on the 8086 sets (tier 5); the real pitch is U14. - From the U and VM2 on: **8253 counter 1** sets the pitch (default 2 kHz, mode 3), through I/O 3FDBh by NEC's recommendation (UND `io_tcu` 0073h). On uPD71054 models the counter's clock stops while the beeper is off (same entry). - Board model: a 1-bit level (gate AND counter output on later models) into the sound producer, as ibmpc-python's speaker. ## PC-9801-26 / -26K: YM2203 (OPN) - **Ports 188h (register select / status) and 18Ah (data)** (UND `io_sound` 0188h, 018Ah). Status: bit 7 BUSY, bits 1-0 the timer flags (UND; YM2203DS). - **Clock 3.9936 MHz** (7.9872 / 2): MAME's `pc9801_26:opn` (tier 5); the data sheet's range is 0.7-4.2 MHz (YM2203DS, electrical table). A DOC source for the board's crystal is U5. - The chip: three FM channels (four operators each), the three-channel SSG (the AY-3-8910's programmer's model: registers 00h-0Dh as UND lists them), two timers, two 8-bit I/O ports. - **The I/O ports are wired on the board:** port A (0Eh) reads the board's **interrupt jumper** in bits 7-6 (IRST: 00b INT0, 01b INT4, 10b INT5, 11b INT6) and a joystick (up, down, left, right, two triggers); port B (0Fh) drives the joystick's outputs (UND `io_sound` 018Ah). So software learns the board's IRQ through the sound chip itself. - **Interrupt:** the OPN's /IRQ, inverted, to INT0, INT4, INT5 or INT6 by jumper (UND; TDB86's YM-2203 section names IR13 (INT6) and IR12 (INT5)). The default differs between sources: TDB86 says INT6 is "normally" used; 86UM says the built-in FM LSI uses INT5 and INT6 is normally the mouse (86UM lines 318, 357). C3; U15. - Board ROM: the -26K carries a ROM (MAME region `bios`: `26k_wyka01_00.bin` and `26k_wyka02_00.bin`, 8 KB each, good dumps; `sound.rom` 16 KB; census.md). What it holds (a BIOS extension for the sound BIOS) is U16. - Machines with the OPN built in: the PC-9801UV21 and others (TDB86: "PC-9801U/UV" lines in the YM-2203 section; the UV21 hardware manual is pinned). ## PC-9801-86: YM2608 (OPNA) and a PCM FIFO - **Ports 188h, 18Ah, 18Ch, 18Eh** (OPNA's two register banks; movable to 288h-28Eh, the choice readable at A460h bit 1) (UND `io_sound` 0188h-018Eh, A460h). - **PCM:** a FIFO with its own ports A466h (status, volume), A468h (control), A46Ah (DAC control, interrupt timing), A46Ch (data), and A66Eh (mute) (UND `io_sound`); sampling 4.13 to 44.1 kHz in eight steps; one FIFO shared by recording and playback (86UM lines 158, 489, 516-522). - **Clock 7.9872 MHz** (MAME `pc9801_86:opna` 7,987,000: tier 5, rounded). - **Interrupt:** INT0, INT4, INT5 or INT6 by switch, factory INT5 (86UM lines 296-304, 830-836). - **Not a first-row board:** 86UM says the board supports host machines with **an i80286 at 10 MHz or faster** (86UM lines 137, 394). The original and the VM are outside its stated support. It is recorded here for the later rows and for the pc88-python coordination; the board's first sound milestone is the beeper and the -26K. - MAME's -86 ROMs are both marked bad dumps (`sound_rx.rom`, `sound_486mu.rom`: census.md). ## Coordination with pc88-python (Phase 0 running tonight) The PC-8801 mkII SR and later carry the YM2203 on the motherboard, the FA/MA and later the YM2608 (MAME's `pc8801mk2sr` device list shows both `ym2203` and `ym2608`, tier 5). So the **OPN and OPNA have two family users: pc88-python and pc98-python** (and the FM-7/77AV, X1 turbo Z and MZ-2500 carry an OPN: MAME device lists for `fm77av` and `mz2500`, tier 5; not family boards yet). The family's state (2026-11-26): - **ym2610-python** (OPNB, restarted clean-room): its decision 1 reads "a shared OPN core only when a YM2203 or YM2608 is wanted". The PC-88 and PC-98 are that want. - **ay8910-python** (built): the SSG of the YM2203/2608 is "Yamaha's PSG", the AY-3-8910 programmer's model (ay8910-python `docs/phase0.md`), and that repository lists "the SSG inside an FM chip" as **not** its scope ("other chips"). - **ym2612-python** (OPN2, restarted clean-room): the OPN2 is the OPN's FM block without the SSG, at a different output path. - Referees: YM2203-LLE and YM2608-LLE (nukeykt; GPL-2.0+ and GPL-2.0-only) are closed boxes in emu-tools-gpl / emu-tools-gpl2 (sources.md rows); ymfm (BSD-3-Clause) is code-OK with notice. **Proposal (open decision 8):** one **`opn-python`** core (YM2203 and YM2608 as variants; the YM2610 could join later by ym2610-python's own decision), built clean-room from Yamaha's documents with YM2203-LLE/YM2608-LLE as closed-box judges, its SSG either embedded or pinned from ay8910-python as a sub-block (to be settled with ay8910-python's owner). **Whichever of pc88-python and pc98-python reaches its FM milestone first starts it**; the PC-88 is likely first (its OPN is on the motherboard from the mkII SR; the PC-98's is an option card). The PC-98 asks of it: the /IRQ output, the two I/O ports as callbacks (the -26K wires the jumper and joystick there), and for the OPNA the ADPCM RAM and the second register bank.