Common searches

First post, by guest

User metadata

I am able to capture OPL commands successfully but now I need information on how to parse the data captured. Where or who can I find information on this? I already have documentation on OPL2, I just need to know how to interpret the .DRO files recorded for the registers and values that were written, and any sort of timestamping information. Thanks.

Reply 1 of 3, by Harekiet

User metadata
Rank DOSBox Author
DOSBox Author

static Bit8u dro_header[]={
'D','B','R','A', /* 0x00, Bit32u ID */
'W','O','P','L', /* 0x04, Bit32u ID */
0x0,0x00, /* 0x08, Bit16u version low */
0x1,0x00, /* 0x09, Bit16u version high */
0x0,0x0,0x0,0x0, /* 0x0c, Bit32u total milliseconds */
0x0,0x0,0x0,0x0, /* 0x10, Bit32u total data */
0x0,0x0,0x0,0x0 /* 0x14, Bit32u Type 0=opl2,1=opl3,2=dual-opl2 */
/* Commands
0x00 Bit8u, millisecond delay+1
0x02 none, Use the low index/data pair
0x03 none, Use the high index/data pair
0x10 Bit16u, millisecond delay+1
0xxx Bit8u, send command and data to current index/data pair

Reply 2 of 3, by guest

User metadata

Thanks. I tried it out on the first few bytes of the file I recorded, it basically works but I'm running into slight confusion with your description of commands "0x02" and "0x03". I assume they only apply for OPL3 or dual-OPL2?

Because there also exists OPL registers 02 and 03 (timers), and in particular in the file I recorded, the commands started off as

01 20 02 FF 04 21 20 21

01 20 makes sense, but if I interpret 02 to be "use lower pair", then I get FF 04 for the next byte, and there's no such thing as register FF. 02 FF does make sense though as a write to the 80us timer reg.

Reply 3 of 3, by Harekiet

User metadata
Rank DOSBox Author
DOSBox Author

The timer command data doesn't get saved since they have no meaning in the raw opl data. If you encounter a 0x2 in the stream all the following command/data pairs will have to be sent to the first opl controller and if you have encounter a 0x3 to the second opl controller.This is used for dual opl2 and opl3 recording. And 0x4 is a valid command port in opl3 since it will enable/disable opl3 support when written to the second controller. Check http://www.fee.vutbr.cz/~arnost/opl/opl3.html#reg004