DRO

DOSBox Raw OPL or DRO is the format used by DOSBox to capture OPL output. The format uses a clear header but went through two incompatible versions. The first version was used up to DOSBox 0.72, the second version replaced it starting with DOSBox 0.73.

Technical information

All numerical values are little-endian.

OffsetSizeDescription
0char[8]Signature (must be DBRAWOPL)
8uint16First version word
10uint16Second version word

Version number identification is complicated by the fact the version words aren't read in the same order depending on the specifications. In the 1.0 version of the format, the minor version number comes first, and the major version number is the second word. So for version 1.0, the value is 00 00 01 00. However, version 2.0 of the specifications reverse the order, so for version 2.0, the value is 02 00 00 00. For this reason, the 1.0 version also became known as version 0.1.

Note: Some files using the old version format contain large garbage values in the minor version word. ZDoom will refuse to read them. You will need to set the minor version to 00 00 with a hex editor.

Delay values are indicated in milliseconds - 1. Since a delay of 0 is deemed to be useless, the byte value is increased by one to get the actual delay.

The header is then followed by a subheader. The two different formats have completely different subheaders.

Format 1.0

SizeDescription
12uint32Song length (in millisecond)
16uint32Song data size (in bytes)
20uint8Hardware type (0: OPL2, 1: OPL3, 2: Dual OPL2)
21byte[3]Optional null padding (may not be present: if non-null, these bytes are song data)

Format 2.0

SizeDescription
12uint32Song data size (in pairs of bytes)
16uint32Song data length (in milliseconds)
20uint8Hardware type (0: OPL2, 1: Dual OPL2, 2: OPL3)
21uint8Data format (ZDoom only supports data format 0)
22uint8Compression method (ZDoom only supports compression 0, meaning no compression)
23uint8Short delay code (command value used to introduce a one-byte delay, should always be 122)
24uint8Long delay code (command value used to introduce a one-byte delay multiplied by 256, should always be 123)
25uint8Codemap table size (must be 126 or less, technically should always be 122)
26uint8*Codemap table (associate OPL registers with index values)

The standard codemap looks like this:

IndexRegisterIndexRegisterIndexRegisterIndexRegisterIndexRegisterIndexRegisterIndexRegisterIndexRegister
0011042053084BD520640760
8809E0102111411261138114E11522
16421762188219E22023214322632383
24E3252426442764288429E430253145
3265338534E5352836483768388839E8
402941494269438944E9452A464A476A
488A49EA502B514B526B538B54EB552C
564C576C588C59EC602D614D626D638D
64ED653066506770689069F070317151
7271739174F1753276527772789279F2
803381538273839384F3853486548774
889489F4903591559275939594F595A0
96B097C098A199B1100C1101A2102B2103C2
104A3105B3106C3107A4108B4109C4110A5111B5
112C5113A6114B6115C6116A7117B7118C7119A8
120B8121C8122short delay123long delay
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.