OPiuM filespec v0.01 by fseidel/cmucc. 12/2016. fseidel@club.cc.cmu.edu Preface: OPiuM is a new sound driver for X68000 designed to be as fast as possible. It uses a logged format similar to VGM, but specifically targeted at the X68000's hardware in order to make file sizes smaller and speed up processing. If you spot any issues with this specification, please contact me. IMPORTANT NOTE: All numbers are BIG ENDIAN. Section A: The OPiuM File Header and Overall Format addr (len) | data | notes | | 0x00 (4) | "OPM\0" | magic string 0x04 (4) | version | 2 MSB = major ver. 2 LSB = minor ver. 0x08 (4) | samp_offset | Should be NULL if no samples are present 0x0c (4) | loop pointer | if loop flag encountered, resume here 0x10 | start of record | register dumps begin here ... | ... | ... samp_offset | sample data header | defined in Sec E some additional notes: All fields are word aligned (2 bytes). The loop pointer is a pointer to the start of the first data block to play after encountering a loop flag. samp_offset points to the sample data block, if present, and NULL otherwise Section B: The OPiuM Record Block Format All offsets are relative to start of current block. offset (len) | data | notes | | 0x00 (1) | block flags | defined in section C 0x01 (1) | update count | number of registers to be set in this block 0x02 (2) | delay time | number of units to wait until next block 0x04 (2) | reg data | there are $update_count of this field ... | ... | ... 0x02+cnt*2 | PCM command block | not present if no PCM in block A reg data packet looks like this: offset | data 0x00 | register data 0x01 | register number Section C: The OPiuM Record Block Flags A flag is set when its respective bit is set to a 1. Setting conflicting flags (i.e. stop & loop) results in undefined behavior. Bits 0-7 are LSB-MSB. 0: stop indicates that playback should stop 1: loop indicates that playback should continue at the loop point from the header 2: delay units 0 for frames, 1 for timer ticks. MUST BE 0 IN THIS VERSION. 7: PCM present indicates that a PCM command block will follow the register data block Section D: The OPiuM PCM Command Block format PCM command block format yet to be designed. Section E: The OPiuM PCM Data Section Header format PCM data block header format yet to be designed. Section F: The OPiuM PCM Data Block format PCM data block format yet to be designed.