# Bus, registers, status and /IRQ The YM2610 (OPNB) as the CPU sees it. Every claim carries an evidence tag and a citation; the sources and their terms are in [validation.md](validation.md) and [provenance.md](provenance.md). Citations used in all the specification documents: | Short | Source | | --- | --- | | AM | Yamaha, *YM2610 Application Manual* v1.12, 1995-01-20, ajworld transcription (`reference/docs/ajworld-ym2610am_en.html`), by section | | OPNA | Yamaha, *YM2608 OPNA Application Manual*, machine translation (`YM2608J_Translated.pdf`), by printed page | | YM3016 | Yamaha YM3016 data sheet, printed pp. 32-33 of Yamaha's *1990 LSI Condensed Catalog* (`1990_Yamaha_LSI_Condensed_Catalog.pdf`, bitsavers); until 2026-11-26 the same pages were read from a `YM3016.pdf` hosted on the Neo Geo Development Wiki, now set aside ([provenance.md](provenance.md), "Author respect") | | ymfm | ymfm 81aec25 (Aaron Giles, BSD-3), `src/:` | | Geolith | Geolith 05ddef5 `src/ymfm/ymfm_opn.c` (BSD-3), by line | | HYPOTHESIS: was NGD *page* | a statement taken from that Neo Geo Development Wiki page, **set aside 2026-11-26** (author respect, not licence: [provenance.md](provenance.md)); kept only where no other source says it, as a hypothesis needing new evidence. Where another source says the same, the wiki citation was dropped | | lle:*name* | `lle2610_probe.c` (`$EMU_TOOLS_GPL2/tools/ym2608-lle/`) subcommand *name*, run against YM2608-LLE 7a2aca7's YM2610 build as a closed box; results in `validation/results/lle2610_probe-2026-11-19.txt` | A value read from permissive code (ymfm, Geolith) is tagged DOC and names the file and line; it is a documented implementation, not a hardware fact, and ymfm's own notes say where it rests on other evidence. ## The bus - Five control inputs, /CS /RD /WR A1 A0, an 8-bit data bus; /CS high floats D0-D7. [DOC AM §5, "Data Bus Control"] - Four ports by A1 A0: 0 address (part I), 1 data (part I), 2 address (part II), 3 data (part II). Reads: A1 A0 = 0 status 0, 1 SSG register data, 2 status 1. [DOC AM §5 table] The table lists no read at A1 A0 = 3. [DOC AM §5] - An address write selects a register and stays selected: several data writes may follow one address write. [DOC AM §9(a); OPNA p. 13] - Part I covers $00-$0F SSG, $10-$1F ADPCM-B, $20-$2F FM common, $30-$B6 FM channels 1-2; part II covers $00-$2F ADPCM-A and $30-$B6 FM channels 3-4. [DOC AM "Register Address Allocation"] - A data write is taken even when /WR is held low for a single input clock (an SSG register read back the value). [OBSERVED lle:busy] The manual's minimum /WR width is 380 ns, about 3 clocks at 8 MHz. [DOC AM §6.4, TWW] ## Wait times and BUSY - The manual: wait 17 master clocks after an address write and 83 after a data write. [DOC AM §9(a)] The OPNA manual gives the same for FM ($21-$9E; 47 for $A0-$B6) and **0 for the SSG and ADPCM parts**. [DOC OPNA p. 14] - Status bit 7 (BUSY) is 1 "while loading data into the register". [DOC AM §"Status Read"; OPNA p. 52] - The closed box: a data write to any part (FM part I or II, FM common, SSG, ADPCM-A, ADPCM-B) raises BUSY 13 clocks after /WR falls (or at /WR's rise if later) and drops it 200-205 clocks after /WR falls, depending on the write's phase in the 144-clock sample; an address write raises no BUSY. A write made while BUSY is set still lands (SSG register 2 written 0 clocks after the previous data write read back correctly). [OBSERVED lle:busy] - ymfm: every data write sets BUSY for 32 x 6 = 192 clocks. [DOC ymfm ymfm_opn.cpp:2035, 2074] - This is contradiction **C3**. The core keeps BUSY for the closed box's length (provisional) and never drops a write; whether a real chip loses writes made too soon is **U1** (that it does is [HYPOTHESIS: was NGD *Z80/YM2610 interface*], which cited no test; the closed box keeps them). ## Status, flags and /IRQ - Status 0: bit 7 BUSY, bit 1 timer B flag, bit 0 timer A flag; other bits 0. [DOC AM §"Status Read"] Status 1: bit 7 ADPCM-B end flag, bits 5-0 ADPCM-A channel 6-1 end flags. [DOC AM §"Status Read"] Both read 00 after power-on. [OBSERVED lle:flagctl] - "When D0, D1 are 1, /IRQ is 0." [DOC AM §"Status Read"] /IRQ is open drain. [DOC AM §5] The closed box pulled /IRQ with timer A's flag set and released it with the enable bit clear (no flag then rises). [OBSERVED lle:timers] Whether the ADPCM end flags pull /IRQ is not stated by the YM2610 manual and was not measured: **U11**. - The timers' $27 register (load, enable, reset, mode) is in [clocking-and-output.md](clocking-and-output.md); the CH2 mode bits in [fm.md](fm.md). ## Flag control ($1C): contradiction C2, decision 2 - The manual puts Flag Control at **$1C in part I** (A1 = 0, inside the ADPCM-B block $10-$1F): bit 7 masks flag B, bits 5-0 mask flags A6-A1; "when MSK = 1 the corresponding flag in status 1 is 0"; both synthesis procedures write $1C first ($3F then $00 for ADPCM-A, $80 then $00 for ADPCM-B). [DOC AM "Register Address Allocation", "Flag Control ($1C)", both "Synthesis Process" tables] ymfm and Geolith decode it in part I. [DOC ymfm ymfm_opn.cpp:2022-2027; Geolith 936-941] SNK's sound driver writes it to part I (139 writes in the `nam1975` tap, all part I; [mame-oracle.md](mame-oracle.md)). - The closed box ignores $1C written to part I and takes it in **part II** ($11C): there a 1 bit resets the flag and keeps it low; a 0 bit afterwards does not bring a reset flag back; a channel that ends while its bit is 1 raises no flag even when unmasked later. The same holds for bit 7 and the ADPCM-B flag. [OBSERVED lle:flagctl] - **Decision 2:** the core follows the manual, ymfm and SNK's driver (part I) and records this as a place where it departs from its judge; the comparison harness translates a part I $1C access into the closed box's part II access. [docs/decisions.md, decision 2] - The ADPCM-B flag's own reset: ymfm also clears it when $10 is written with START = 0. [DOC ymfm ymfm_adpcm.cpp:639-640] Not measured: **U11**. ## Register reads - Only the SSG registers read back ($00-$0D at A1 A0 = 1). [DOC AM §5] ymfm returns $FF for $0E-$0F (no I/O ports on this chip) and 1 for $FF (an ID code). [DOC ymfm ymfm_opn.cpp:1910-1929] The YM2610 has no I/O ports. [DOC AM §5 pin list] Reads of $0E-$FF were not measured: **U11**. ## Initial values - /IC clears the ADPCM registers: ADPCM-A all $00, ADPCM-B $10, $11 and $1C $00, the rest undefined. [DOC AM §9(b)] The closed box agrees for ADPCM-A's $08-$0D: a channel keyed on without writing $08 is silent (L and R off). [OBSERVED lle:adpcma, pan not written] ymfm sets $08-$0D to $DF at reset ("some neogeo homebrews (for example ffeast) rely on this"). [DOC ymfm ymfm_adpcm.cpp:44-52] Contradiction **C5**; the core follows the manual and the closed box. - The manual's minimum /IC pulse is 192 clocks. [DOC AM §6.4, TICW]