VGM Basics
VGM is not rendered audio like WAV. It is closer to a log of chip commands plus timing.
Mental Model
- A tool creates chip music data.
- A VGM file stores chip writes and wait commands.
- A player reads the VGM commands in order.
- The player writes registers to a YM2612 emulator.
- The emulator generates audio samples.
Why This Matters for YM2612
YM2612 is controlled by register writes, so VGM fits it naturally. A YM2612 VGM player is basically automating the same kind of writes as a beep example, but with stored timing and metadata.
First Header Fields to Care About
0x08: version0x18: total number of samples0x1C: loop offset0x20: loop number of samples0x2C: YM2612 clock0x34: VGM data offset
Most Important YM2612 Commands
0x52 aa dd write dd to YM2612 port 0 register aa 0x53 aa dd write dd to YM2612 port 1 register aa 0x61 nn nn wait n samples 0x62 wait 735 samples 0x63 wait 882 samples 0x66 end of sound data
DAC / PCM Related Commands
0x67: data block0x68: PCM RAM write0x80-0x8f: DAC write + wait0x90-0x95: DAC stream control0xe0: data bank seek