YM2610 registers

=Timers=

To do: Page.


 * TA = Timer A (10bit), TB = Timer B (8bit)
 * Timers will tick until they have reached zero, at which point an IRQ will be generated if enabled. Reading port $04 will show which timer caused it (see below).
 * The actual timer counter registers are not directly accessible. They can be reset to zero or initialised from load registers $24~$26
 * Writing 0 to the load bits in register $27 will reset the timer counter registers to zero
 * Writing 1 to the load bits will copy the respective timer load register to the timer counter. This only works when the timer is at zero.
 * When a timer expires, it is automatically reloaded from the load registers and continues.
 * Timer flag reset refers to the same flags that are read from port $04
 * CSM mode is for automatic key on for operators on the second FM channel when timer A expires ?


 * Timer A IRQ frequency: 8M / 2 / 12 (prescaler) / 12 / TA load = 27.1Hz ~ 27.8kHz ?
 * Timer A IRQ frequency: 8M / 16 / 12 (prescaler) / 12 / TB load = 13.6Hz ~ 3.47kHz ?

=SSG part=

See SSG for details on this part's operation.

=FM part=

See FM for details on this part's operation.

Common FM registers
LFO frequency values are as follows:
 * 0 – 3.98Hz
 * 1 – 5.56Hz
 * 2 – 6.02Hz
 * 3 – 6.37Hz
 * 4 – 6.88Hz
 * 5 – 9.63Hz
 * 6 – 48.1Hz
 * 7 – 72.2Hz

Overall channel registers
The first value listed in the Address column is for channels 1/3; the second is for channels 2/4.

Channel registers
Depending on which channel you want to write to, the ports used are different:
 * Channels 1 & 2: Ports 4/5
 * Channels 3 & 4: Ports 6/7

Per-operator registers
The ranges given for the address represent all of the parameter values. Each channel's operators are laid out as follows:

=ADPCM part=

See ADPCM for details on this part's operation.


 * Write to flag control to reset/mask channel end flags
 * Write 1 to reset and/or mask selected flag
 * Write 0 to unmask selected flag
 * Masking a flag will prevent it from being raised when a channel reaches its end address. This means you have to write 1 to clear the flag, then 0 to keep it active.
 * Flags must be manually cleared, playing a new sample on the channel won't clear it.

ADPCM-A part
See ADPCM for details on this part's operation.

ADPCM-B part
See ADPCM for details on this part's operation.

=Reading=

The only writable registers that can also be read are from the SSG. All other ports and addresses return different data.