DAC stream control (version 1.60) streams data from a
data block to a chip register, without a
write command for every sample. Set a stream up with 90, give it a data bank
with 91 and a frequency with 92, then start, change or stop it with
93, 94 and 95. Stream ID FF is reserved and
ignored unless noted.
Commands
| Command | Operands | Meaning |
|---|---|---|
| 90 | ss tt pp cc | Set up the stream. |
| 91 | ss dd ll bb | Set the data bank. |
| 92 | ss ff ff ff ff | Set the frequency in hertz. |
| 93 | ss aa aa aa aa mm ll ll ll ll | Start the stream. |
| 94 | ss | Stop the stream. FF stops all streams. |
| 95 | ss bb bb ff | Fast start. |
How to use a stream
The specification gives four steps: set the stream up (chip type and the command to write: this activates the stream), set its data bank, set its frequency, and then start it, change its frequency, start it again, stop it and so on. Stream ID FF is reserved and ignored unless noted. The DAC stream control can be used with almost all chips, not only the YM2612 and PWM, which makes it easy for a tool that logs a stream of samples to write them. Command data size counts the chip’s own unit (1 for the YM2612, 2 for the PWM), not bytes.
The explorer reads every stream command, and for each one shows which chip, data bank and block it refers to (the Data blocks tab’s “DAC stream commands” table). It also plays the streams: each one sends its bytes to the chip it drives at its own rate, one write at a time, for the chips the viewer plays.
Set up (90)
| Operand | Meaning |
|---|---|
| ss | Stream ID. |
| tt | Chip type. Bit 7 selects the second chip. |
| pp cc | Port and register or command. For channel-select chips (the RF5C family, HuC6280), pp is the channel, and cc holds the channel register and the data register, one in each nibble. pp of FF skips the channel-select write. |
Set data bank (91)
| Operand | Meaning |
|---|---|
| ss | Stream ID. |
| dd | Data bank ID, block types 00–3F. |
| ll | Step size, usually 1, or 2 for interleaved streams. |
| bb | Step base, added to the start offset: usually 0, or 0 and 1 for interleaved left and right streams. |
Step values count command data units, not bytes.
Start (93)
| Operand | Meaning |
|---|---|
| ss | Stream ID. |
| aa aa aa aa | Data start offset in the bank. FFFFFFFF means ignore it. |
| mm | Length mode: 00 ignore (change position only), 01 length in commands, 02 length in milliseconds, 03 play until the end. Bit 4 enables reverse. Bit 7 enables loop. |
| ll ll ll ll | Data length. |
Fast start (95)
| Operand | Meaning |
|---|---|
| ss | Stream ID. |
| bb bb | Block ID: the data block’s number within the bank set by 91. |
| ff | Flags: bit 0 loop, bit 4 reverse. |
Chip IDs
Chip IDs follow the order of the clock fields in the
header. The specification states only the
example YM2612 = 02 (“see clock-order in header”). libvgm numbers its chips
in the same order (_DEV_LIST and _CHIPCLK_OFS in
vgmplayer.cpp), and every row of this table was compared with it. The extra
header’s chip clock and chip volume lists use the same numbers.
| ID | Chip | ID | Chip |
|---|---|---|---|
| 00 | SN76489 | 15 | MultiPCM |
| 01 | YM2413 | 16 | uPD7759 |
| 02 | YM2612 | 17 | OKIM6258 |
| 03 | YM2151 | 18 | OKIM6295 |
| 04 | Sega PCM | 19 | K051649 |
| 05 | RF5C68 | 1A | K054539 |
| 06 | YM2203 | 1B | HuC6280 |
| 07 | YM2608 | 1C | C140 |
| 08 | YM2610 | 1D | K053260 |
| 09 | YM3812 | 1E | Pokey |
| 0A | YM3526 | 1F | QSound |
| 0B | Y8950 | 20 | SCSP |
| 0C | YMF262 | 21 | WonderSwan |
| 0D | YMF278B | 22 | VSU |
| 0E | YMF271 | 23 | SAA1099 |
| 0F | YMZ280B | 24 | ES5503 |
| 10 | RF5C164 | 25 | ES5506 |
| 11 | PWM | 26 | X1-010 |
| 12 | AY8910 | 27 | C352 |
| 13 | GameBoy DMG | 28 | GA20 |
| 14 | NES APU | 29 | Mikey (1.72) |
| 2A | K007232 (libvgm) | 2D | MSM5232 (libvgm) |
| 2B | K005289 (libvgm) | 2E | BSMT2000 (libvgm) |
| 2C | MSM5205 (libvgm) | 2F | ICS2115 (libvgm) |
Not described
Known, not yet covered
- Viewer: the streams are shown (each command with its chip, bank and block) and played for the chips the viewer emulates, with the same timing as libvgm’s stream control (checked write by write); a stream aimed at a chip that is not emulated is shown but silent.