RAW Format (Adlib)

From ModdingWiki

Jump to: navigation, search
Edge of map!

The Rdos Raw OPL Capture format is used for storing captured OPL data from a game. The data was originally produced by the RAC utility, which ran as a TSR behind the game having its music captured.

File format

The file can be described in the following structure:

Data typeNameDescription
BYTE[8]cSignature"RAWADATA" (not NULL-terminated)
UINT16LEiClockInitial clock speed (can be changed during playback)
BYTE[]cOPLDataSong data (see below)
UINT16LEiEOF0xFFFF to indicate end of song

The first byte in the song data will be the register data, followed by the OPL register where the data should be sent (i.e. in the opposite order to IMF and DRO.) The OPL register can also be one of these control values:

Register valuePurpose
0x00Delay. The data byte is the number of cycles to delay by.
0x02Control data (see below)

If the register is 0x02, the data byte is the "control type" as shown below.

Control typePurpose
0x00Clock change. The following UINT16LE is the new clock speed.
0x01Switch to "low" OPL chip (#0) (docs say "OPL3 port A" - is this the same?)
0x02Switch to "high" OPL chip (#1) (docs say "OPL3 port B" - is this the same?)

To convert the clock speed to a Hertz measurement (Hertz is cycles per second, and the delays are in units of one cycle), use this formula:

iHertz = 1193180.0 / iClockSpeed

Tools

  • RAC - The original DOS TSR used for capturing game music

Similar formats

  • The DOSBox DRO Format has pretty much replaced the RAW format (apparently the DOSBox OPL capture interface was implemented by Rdos too.)
  • The id Software Music Format (IMF) stores Adlib data in a similar manner in order to provide background music in many Apogee games.
Personal tools
programming