# Behaviour specification, first draft Written 2026-11-12 from the sources in [phase0.md](phase0.md), in this repository's own words. Source IDs (S1, S8, ...) are that document's; "p7967" is a post number in thread 386 (S8), reachable as `https://gendev.spritesmind.net/forum/viewtopic.php?p=7967#p7967`. No statement here comes from a GPL or LGPL program or from the withdrawn core. Each statement carries one of three marks: - **documented**: a manufacturer's or community document says so. The tier tells how far to trust it. - **measured**: someone measured it on a real chip and published the result; the post or file is named. "measured (read-out)" means a digital value read through the chip's test register, the strongest kind. "die" means a reading of the die photograph: what is wired, by one reader. - **unsettled**: sources disagree, or only an emulator says so, or nothing does. - **provisional (emulator tier)**: added by the provenance audit of 2026-11-13. No manufacturer's document and no hardware measurement stated in prose gives the value; it is taken from a permissively licensed emulator, which is named. It is a default, not a fact about the chip. **Audited 2026-11-13.** [provenance-audit.md](provenance-audit.md) went through this document statement by statement against the prose of each cited source, stopping at every code block (restart.md rules 9 and 10). It gives each statement's chain (source, author, how established, what is upstream), and lists what was struck or re-marked here: the operator tables' source (6), the envelope step table (7.3), the attack formula (7.4.2), parts of SSG-EG (7.6), the LFO's counter and the vibrato table (8), one row of the channel 3 mode table (10.1), and two published values in validation.md. Where this document and the audit differ, the audit is right. Nothing here was measured by this project. Contradictions are numbered C1 onward and unknowns U1 onward; they are gathered in sections 19 and 20. Section 21 says how much of the chip can be had from allowed sources. Names: the four operators of a channel are numbered 1 to 4 as Yamaha numbers its "slots" (S1, S4), so that algorithm 0 is the chain 1→2→3→4. Bits are numbered with bit 0 least significant. "Master clock" or φM is the chip's own clock pin, not the console's crystal. An "internal clock" is six master clocks. A "sample" is 24 internal clocks, 144 master clocks. ## 1. The two parts and their variants | Name | Part | Where | |---|---|---| | YM2612 (OPN2) | The discrete NMOS chip, 24-pin | Mega Drive model 1 boards VA0 to VA6.x; model 2 boards VA2 and VA2.3 (S12 footnote 4, S18) | | YM3438 (OPN2C) | The CMOS re-implementation, as a discrete chip | arcade boards; hobbyist replacements | | The ASIC's FM block | A YM3438-like core inside Sega's combined chips (315-5487, 315-5660, 315-5700, 315-5708 and later) | model 1 VA7; model 2 VA0 to VA1.8, VA3, VA4; Genesis 3; Nomad (S8 TmEE p6615 to p6643, S18) | 1. The YM3438 is software compatible with the YM2612. **documented** (S2's outline; S8 p30063: Sauraen found no difference on discrete YM3438s "even on undocumented features like the test bits and SSG-EG mode", **measured** by test read-back). 2. Known differences are in the output stage (section 15), in the status port (section 12, C4) and possibly nowhere else. Whether the ASIC's core equals a discrete YM3438 in every digital respect is **unsettled** (U20): TmEE's tests "all matched" (p13067), others report quirks without specifics (p27188, p27198). 3. Everything below applies to both parts unless it says otherwise. Most measurements were made on one discrete YM2612. ## 2. Bus and register addressing 1. The chip has two address inputs. A0 = 0 writes an address, A0 = 1 writes data; A1 chooses the register part. **documented** (S1 table 1.2, S2 table 1.2). 2. In the Mega Drive these are the four bytes $4000 to $4003 for the Z80 and $A04000 to $A04003 for the 68000: part I address, part I data, part II address, part II data. **documented** (S5). 3. Part I holds the global registers $21 to $2C and the registers of channels 1 to 3; part II holds the registers of channels 4 to 6. **documented** (S1, S2 figure 1.1). There are no global registers in part II: **measured** (S8 p5648, Shiru, special mode cannot be set there) and **die** (p26964: every $2x register is decoded with A1 = 0). 4. An address stays latched until the next address write, so several data bytes may follow one address. **documented** (S1 printed page 7, S2 page 7). **die** agrees (p27124). 5. There is one address latch, not one per part. It stores the address byte and the part it was written through, nine bits. A data byte written to either data port goes to the latched register in the latched part. **measured** (S8 p7673, Nemesis, the same on MD1 and MD2 per p7733). S21 instead drops a data byte sent to the other part's data port, and one sentence from the Nuked model's author says the global registers need A1 = 0 on both writes (p34277, "I'm not 100% sure"). For the global registers this is **unsettled** (C13). 6. The latch for channel and operator addresses ignores addresses $00 to $0F and takes every other address, including $2x. **die** (p26964 "my guess", p27138). 7. Yamaha requires a wait after each write, in master clocks: 17 after an address write; 83 after data to $21 to $9E; 47 after data to $A0 to $B6; 17 before a read that follows a write. **documented** (S1 printed page 8 tables 1.3 and 1.4; S2 page 8 tables 1.3 to 1.5 and the AC table on page 37). The 83 and 47 are real minimums: **measured** (p37832, Stef 2023, on a discrete YM2612 and on the ASIC, "identical"). An address-to-data gap of 12 master clocks worked and 10 did not (same post). Register $28 needed about 112 to 116 master clocks between two writes to the same channel, or key writes were missed or reached only some operators (same post; p37833). 8. Why the wait exists: the channel and operator registers are circulating shift registers, and a written value is taken in when the addressed entry comes past a write point. **die** (p27124, p26964). The 24-stage operator registers are two groups of 12 with logic between, which fits two write points 12 internal clocks apart and Yamaha's 83-clock figure; the channel registers are about 6 stages. **die**, not transcribed gate by gate (p34255). The $2x registers take a value at once (p27138, unchecked by its author). Which internal clock serves which register is **unsettled** (U1). 9. A second write that arrives before the first has been taken in replaces it, and a new address written before the old data has been taken in can send the old data to the new address. **die** (p27124). Not measured. A core that takes every write at the sample boundary, as S21 and S22 do, does not show this: see section 21. ## 3. Register map Every register is write-only. **documented** (S1, S2). The bit maps below are **documented** by S1, S2 and S4 together unless marked; the $2x column was also read off the die (p26964), which found no other register and no undocumented channel or operator register (p26987). ### 3.1 Global registers (part I only) | Address | Bits | Meaning | |---|---|---| | $21 | 7-0 | Test (section 17) | | $22 | 3; 2-0 | LFO enable; LFO rate | | $24 | 7-0 | Timer A, upper 8 of 10 bits | | $25 | 1-0 | Timer A, lower 2 bits | | $26 | 7-0 | Timer B | | $27 | 7-6; 5, 4; 3, 2; 1, 0 | Channel 3 mode; reset flag B, A; enable flag B, A; load B, A | | $28 | 7-4; 2-0 | Key on for operators 4, 3, 2, 1; channel | | $2A | 7-0 | DAC data | | $2B | 7 | DAC enable | | $2C | 7-3 | Test (section 17) | 1. Channel values in $28: 0, 1, 2 are channels 1 to 3; 4, 5, 6 are channels 4 to 6. **documented** (S1, S2, S5). Values 3 and 7 are **unsettled** (U2): S21 ignores them; one game is said to write them (p9213). 2. The YM2608's registers $29 (channel count, interrupt enables) and $2D to $2F (prescaler) do not exist. **measured** (p5680, "had no noticeable effect"), **die** (p26964), **documented** (S2 page 12: the divider is fixed at 1/6). ### 3.2 Operator registers (each part: three channels by four operators) The address's bits 1-0 choose the channel (0, 1, 2; 3 is unused) and bits 3-2 choose the operator in the order 1, 3, 2, 4. **documented** (S1, S2 table 2.1, S4 table 2-2). | Address | Bits | Meaning | |---|---|---| | $30+ | 6-4; 3-0 | Detune; multiple | | $40+ | 6-0 | Total level | | $50+ | 7-6; 4-0 | Key scale; attack rate | | $60+ | 7; 4-0 | Tremolo enable; decay rate | | $70+ | 4-0 | Sustain rate | | $80+ | 7-4; 3-0 | Sustain level; release rate | | $90+ | 3; 2; 1; 0 | SSG-EG enable; attack; alternate; hold | 3. The upper four bits of $90+ do nothing, and with bit 3 clear the low three do nothing. **measured** (p8037, p14196: all 256 values tried). ### 3.3 Channel registers (each part: three channels) | Address | Bits | Meaning | |---|---|---| | $A0 to $A2 | 7-0 | F-number, low 8 bits | | $A4 to $A6 | 5-3; 2-0 | Block; F-number, high 3 bits | | $A8 to $AA, $AC to $AE | as above | Channel 3's per-operator frequencies (part I only has effect) | | $B0 to $B2 | 5-3; 2-0 | Feedback; algorithm | | $B4 to $B6 | 7; 6; 5-4; 2-0 | Left; right; tremolo depth; vibrato depth | 4. Channel 3's extra frequency registers belong to: $A9/$AD operator 1, $AA/$AE operator 2, $A8/$AC operator 3; operator 4 uses $A2/$A6. **documented** (S4 table 2-2) and **measured** (p5605, Shiru, by keying operators one at a time). Sega's manual (S5) gives a different and self-contradictory list; it is wrong (C6). 5. **The F-number latch.** A write to $A4+ (or $AC+) is held and takes effect only when the matching $A0+ (or $A8+) is written. **documented** (S1, S2: "set in this order"; S5) and **measured** (p5621, test ROM `ym2612FrequencyWriteOrder`: it plays A6 on hardware and would play A4 if high bytes applied at once). Whether there is one holding latch per channel or one shared (so that a high byte written for one channel is taken by the next low byte written for another) is **unsettled** (C12): Nemesis's sentence reads per channel, S22 has one per channel, S21 has one shared latch for $A4 to $A6 and one for $AC to $AE, and the Nuked model's author says the die has a separate latch for channel 3's special values (p34277). ## 4. Clock, sample rate and the order of work 1. The chip divides its master clock by 6, and the divider is fixed. **documented** (S2 page 12), **die** (p27060, p30920), **measured** (p5716: output frequency verified). 2. One internal clock serves one operator of one channel; all 24 are served in 24 internal clocks, 144 master clocks. So each operator, and each channel's output, is updated at φM / 144. **documented** (S4 2-1-3: "the operator cell is operated 24 times by the timesharing processing"; the factor 144 in the F-number formula; S1: "sampling rate ... 55.5 kHz" at 8 MHz), **die** (p29513), **measured** (p7520: 24 master clocks per channel slot on an oscilloscope). 3. In the Mega Drive φM is the 68000's clock, the console's crystal divided by 7: 7,670,453 Hz on NTSC machines and 7,600,489 Hz on PAL, giving 53,267 Hz and 52,781 Hz. **documented** (S17, S18; S8 p27133). The manuals' figures assume 8 MHz. 4. Within a sample the operators are worked in the order: operator 1 of channels 1 to 6, then operator 3 of channels 1 to 6, then operator 2, then operator 4. **measured (read-out)** on discrete YM3438s (p30063, p30065), agreeing with the **die** (p27060). 5. The envelope generator advances once every three samples. **measured (read-out)** (p7967, withdrawing an earlier divide-by-351 claim; p6224). Key on and off, the SSG-EG steps, the output inversion and the phase are worked every sample (p7967). 6. A sample-level model (one step per 144 master clocks) can state everything in sections 5 to 14 except 2.8, 2.9 and the delays of 9.6, which need the position inside the sample. See section 21. ## 5. Phase generator All of 5.1 to 5.9 is **measured** by Nemesis (p6177, p8908) except where marked; he calls it "everything you need to get a 100% accurate implementation of the phase generator, with the exception of phase modulation by the LFO". 1. Each operator has a 20-bit phase counter. Its upper 10 bits go to the operator unit. (The **die** shows "10.10 bit wide registers", p15665.) 2. Each sample a phase increment is computed and added to the counter, in this order: take the 11-bit F-number; apply vibrato (section 8); shift by the block; apply detune; apply the multiple; add to the counter, keeping 20 bits. 3. Block shift: block 0 shifts the F-number right by one (its lowest bit is lost); block 1 leaves it; blocks 2 to 7 shift left by 1 to 6. The result is 17 bits. Examples: F-number $7FF, block 7 gives $1FFC0; block 0 gives $3FF. 4. So the frequency is `F × 2^(block−1) × φM / (144 × 2^20)`. **documented** (S1, S2, S4: `F-Number = (144 × f × 2^20 / φM) / 2^(B−1)`, with the worked example 440 Hz at 8 MHz in block 4 = 1038.1). 5. Key code: five bits, the block in the upper three, then N4 and N3 from the F-number's top four bits (F11 the highest): N4 = F11; N3 = F11·(F10+F9+F8) + !F11·F10·F9·F8. **documented** (S1, S2 page 24, S4 2-4-1 B). It is computed from the F-number before vibrato: **die** (p31049). Sega's shorter rule (S5: the top five bits) is wrong (C6). 6. Detune: bit 2 of the 3-bit field is a sign, bits 1-0 a magnitude 0 to 3; magnitude 0 means no detune in either sign. The amount comes from a table indexed by key code and magnitude. **documented** (S1, S2 table 2.4, S4 table 2-6, in hertz at φM = 7.9872 MHz per S2, each entry a multiple of 0.053 Hz, which is one unit of the 17-bit increment). Converted to units, key codes 0 to 31: | Magnitude | Values for key codes 0 to 31 | |---|---| | 1 | 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4 4 4 5 5 6 6 7 8 8 8 8 | | 2 | 1 1 1 1 2 2 2 2 2 3 3 3 4 4 4 5 5 6 6 7 8 8 9 10 11 12 13 14 16 16 16 16 | | 3 | 2 2 2 2 2 3 3 3 4 4 4 5 5 6 6 7 8 8 9 10 11 12 13 14 16 17 19 20 22 22 22 22 | The conversion is Nemesis's (p6177); this session checked every row against S2's printed table (page 25, viewed as an image). S21 carries the same values. 7. The detune amount is added to, or subtracted from, the 17-bit increment, and the result is kept to 17 bits. A negative detune on a small increment therefore wraps to a very large one: F-number 0 with detune −1 gives $1FFFF. This is audible: test ROM `ym2612detune` "generates a continuous tone on the real system" with every F-number 0 (p5618), and a common instrument of one sound driver depends on it. 8. Multiple: 1 to 15 multiply the increment; 0 halves it. **documented** (S1, S2 table 2.3). The result is kept to 20 bits; a carry out of bit 19 is lost (p6177). 9. A frequency change is used from the next sample (p5655). Key-on sets the phase counter to 0 (p7967 item 4), including key-on by CSM. 10. In SSG-EG patterns with alternate and hold both clear, the phase counter is held at 0 for as long as the envelope's internal level is at or above $200 (section 7.6). ## 6. Operator unit 6.1, 6.4 and 6.6 are **measured (read-out)** by Nemesis, in prose (p6114, p5958, p11386: "you will be able to create a 100% binary exact implementation of the YM2612 operator unit"). His two table-building algorithms are in code boxes and his diagram is not in hand, so the audit takes the tables' formulas (6.3, 6.5) and the quadrant rule (6.2) from S19, which states them as formulas for ROMs read bit by bit from the dies of the YM3812 and YMF262, and takes from Nemesis only the prose statement that his YM2612 tables match those (p6741; see 6.7). 1. Inputs: the 10-bit phase, a 10-bit modulation input, the 10-bit envelope attenuation. Output: a signed 14-bit value. (14-bit signed also **measured** on a YM3438, p30088; the observed range of one operator is −8168 to +8168, p11876.) 2. The phase and the modulation are added, 10 bits kept. Bits 9 and 8 choose the quadrant: bit 8 mirrors the index (index = the low 8 bits, inverted when bit 8 is set), bit 9 negates the result. **measured (ROM read-out, OPL family)**: S19, "The rest can be constructed by flipping all the bits of x and/or by changing the sign of the samples." 3. Log-sine table, 256 entries, each a 12-bit attenuation in 4.8 fixed point, base 2: `round(−log2(sin((i + 0.5) × π / 512)) × 256)` for i = 0 to 255. S19's formula for the YM3812's ROM; Nemesis: "the sin table is a perfect match for the data my algorithm generates" (p6741), his own being read from the YM2612. 4. The envelope attenuation is a base-2 logarithm in 4.6 fixed point. It is shifted left two places and added to the table's value. (The **die** shows the adder and a 12-bit result, p27032, p27060.) 5. Exponent table, 256 entries of 11 bits: `round(2^(−(i + 1)/256) × 2048)` for i = 0 to 255. This is S19's ROM (`round((2^(x/256) − 1) × 1024)`, x = 0 to 255) with its hidden bit 10 added and read in reverse order, which is what Nemesis says of his own table in prose: its entries "effectively run from 0x7FA-0x400", the ROM leaves bit 10 out, and the ROM is listed the other way round (p6741). The sum's low 8 bits index it and the sum's upper bits are a right shift (S19: "the yet unused MSB's of the input are the exponent"). The scale of the result is fixed by a measurement: one operator spans −8168 to +8168 (p11876), which is the largest entry, $7FA, shifted left two places. The result, with the sign from 6.2, is the 14-bit output. 6. Past about 40 dB of total attenuation the output is 0: the format has no more resolution (S9). 7. The same two tables, as formulas of the same form, were read bit by bit from the dies of the YM3812 and YMF262 (S19); Nemesis found his sine table "a perfect match" and the exponent table the same apart from a leading bit that the ROM leaves out (p6741). S21's tables are labelled "extracted from the die" and S22 computes both from formulas. Whether the three statements agree entry for entry was **not checked** in this phase; it is the first thing rung 1 does (validation.md). 8. The dB figures in the manuals (0.75 dB per total-level step, 96 dB in all) are amplitude decibels: eight total-level steps halve the amplitude. **measured** (p11876, GManiac: "each 8 steps of TL are equal to 6 dB"). Nemesis's remark that the true range is 48 dB counts power decibels and describes the same arithmetic. ## 7. Envelope generator ### 7.1 State and output 1. Each operator has a 10-bit attenuation, 0 loudest, $3FF quietest, and is in one of four phases: attack, decay, sustain, release. **measured (read-out)** (p5716, p7967). 2. The value that goes to the operator unit is, every sample: the internal attenuation, inverted if SSG-EG says so (7.6); plus the total level shifted left three places; plus the tremolo amount if the operator's tremolo bit is set (8.4); limited to $3FF. **measured** (p5716, p7967: inversion comes before total level and tremolo; p18903). A total-level write is heard at the next sample (p8020, reasoned from the per-sample inversion, not tested directly). 3. Total level: 7 bits, 0.75 dB a step. Sustain level: 4 bits, 3 dB a step, with the value 15 standing for 93 dB. **documented** (S1, S2 table 2.5, S4 table 2-7). ### 7.2 Rates 1. `Rate = 2R + Rks`, where R is the 5-bit register for the current phase; if R is 0 the rate is 0; a rate above 63 is 63. For release R is the 4-bit register doubled plus one. **documented** (S1, S2 page 28, S4 2-5-1). The R = 0 test is applied after that doubling, so a release rate is never 0 (p5724). 2. Rks is the key code shifted right by 3, 2, 1 or 0 places for key scale 0, 1, 2, 3. **documented** (S2 table 2.6, S4 table 2-8; S5 gives the same as KC/8, /4, /2, /1). 3. The rate is worked out afresh at every envelope update, so a write to a rate or to the key scale changes a phase already running. **measured (read-out)** (p7967, correcting p5716). ### 7.3 The counter and the step patterns 1. One counter is shared by all operators and advances once per envelope update (every third sample). **measured** (p5716: a note can begin at any point of the step pattern; "internal tables.png"). 2. Each rate has a counter shift from 0 to 11: with shift 0 the attenuation is updated at every envelope update, with shift 11 once in 2,048, and each update takes the next of eight increments in a loop. **measured** (p5716, prose). Which rate has which shift, s = 11 − r/4 (whole division), not below 0, with the three counter bits above the low s choosing the step: **provisional (emulator tier)**, S21. Prose fixes the two ends: rate 2 decays in 2,048 × 2,048 updates and rate 63 in 128 (p5716's figures, restated in envelope updates). 3. The patterns: **provisional (emulator tier)**, S21's table, except where marked. As increments per step. For rates below 48 the four rates of a group use, in turn: 0 1 0 1 0 1 0 1; 0 1 0 1 1 1 0 1; 0 1 1 1 0 1 1 1; 0 1 1 1 1 1 1 1. For rates 48 to 51: all 1; 1 1 1 2 1 1 1 2; 1 2 1 2 1 2 1 2; 1 2 2 2 1 2 2 2. Rates 52 to 55 the same doubled, 56 to 59 doubled again. Rates 60 to 63: all 8. The lowest rates are irregular: 0 and 1 never step; 2 to 5 use 0 1 0 1 0 1 0 1; 6 and 7 use 0 1 1 1 0 1 1 1 ("rate values of 2 and 3, 4 and 5, 6 and 7 do produce an identical output. That's not an error"). 4. Standing of 7.3.2 and 7.3.3 after the audit. Nemesis's two tables are in code boxes, which the audit did not read; he says they are "based on information provided in MAME" and that he "independently tested most of these values against the YM2612 output" and corrected some (p5716), and later put his confidence in the increment table at "maybe 95%" (p11386). What his **prose** states, and is therefore **measured**: the mechanism of 7.3.2; rate 7's pattern, "0,1,1,1,0,1,1,1"; that rates 2 and 3, 4 and 5, 6 and 7 give identical output; that the largest increment without SSG-EG is 8 and that rates 60 to 63 use it (p7967); that there is no way to observe rates 0 and 1 (p5724). Everything else in 7.3.3 is S21's table (BSD-3-Clause, no source stated for it), which agrees with every one of those prose facts. The first draft of this section was written from Nemesis's code box; the values did not change, their standing did (U21). 5. The counter's width and whether it passes through zero: 12 bits counting 1 to 4,095, per GManiac (p18838, no test described) and S22 ("confirmed behavior", unattributed). **unsettled** (U3). It matters only to the slowest rates' period. 6. Which of the three samples carries the envelope update, and whether all channels update on the same one, is **unsettled** (U4; a guess in p7998 and p18838 that channel pairs take turns). ### 7.4 The phases 1. Decay, sustain, release: `attenuation += increment`, limited to $3FF. **measured (read-out)** (p5716, p8025). 2. Attack: `attenuation += (~attenuation × increment) >> 4`, where ~ is the 10-bit complement taken as a negative number, so the attenuation falls toward 0 ever more slowly. **provisional (emulator tier)**: the formula is S21's. Nemesis gives his in a code box (p7967), which the audit did not read, saying in prose only that it "is the same as the existing update calculation used in the MAME core". Two **measured** values in his prose agree with S21's formula: from $3FF at increment 8 "it would take 10 update steps to achieve minimum attenuation" (p7967), and the first step of a slow attack from $200 gives $1DF (p8037) (U22). There is no output inversion in attack: **measured** (p7967). 3. Key-on (an operator's key state going from off to on): the phase becomes attack; the attenuation is **not** reset, the attack starts from where the envelope stands (p5724, p7999); the phase counter is cleared (5.9); the SSG-EG inversion flag is cleared (7.6). 4. If the attack rate works out to 62 or 63 at key-on, the attenuation goes to 0 at once, in that same sample. **measured (read-out)** (p7967). 5. If the attack rate becomes 62 or 63 by a register write while an attack is running, the attack stops moving and stays where it is until the rate drops below 62 or the key is released. **measured (read-out)** (p7967). S21 and S22 model the same. 6. Attack ends when the attenuation reaches 0; decay follows. Decay ends when the attenuation reaches or passes the sustain level; sustain follows. The step that passes the level is not cut back to it, and once in sustain a new sustain level has no effect. **measured (read-out)** (p7967, correcting an earlier belief in clamping). 7. The sustain level as a 10-bit number is the register value times $20, and the value 15 is special: $3FF according to Nemesis (p7967), $3E0 according to the manual's "93 dB" and S21. **unsettled** (C9); the difference is one envelope step near silence. 8. Key-off: release from the current attenuation. A key-off while released, or a key-on while keyed on, changes nothing (S17; S21). 9. Key changes are acted on every sample, not only at envelope updates. **measured** (p7967, by CSM at its fastest). 10. A fast key-off and key-on while the attenuation is still 0: whether the envelope re-enters attack for a step or goes straight on is **unsettled** (U5, asked in p8045 and not answered). ### 7.5 What the envelope does at reset Release phase at $3FF: S21 and S22. No measurement. **unsettled** (U14). ### 7.6 SSG-EG **measured (read-out)** by Nemesis after "a solid month of testing involving hundreds of tests" (p7967, with p8025, p8032, p8037), on a discrete YM2612, *as far as his prose goes*. He gives the implementation itself as five pieces of his emulator's source in code boxes, which the audit did not read. Each item below now says whether his prose states it, whether it follows from his prose together with the manual's eight shapes ("derived"), or whether it is S21's (**provisional (emulator tier)**). The manuals give only eight pictures and the instruction to set the attack rate to 31 (S1, S2 figure 2.4). The eight shapes with the attack rate at 31, by the low three bits (attack, alternate, hold): 000 repeated falling ramps; 001 one ramp, then silence; 010 down, up, down, up; 011 one ramp, then held loud; 100 repeated rising ramps; 101 one rise, then held loud; 110 up, down, up, down; 111 one rise, then silence. **documented**. 1. With the enable bit set, each decay, sustain and release step is four times the normal increment (prose, p7967), and is applied only while the internal attenuation is below $200 (derived: the held-loud shapes 011 and 101 need the level to stay at $200, and "the attenuation isn't moving past 0x200 during a repeating SSG-EG wave", p8037; S21 has the same test). The enable bit is looked at on every update, so setting or clearing it during a note changes the speed at once (prose, p7967). 2. Each operator has an inversion flag, cleared at key-on. The output is inverted when the enable bit is set, the phase is not release, and the flag differs from the attack bit: all prose (p8025, "(phase != release) && (ATT ^ inversionBit)"; "when key-on occurs, the note begins with the invert flag cleared"). Inverted output is `($200 − attenuation)` kept to 10 bits (prose, p7967, with three examples); it is taken on a copy, before total level and tremolo (prose, p7967). A write to the attack bit therefore inverts the output at once (prose, p8025). 3. Every sample, before any envelope update due on that sample (prose, p7967), if the enable bit is set and the internal attenuation is at or above $200: - if the alternate bit is set, and either the hold bit is clear or the inversion flag is still clear, the flag is toggled (prose: p7967 for the continuous case, p8025 for "hold mode only ever allows the ALT bit to toggle the inversion state once"); - if the alternate and hold bits are both clear, the phase counter is held at 0 (prose, p7967 item 4); - then, unless the phase is attack: if the phase is decay or sustain and the hold bit is clear, the phase becomes attack again, with 7.4.4 applying (prose, p7967 item 8, p8037); if the phase is release the internal attenuation is set to $3FF (prose, p8025, p8032); and in decay or sustain with the hold bit set it is set to $3FF when the output is not inverted and left alone when it is (**derived** from the manual's shapes: 001 and 111 end silent, 011 and 101 end loud; S21 does the same). 4. The attenuation is not cut back to $200 when the pattern repeats; a step may carry it past, and one sample is output at that level first (prose, p7967). 5. At key-off, if the output is inverted at that moment, the internal attenuation is replaced by `$200 − attenuation` (10 bits), so the release continues from the level that was being heard. **provisional (emulator tier)**: S21. Nemesis's prose says only that inversion is off during release whatever the flag and the attack bit (p8025); his key-off step is in a code box (U23). 6. With an attack rate below 31 the attack takes time, the attenuation stays at or above $200 for many samples, and the flag toggles on every one of them: a burst at half the sample rate between repetitions, and an inversion state for the next repetition that depends on the exact sample count. Two games are named as relying on it. 7. Two things cannot be observed and are free choices: whether the flag keeps toggling in release, and whether the phase is held in release (p8025). 8. Whether the YM3438 or the ASIC differs: no difference found on discrete YM3438s (p30063, by read-back "always matches the sound"); an MD2 recording of the test ROM "seems to work exactly like real YM2612" (p5723). Not compared value by value. Recordings in hand: S13. ## 8. LFO The least settled part of the chip. Nemesis: "I never fully finished testing the phase modulation implementation to my satisfaction" (p16459). 1. One LFO for the chip, enabled by $22 bit 3, eight rates: 3.98, 5.56, 6.02, 6.37, 6.88, 9.63, 48.1, 72.2 Hz at φM = 8 MHz. **documented** (S1, S2 page 31, S4, S5). The manuals call the wave a sine; on the **die** it is a 7-bit counter behind a prescaler, a triangle (p28164, p30937). 2. With 128 counter steps per cycle the manual's rates mean one step every 109, 78, 72, 68, 63, 45, 9, 6 samples (this session's arithmetic, and S21's). Emulators use one fewer (108, 77, 71, 67, 62, 44, 8, 5), S21 saying "tests on the hardware and nuked bear out an off-by-one error" without saying whose tests. **unsettled** (C14). 3. With the LFO disabled, tremolo is still applied and the wave is "locked": **measured** (p7490, prose: "Whatever value the LFO is frozen at, it applies a large amount of attenuation"). That the counter is held at 0, rather than frozen where it stood: **provisional (emulator tier)**, S21 ("it basically just keeps the counter at 0"). Nemesis's own statement of it is a comment in a code box (p16436), not read; his prose there says only that a counter value of 0 "is in fact supposed to be maximum attenuation". An older variant in which the level freezes where it stood is an emulator's choice of 2009 (C15). 4. Tremolo. From the 7-bit counter take the low six bits, inverted while bit 6 is clear: a triangle that starts at its maximum, 63 (**provisional (emulator tier)**, S21; the starting point agrees with p16436's prose). Double it and shift right by 8, 3, 1, 0 for depth 0, 1, 2, 3; add the result to the attenuation of each operator whose tremolo bit is set. The maxima are 0, 15, 63 and 126 units of 0.09375 dB: 0, 1.4, 5.9 and 11.8 dB, exactly the manual's table (S2 page 31), which is **documented** support for the shifts. The shifts themselves are from Nemesis's core; he could not say they were measured (p16459). Consequence of 8.3: with the LFO off, a tremolo-enabled operator sits at the maximum attenuation for its depth, which two games are said to need (p7490; S21's comment). 5. Vibrato is applied to the F-number before the block shift, and the block and key code are untouched by it. **measured** (p8905, p8908), **die** (p30937: "the LFO is definitely doing frequency modulation, not phase modulation"; p31049). 6. Vibrato amount. The counter's bits 6 to 2 give 32 steps (S21; p8909): eight magnitude steps up, eight back, and the same negated. For vibrato depth d (0 to 7) and magnitude step m (0 to 7) Nemesis's table, for F-number bit 9: | d | m = 0 to 7 | |---|---| | 0 | 0 0 0 0 0 0 0 0 | | 1 | 0 0 0 0 1 1 1 1 | | 2 | 0 0 0 1 1 1 2 2 | | 3 | 0 0 1 1 2 2 3 3 | | 4 | 0 0 1 2 2 2 3 4 | | 5 | 0 0 2 3 4 4 5 6 | | 6 | 0 0 4 6 8 8 10 12 | | 7 | 0 0 8 12 16 16 20 24 | The amount for a set F-number bit b is this value shifted by (b − 9) places (**measured**, p8911 prose: "the lookup table for every other bit is simply a shift of this table"); the amounts for all set bits are summed, negated in the second half of the cycle, and added to the F-number. Standing of the table after the audit. Nemesis's table is in a code box, not read, and he says of the MAME table quoted to him "That table is correct" (p8911), so its descent is MAME's. Its **last column is documented**: the manual's depths of ±3.4, 6.7, 10, 14, 20, 40 and 80 cents (S2 page 31, read from the OCR text by the audit) applied to an F-number of $200 give 512 × (2^(c/1200) − 1) = 1.006, 1.985, 2.966, 4.157, 5.949, 11.97, 24.20, which are the column 1, 2, 3, 4, 6, 12, 24 to the nearest whole number. The **seven columns before it are provisional (emulator tier)**: they are what S21's pair-of-shifts table gives for an F-number of $200, and S21 says that table was "written to match Nuked behavior" (decision P2 (b): a tie-breaker of last resort; the manual gives no intermediate values) (U24). 7. Three points of 8.6 are **unsettled** (C16): whether the sum keeps 11 bits (Nemesis measured that "frequency modulation values do indeed cut off after the 11th bit") or 12 (the die: "11 bits enter the LFO multiplier thing, 12 bits leave"; S21 doubles the F-number first); whether the low F-number bits contribute through carries (Nemesis "measured sign-extension taking effect ... all the way down to fnum bit 0" and thought full precision likely, but did not build it; the die suggests only bits 4 to 10 enter); and how the sum wraps at the top (Nemesis: masked to 11 bits). 8. When within a sample the LFO steps is **unsettled** (U6). ## 9. Channels and algorithms 1. Six channels of four operators. Operator 4 is always a carrier. **documented**. 2. The eight algorithms (→ modulates; + sums at a modulation input or at the output). **documented** (S1, S2 figure 2.2, S4 figure 2-3, S5): | Algorithm | Connections | Carriers | |---|---|---| | 0 | 1→2→3→4 | 4 | | 1 | (1+2)→3→4 | 4 | | 2 | (1+(2→3))→4 | 4 | | 3 | ((1→2)+3)→4 | 4 | | 4 | (1→2) + (3→4) | 2, 4 | | 5 | 1→2, 1→3, 1→4 | 2, 3, 4 | | 6 | (1→2) + 3 + 4 | 2, 3, 4 | | 7 | 1 + 2 + 3 + 4 | all | 3. A modulation input is the sum of the modulating operators' 14-bit outputs, shifted right one place, added to the 10-bit phase. **measured** (p18814, GManiac: "No exceptions"; p18903, TmEE, by spectrum against a real chip). 4. Feedback (operator 1 only): the operator's last two outputs are summed, and the sum shifted, to make its modulation input. **measured**: two stores exist (p18814, "I made it sure by special tests"); **die**: a sign-extended 15-bit sum into a shifter set by the feedback field (p27319). The patent explains the two-sample mean as the cure for "hunting" (S20, US 4,249,447). The levels are 0, π/16, π/8, π/4, π/2, π, 2π, 4π. **documented** (S2 table 2.2, S4 table 2-3). With 6.1 and 9.3 that is the sum shifted right by (10 − feedback) places for feedback 1 to 7, and nothing for 0: arithmetic from the documented levels, and what S21 does. The shift was not measured on hardware by anyone (U7). 5. Feedback and algorithm changes are heard at once (p5720). 6. **Which sample's output a modulator supplies.** Because the operators are worked in the order 1, 3, 2, 4 (4.4), operator 3 runs before operator 2. From the **die** (p29471, p27098, read from the YM2203 and checked against the YM2612): operator 2 uses operator 1's output of the same sample; operator 4 uses operator 3's of the same sample and operator 1's of the same sample; but operator 3 uses operator 1's and operator 2's outputs of the previous sample, and operator 4 uses operator 2's of the previous sample. S22 implements the same set; S21 uses same-sample outputs everywhere. Not measured on a chip's output; Sauraen: "I can't even think of a test sound that would sound audibly different". **unsettled** between the die reading and S21 (C11); the die reading is the better source. ## 10. Channel 3's special mode and CSM 1. $27 bits 7-6: 00 normal; 01 channel 3's operators take their own F-number and block from 3.3.4; 10 the same, plus CSM; 11 as 01. **measured** (p5650, "based entirely on tests performed on the YM2612 hardware"; p7967: "CSM mode is only active when the channel 3 mode status bits are set to 10"). The manuals disagree with each other here (C2). After the audit: Nemesis's four-row table is in a code box. His prose gives "CSM mode is only active when the mode bits are set to 10, NOT when they are set to 11" and "Special mode is always active when CSM mode is active"; S2 gives 01 as the separate-frequency mode. That 11 also gives separate frequencies is **provisional (emulator tier)**, S21 (U25). 2. In special mode each operator's key code, and so its detune and rate scaling, comes from its own F-number and block. **die** (p31049). 3. CSM needs Timer A's load bit; the enable and reset bits and Timer B do not matter (p5650). 4. CSM has its own key-on flag for channel 3's four operators. A Timer A overflow while the mode is 10 sets it; it is cleared once the next sample has acted on it. An operator is keyed on while either this flag or its bit from $28 is set, and the chip acts only on changes of that combined state from one sample to the next. So a lone overflow keys the operators on for one sample and off at the next; overflows on every sample (Timer A at $3FF) hold them on; an operator held on through $28 is not disturbed. If the mode leaves 10 the flag is forced clear. **measured** (p7967, replacing the simpler account of p5650). 5. Because the key-on lasts one sample, only an attack rate that gives 62 or 63 makes a sound (7.4.4); the total level and release rate shape it (p5650). Recording in hand: `ym2612csmmode.wav` (S13). 6. Rounding in where the overflow falls within a sample is **unsettled** (U8). ## 11. Timers 1. Timer A is 10 bits and steps once per sample: its period is `144 × (1024 − NA) / φM`. Timer B is 8 bits and steps once per 16 samples: `2304 × (256 − NB) / φM`. **documented** (S2 page 13; S5: 18 µs and 288 µs units) and **measured** (p5680). S1 and S4 print 72 and 1152, half as long: for the YM2612 that is wrong (C1). 2. A timer counts from its register value and overflows on the step after its last count; on overflow it reloads from the register. It is also reloaded when its load bit goes from 0 to 1. It is not reloaded by writing 1 to a load bit already 1, by the enable or reset bits, or by writing the timer registers; a new register value is used at the next reload. With the load bit 0 the timer stops. **measured** (p5687, p5680). 3. On overflow, the timer's status flag is set if its enable bit is set. Writing 1 to its reset bit clears the flag; the reset bit does not stay set. **documented** (S1, S2 page 14). 4. The /IRQ pin is low while either flag is set (p7967; **die** p27032, p31240). It is not connected in the Mega Drive (p7445), so the board never sees it. 5. Timer B's divide-by-16 is not restarted by the load bit, so a first period can be up to 15 samples short: S21 and S22 only. **unsettled** (U9). 6. Test bit $21 bit 2 makes both timers step every internal clock, 24 times faster (section 17). ## 12. Status and BUSY 1. One status byte: bit 7 BUSY, bit 1 Timer B's flag, bit 0 Timer A's flag. **documented** (S1 printed page 11, S2 page 11, S5), **die** (p31240). The other bits are not driven by the chip; what a CPU reads there is the board's business. 2. BUSY is set by a data write and by nothing else, and clears 32 internal clocks (192 master clocks) later, whatever register was written. **die** (p27124, p31154: "a 5-stage counter, not connected to anything else") and **measured** (p31026, Eke 2017, on a VA4 MD1 and a VA0 MD2, by counting BUSY reads and matching an emulator to the count; the same length on both chips). Address writes do not set it. 3. BUSY is therefore a timer and does not say when a write has been taken in: 83 master clocks are required after an operator write (2.7) and BUSY reads set for 192. Yamaha's wait table and BUSY measure different things. 4. BUSY is not visible instantly: on the ASIC "waiting 20 YM cycles after the register write is enough" (p37832). Exact delay **unsettled** (U10). 5. **Which address returns status** is **unsettled** (C4). S1 lists a status read only at A1 = 0, A0 = 0 and lists nothing for the other three. S2 lists the other three as an "inactive read mode" with the data bus undriven. S6 (Sega, 1991): on the YM2612 the output at $4001 "is not regulated", and a program reading there sees "not busy". Against that, Nemesis in 2008 found the status "returned from the YM2612 under all circumstances, regardless of the address" (p5680). Eke in 2017: port 0 only on the discrete chip, any port on the ASIC (p31026). Stef in 2023: the reverse (p37832). One game is reported to play its music at half speed on ASIC consoles because it polls BUSY at another address (p31026, S18), which fits Eke's direction and Sega's bulletin. 6. With test bit $21 bit 6 set, reads return test data in place of the status (section 17). ## 13. The DAC channel 1. $2B bit 7 replaces channel 6's FM output with the value of $2A. **documented** (S1, S2 page 15: "offset binary", bit 7 the most significant; S5). 2. Channel 6's operators keep running while replaced; only the output is switched. **measured** (p14109). 3. The value is $2A with its top bit inverted, as the upper eight of nine signed bits; the ninth, lowest bit is $2C bit 3. **die** (p26996, p15081; p34272). So in 9-bit units the output is `2 × ($2A − $80)`, plus $2C bit 3. One post gives a factor of 4 and a range of ±512 (p14109), which does not fit a 9-bit DAC (C10). 4. Only channel 6's left and right bits act on it. **documented** (S5). 5. The register takes a new value at once and the output uses it once per sample. **die** (p34255, "If I remember correctly"). Every write is heard if writes are one sample apart: **measured** (p31027, p34262, TmEE, correcting his earlier report of lost writes). The instant of sampling within the sample is **unsettled** (U11). ## 14. Accumulator and panning 1. Each carrier's 14-bit output is cut to its upper 9 bits (an arithmetic shift right by 5, no rounding) before the carriers of a channel are summed. **measured** (p11862, p11876, GManiac, oscillograms), **die** (p27032, p29516), **documented** (S1 2-6, S2 page 33: the accumulator adds "slot outputs (9 bit)"). 2. The sum is limited, not wrapped. **measured** (p11876), **documented** indirectly (S2 page 42 advises total levels that avoid "overflow": none needed for algorithms 0 to 3; the carriers' levels summing to −6 dB or lower for algorithm 4, −9.5 dB for 5 and 6, −12 dB for 7). The upper limit is +255 or +256: GManiac measured +256 ("AFAIR"; 513 levels), a 9-bit signed value says +255. **unsettled** (C8). 3. A channel's 9-bit signed result goes to the left output if $B4 bit 7 is set and to the right if bit 6 is set. **documented**. One DAC serves both sides (**die**, p15097). Changing the bits per sample to pan the DAC channel does not give stereo samples on hardware (p6339). 4. A channel with both bits clear "may be faintly audible, depending on the voice parameters and total level set". **documented** (S1 2-7-2; this session's translation). That is the ladder effect seen by the manufacturer: 15.3. ## 15. Output stage ### 15.1 Both parts: six time slots 1. The channels are not added together. Each sample is six slots of 24 master clocks, one channel's value in each, in the order 1, 5, 3, 2, 6, 4; left and right change together. **measured** (p7516, p7520, Nemesis, oscilloscope on a discrete YM2612 and on an MD2's ASIC, p7537; p30063, read-back on YM3438s). 2. What a listener hears after the console's filter is the average of the six slots. A core may output that average, or the sum, per sample; a board that wants the slot structure (it carries energy above the audio band, visible in 192 kHz recordings) needs the six values. ### 15.2 The discrete YM2612 1. The value is driven for about a quarter of its slot (6 master clocks high, 18 at rest per p8646 and p29513; 5 and 19 per p7520) and the pin rests in between. **measured** (the same oscilloscope pictures, read three ways). 2. The DAC is a sign bit and an 8-bit code selecting a tap of a resistor string, which the sign switches toward the supply or toward ground; at rest the output sits at half the supply. **die** (p15075 to p15097, p26980). 3. **The ladder effect.** The two halves do not meet in the middle. What is **measured**, all on discrete chips, none as numbers in volts: a step from −1 to 0 several times larger than any other ("3-4x", p30097; "a jump of 3 samples between $7F and $80", S12, on the DAC channel); levels −1 and −2 equal (p11876); some levels out of order ("+35 is higher than +36", p12991); further discontinuities when the low four bits of $2A are 0 above mid-scale with $2C bit 3 clear (p32647); quiet sounds much louder than they should be and a floor that fades late (p7437, p6636; S14's recording levels off about 33 dB below its peak before going silent, per megadrive-python's notes). 4. A channel that is panned off, and the rest between slots, are not neutral: the distorted part is still heard "even when the output register for a channel are zeroed out" (S14), which is 14.4. 5. **The size of the effect is unsettled** (U12). Two hardware numbers exist in prose, both for the one step at mid-scale: GManiac, from memory, "3-4x times larger than usual step", a value alternating between −1 and 0 coming out as "-3.5; 0" (p30097); Kabuto, "a jump of 3 samples between $7F and $80" on the DAC channel (S12). Neither says what a muted or idle slot outputs. The full rule is an emulator's: S21 adds +4 to a non-negative value and −3 to a negative one, in 9-bit steps, for every channel on every side, with no source; S22 does nearly the same but gives a muted channel the sign of its unmuted value. A post relays a different rule from the Nuked model (p32605); it is not used here. ### 15.3 The YM3438 and the ASIC 1. The ASIC holds each value for most of its slot; "clearly this is a totally different DAC". **measured** (p7537; S12). 2. No ladder step: a quiet sine shows −2, −1, 0, +1 as distinct levels on an MD2 (p12981); Kabuto "did not spot this on MD2". **measured**. One report of the effect on a discrete YM3438 (p12973) was contradicted by its author two weeks later (p13067). 3. Reported and not measured: the ASIC clips at a lower level (p6607) and is louder (p13067). **unsettled** (U13). ### 15.4 Not the chip The console's low-pass filter, amplifier distortion (severe on early model 2 boards, S12) and the mix with the PSG are the board's. One figure for the board: four PSG channels at full volume equal one FM channel at full volume, at the chip's pin (p5960). ## 16. Reset 1. /IC low for at least 192 master clocks resets the chip. **documented** (S1, S2 page 37). 2. After power-on the registers read as zero except the left and right bits, which are set. Lightly tested (p8020, p7999). S21 and S22 do the same. After reset the channel outputs read 0: **measured** on a YM3438 (p30088). 3. Whether /IC during play clears registers, stops notes, or clears the envelope counter, LFO and timers is **unsettled** (U14): "I didn't do any tests with triggering a reset after initializing the registers" (p8020). 4. BUSY's counter has reset as an input (**die**, p31240). ## 17. Test registers No program is known to need these, except by accident. They matter because they are how the chip was measured, and how it could be measured again. | Bit | Function | Standing | |---|---|---| | $21 bit 0 | chooses which of two unknown signals appears as bit 14 of the read-out | die; function unknown | | $21 bit 1 | reaches the LFO | die; unknown | | $21 bit 2 | timers step every internal clock, 24 times faster | measured (S9; p26964) | | $21 bit 3 | freezes the phase generator: the counter stays at 0, so the phase equals the increment | measured (S9, Nemesis; S10, GManiac) | | $21 bit 4 | inverts the top bit of the output | die (p26964); S10 describes its effect differently | | $21 bit 5 | freezes the envelope generator | measured in outline (S9, S10) | | $21 bit 6 | reads return test data in place of status | measured (S9, S10) | | $21 bit 7 | chooses the low (1) or high (0) byte of the 16-bit test word | measured (p31285) | | $2C bits 2-0 | nothing | die | | $2C bit 3 | lowest bit of the DAC channel's value | die | | $2C bit 4 | test word is the 9-bit channel output (1) or the 14-bit operator output (0) | measured on YM3438 (p31285) | | $2C bit 5 | the DAC value is output in every slot; FM is not heard; about 5 times louder on an MD2 and 30 on an MD1 | measured (S10, Oerg866; S12) | | $2C bit 6 | selects a function of the TEST pin as input | die; unknown | | $2C bit 7 | TEST pin is an output | measured on YM3438 (p31285) | 1. The 16-bit test word: bit 15 and bit 14 are status-like signals; the low 14 bits are the operator output, or the low 9 the channel output. It changes every internal clock and cannot be held, so the two bytes of one value cannot both be read (p31285). 2. The TEST pin as an output gives one pulse per sample (p30065, on a YM3438). Nemesis earlier found pin 10 of a discrete YM2612 to follow BUSY (p6288, p15000). **unsettled** (C5); no board connects it to anything a program can see. 3. A core needs none of this to play music. Decision T8 proposes $2C bit 3 only. ## 18. What a sample is, in one list For a model that steps once per sample, in this order (an arrangement of the statements above, with their standing): 1. Take in register writes made since the last sample (2.8: a simplification). 2. Timers step; a Timer A overflow may set the CSM flag (10.4, 11). 3. The LFO steps when its divider says so (8). 4. For each operator: act on a change of key state (7.4.3, 7.4.4, 7.4.8). 5. For each operator: the SSG-EG step (7.6.3). 6. If this is an envelope sample (one in three), advance the counter and update each operator's attenuation (7.3, 7.4). 7. For each operator in the order 1, 3, 2, 4: advance the phase (5), compute the output (6) with the modulation of 9.3, 9.4 and 9.6. 8. Per channel: cut carriers to 9 bits, sum, limit (14); channel 6 may be replaced by the DAC value (13). 9. Output stage for the variant (15). The order of 4, 5 and 6 is Nemesis's (p7967). The place of 2 and 3 in the order is a **choice** (U6, U8). ## 19. Contradictions | | Between | About | Taken here | |---|---|---|---| | C1 | S1, S4 (72, 1152) and S2, S5, p5680 (144, 2304) | Timer periods | 144 and 2304: measured | | C2 | S1, S4 (01 CSM, 10 effect), S2 (10 CSM, 01 effect), S5 (01 special, 1x illegal), p5650 (01 and 11 special, 10 special with CSM) | $27 bits 7-6 | p5650: measured | | C3 | p5716 and p6224, p7967 | Envelope clock: φM/351, or every third sample | every third sample: its author's correction | | C4 | S1, S2, S6, p5680, p25392, p31026, p37832 | Which address returns status, on which chip | unsettled; decision T3 | | C5 | p6288, p15000 and p30065 | TEST pin: BUSY or a per-sample pulse | unsettled; no effect on a board | | C6 | S5 and S1, S2, S4, p5605 | Channel 3's operator registers; key code | Yamaha's, confirmed on hardware | | C7 | p5716 (×6), p7967 (×4) | SSG-EG speed | ×4: its author's correction | | C8 | p11876 (+256) and a 9-bit signed range (+255) | Accumulator's upper limit | unsettled; decision T5 | | C9 | p7967 ($3FF) and S2's "93 dB", S21 ($3E0) | Sustain level 15 | unsettled; decision T6 | | C10 | p14109 (×4, ±512) and the die (9 bits) | DAC channel scaling | the die's | | C11 | p27098, S22 (three delayed paths) and S21 (none) | Which sample a modulator supplies | the die reading; decision T4 | | C12 | p5621, S22 (per channel) and S21 (shared) | F-number latch | unsettled; decision T7 | | C13 | p7673 (one latch, either data port), S21 (other port's data dropped), p34277 | Data written through the other part's port | p7673: measured; global registers unsettled | | C14 | S1, S2 (109, 78, ... by arithmetic) and S21, S22 (108, 77, ...) | LFO divider | unsettled; decision T2 | | C15 | p16436 (counter held at 0) and p9166 (level held) | LFO while disabled | p16436 | | C16 | p8905, p8911 and p30937, p31049 and S21 | Vibrato: 11 or 12 bits, carries from low bits | unsettled; decision T1 | | C17 | p5724 (above 61), p6179 (60 to 63), p7967 (62 and 63) | Which attack rates are instant | p7967: the latest and measured | | C18 | p6179, p6225 (clamp) and p7967 (no clamp) | Decay passing the sustain level | no clamp: measured | | C19 | p5958, p6258 (16-bit sum, an embedded external-type DAC) and p11876, p15077, S1, S2 | Accumulator and DAC width | 9 bits: the later work | | C20 | p5650 and p7967 | CSM: on then off at once, or a one-sample flag | p7967 | | C21 | p27145 (ASIC slower to take writes) and p37832 (identical) | Write timing on the two chips | identical: its author's correction | ## 20. Unknowns | | Unknown | Who would hear it | |---|---|---| | U1 | Which internal clock takes in a write to each register; lost and misdirected writes (2.8, 2.9) | programs that write faster than Yamaha allows; one demo | | U2 | Key-on channel values 3 and 7 | nobody known | | U3 | Envelope counter's width and whether it skips 0 | the slowest rates, by under 0.03 % | | U4 | Which sample of three updates which channel's envelope | a test, not a listener | | U5 | Key-off then key-on at attenuation 0 | a test | | U6 | Where in the sample the LFO steps | a test | | U7 | Feedback shift, measured | everyone, if wrong; it follows from the manual | | U8 | Timer A overflow against the key evaluation, to the clock | CSM at its fastest | | U9 | Timer B's prescaler on load | a timing test | | U10 | Delay before BUSY reads set | drivers that poll at once | | U11 | The instant $2A is sampled | sample playback jitter | | U12 | The ladder effect as numbers; idle and muted slots | every quiet passage on a model 1 | | U13 | The ASIC's levels and clipping against the discrete chip | level balance on model 2 | | U14 | State after /IC; envelope counter, LFO, timers at reset | a reset during music | | U15 | The low rates of the envelope step table (Nemesis: 95 % sure) | very slow envelopes | | U16 | Tremolo shifts, measured | everyone, if wrong; they reproduce the manual's depths | | U17 | Vibrato table against the manual's cents | vibrato depth | | U18 | Whether the three statements of the sine and exponent tables agree | everyone, if not | | U19 | $21 bits 0, 1, 4; $2C bit 6 | nobody | | U20 | Whether the ASIC equals a discrete YM3438 digitally | model 2 owners | | U21 | The envelope step table and the rate-to-shift rule as a measurement stated in prose (7.3.2, 7.3.3): taken from S21 | every envelope, if wrong; it agrees with all the prose facts | | U22 | The attack formula as a measurement stated in prose (7.4.2): taken from S21 | every attack, if wrong; two measured values agree | | U23 | SSG-EG at key-off while the output is inverted (7.6.5): taken from S21 | SSG-EG notes released mid-ramp | | U24 | The vibrato table's seven lower columns (8.6): taken from S21 | the shape of vibrato, not its depth | | U25 | Channel 3 mode 11 (10.1): taken from S21 | nobody known | | U26 | The LFO counter while disabled, and the tremolo triangle's phase (8.3, 8.4): taken from S21 | tremolo-enabled voices with the LFO off | | U27 | Whether the accumulator limits after each addition, and in what order; Nuked-OPN2 run as a closed box gives lower peaks than summing then limiting (validation.md rung 6, difference 2, stream `channel-3-mode-01`) | four-carrier algorithms at full level | | U28 | The sample at which the phase restarts against the envelope at a CSM re-key over a sounding note and in SSG-EG patterns 0 and 4; the closed box is one sample later (difference 3) | a test | | U29 | When CSM's first key-on comes after the timer is started; the closed box is about a timer period earlier (difference 4, stream `csm-3f0`) | CSM speech | U27 to U29 were added on 2026-11-13 from the closed box's output (observations of a detector, not facts about the chip). U21 to U26 were added by the provenance audit of 2026-11-13: each was stated in the first draft as measured, and its only support in an allowed source's prose turned out to be a code box. See [provenance-audit.md](provenance-audit.md). ## 21. How much of the chip is in the allowed sources Plainly: - **The sound of a note is well covered.** Phase generator, operator unit, envelope generator with SSG-EG, algorithms, accumulator, timers and CSM are described by one researcher's digital read-outs of a real chip, in prose, formulas and his own pseudo-code, checked in places by a second measurer and by a die reading, and agreeing with the manufacturer where the manufacturer speaks. A core written from sections 5 to 14 should produce, for ordinary music with writes spaced as Yamaha requires, the same 9-bit channel values as the chip on almost every sample. - **The LFO is half covered.** Rates, depths and shape are documented; the divider's exact length and the vibrato's precision are not settled above emulator tier (C14, C16). Expect vibrato and tremolo to be right to the ear and possibly not to the sample. - **Timing inside a sample is barely covered.** When a write lands, BUSY's start, the $2A sampling instant, the order of the 24 clocks: there is a die reading in prose, three hardware reports and no table. A core under these rules should be a per-sample model that takes writes at sample boundaries and says so. It will differ from the hardware when a program writes mid-sample faster than allowed, by up to one sample (19 µs) in when a write is heard. - **The discrete chip's output stage is described, not quantified.** The ladder effect can be modelled by its shape (a mid-scale step, sign-dependent rest levels) with provisional constants, and tuned against S14 and S16. It cannot be claimed exact. - **What only the excluded sources hold**: the complete clock-by-clock schedule, the write-point logic, the exact LFO and vibrato circuits, the envelope generator as wired, the DAC's idle behaviour, the test bits' full effect. The Nuked models, the LGPL die-derived C, and megadrive-python's old documents state these; nothing allowed does. Rule 8 lets the first of these be *run* to see where a core differs, and each difference then has to be explained from sections 2 to 17 or written down as open. Expected outcome: a core faithful to the manuals, to Nemesis's measurements and to the recordings in hand; sample-level, not clock-level; not sample-identical to any model; with a provisional output stage for the discrete chip. megadrive-python's earlier claim of agreement with two die models at every clock cannot be re-earned from these sources.