Okay so channel mask starts out as zero, which is where the fun relevant to this thread's entire purpose begins.
Device types are listed in
Sound.h, line 31-56:
enum class DeviceType
{
// SCI0 - these can be OR'd together
RolandMT32 = 0x01,
YamahaFB01 = 0x02,
Adlib = 0x04,
Casio = 0x08,
Tandy1000 = 0x10,
PCSpeaker = 0x20,
AmigaMac = 0x40,
NewGM = 0x80,
// SCI1 - these cannot.
SCI1_Adlib = 0x00,
SCI1_GM = 0x07,
SCI1_GameBlaster = 0x09,
SCI1_RolandGM = 0x0c,
SCI1_PCSpeaker = 0x12,
SCI1_Tandy = 0x13,
SCI1_AmigaMac = 0x06,
SCI1_Unknown08 = 0x08,
SCI1_Unkonwn0b = 0x0b,
// Not really a device
Digital = 0xff
};
So if you have a track in the song set to play
only on AdLib, that's device type 0x04. Channel mask starts as zero, which is then bitwise-OR'd to include that 4, but shifted over one byte, to make 0x0400. Should a track be set to play on multiple devices, like the MT-32 and PC Speaker, it'll get 0x04000 (AdLib) OR 0x0100 (MT-32) OR 0x2000 (PC Speaker) = 0x2500.
I looked at the DeviceType enum and there only seems to be two relevant adlib types, SCI1_Adlib and Adlib. Is that << shift messing things up when SCI1_Adlib is used?
That's where you read it wrong. SCI0 and SCI1 have different functions to save, load, and handle music, and the SCI0 paths will
only use
RolandMT32 through
NewGM, plus
Digital even though we can't do much with that one. The SCI1 functions
only use the
SCI1_ devicetypes.
So it's not so much mistakenly mixing
SCI1_Adlib (0x00) and SCI0
Adlib (0x04). It just
doesn't completely fill in the channel mask, leaving the part where it says how many voices to use zero, which the original
ADL.DRV takes at face value.