RAW Format (Adlib)

From ModdingWiki
Jump to navigation Jump to search
RAW Format (Adlib)
Format typeMusic
Notation typeOPL
InstrumentsOPL
Max channel count9 or 11 (OPL2), 18 or 22 (Dual OPL2 and OPL3)
Max track count1
Max pattern countUnknown
Max order countUnknown
Tags?Unknown
GamesNone

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 type Name Description
BYTE[8] cSignature "RAWADATA" (not NULL-terminated)
UINT16LE iClock Initial clock speed (can be changed during playback)
BYTE[] cOPLData Song data (see below)
UINT16LE iEOF 0xFFFF 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 value Purpose
0x00 Delay. The data byte is the number of cycles to delay by.
0x02 Control data (see below)

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

Control type Purpose
0x00 Clock change. The following UINT16LE is the new clock speed.
0x01 Switch to "low" OPL chip (#0)
0x02 Switch to "high" OPL chip (#1)

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

The following tools are able to work with files in this format.

Name PlatformPlay? Create new? Modify? Convert/export to other? Import from other? Access hidden data? Edit metadata? Notes
AdPlug Windows/Linux/DOSYesYesNoNoYes; manyN/AView Can convert all supported files into .raw
Camoto Linux/WinYesYesNoYes; manyYes; manyN/AYes
RAC DOSNoYesNoNoNoN/ANo The original DOS TSR used for capturing game music

Similar formats