OpenXcom Forum

Contributions => Programming => Topic started by: mewse on April 07, 2011, 01:53:42 am

Title: opl emulation for music
Post by: mewse on April 07, 2011, 01:53:42 am
I've been looking into whether we can get opl2/adlib music going, unfortunately I think I've hit my limit. I started with the information that fraggle provided about putting OPL emulation into chocolate doom:

https://www.chocolate-doom.org/wiki/index.php/Opl-branch

One of the main things he did was produce a DRO (Dosbox Raw OPL) file from dosbox to analyze how the original doom executable wrote to the OPL registers.

So I ran dosbox and captured some OPL from the intro music, and then compared what I was looking at in the hex editor to the files stored in AINTRO.CAT, and I am completely baffled by the file format inside AINTRO.CAT.

The DRO format is well documented:

https://www.shikadi.net/moddingwiki/DRO_Format

And the CAT format is understood, but it is the adlib data files stored inside the CAT that aren't making any sense right now.

The DRO:
(https://i.imgur.com/E1nNN.png)

The first file stored in AINTRO.CAT:
(https://i.imgur.com/Pyh88.png)

If I was way better at assembly language I would start tracing how the DOS program is interpreting aintro.cat but my skills are weak :(
Title: Re: opl emulation for music
Post by: SupSuper on April 07, 2011, 12:33:14 pm
You're looking in the wrong file, ADLIB.CAT is the file that contains the Adlib music:

(https://i6.photobucket.com/albums/y237/supsuper/th_intro1.png) (https://i6.photobucket.com/albums/y237/supsuper/intro1.png)

The *INTRO.CAT files are just sound effects if I'm not mistaken. This might also be of use: https://www.shipbrook.com/jeff/sb.html
Title: Re: opl emulation for music
Post by: mewse on April 07, 2011, 08:43:23 pm
The *INTRO.CAT files are just sound effects if I'm not mistaken.

Bleh. It's a 1.2 thing, from ufopaedia: "DOS 1.2 - for some reason music for intro is stored in separate file"

aintro.cat is adlib, rintro.cat is roland, intro.cat is sound data.

Anyway if your compare the section you highlighted with what I was looking at in aintro.cat, the format looks the same, both start with 5A 09, the data looks a bit different tho.
Title: Re: opl emulation for music
Post by: mewse on April 07, 2011, 09:19:57 pm
I took that section you have highlighted (minus the name of course) and copied it to a bunch of different files with every file extension that adplug supports. Then I tried to load them into foobar2000 with adplug, and none of them would play. It seems that we're dealing with an unknown format.
Title: Re: opl emulation for music
Post by: Volutar on May 13, 2013, 07:32:29 pm
It's not very difficult format. Something like cmf.