ACIDCAT . FILE FORMAT REFERENCE

S98 Anatomy

NEC PC-98 and kina sound-chip register log
rev 2026.09
magic S98 + version digit
endian little
container own; v1 and v3 differ
samples none; FM and PSG writes

An .s98 is the VGM idea from the Japanese PC scene: every write a program made to its sound chips, with the time between, so a player holding the same chips plays it back. Two versions are in the wild and they put things in different places. v1 is a 32-byte header, a plain-text title right after it, and the dump at the next 128-byte boundary running to the end of the file. v3 adds a device table after the header and a [S98] tag of key=value lines after the dump. The tag offset field is the same in both; where it points tells you which layout you have.

file regions
▸the header and device table0x00 . drawn below

The timer. One sync is numerator / denominator seconds; zero in either field means the default, 10 / 1000, ten milliseconds. This file says 1 / 0: one millisecond per sync.

▸the dumpa byte code . drawn below

One opcode, then operands. 0x00-0x7F is a write: the device is the opcode halved, the port its low bit, and two bytes follow, register and value. 0xFF is one sync. 0xFE is a sync count plus two, as a 7-bit varint, low bits first, bit 7 meaning another byte follows, in every version. 0xFD ends the dump, and in a well-formed file that is where the tag (v3) or the file (v1) begins.

▸the tag[S98] . key=value . drawn below

v3: five bytes of mark, then key=value lines separated by LF, in Shift-JIS unless a utf8= line says otherwise. The keys are free; title, artist, game, year, genre, comment, copyright, s98by and system are the ones players show. v1 has only a title, plain text, NUL-padded, sitting between the header and the dump.

▸identificationS98 + 1 or 3

Three letters and a version digit as text. v2 was defined and never used.