TINSEL: DW1: Miles Audio AdLib MIDPAK.AD support

- added support for MIDPAK.AD timbre files on top
FAT.OPL. FAT.OPL gets copied by installer into MIDPAK.AD for this version
- changed order of timbre file checking
- adjusted and improved comments about discworld 1 versions
This commit is contained in:
Martin Kiewitz 2015-07-04 22:20:34 +02:00
parent 9745c97df8
commit 3f31b5ba64

View File

@ -384,20 +384,39 @@ MidiMusicPlayer::MidiMusicPlayer(TinselEngine *vm) {
// Discworld 1 uses Miles Audio 3
// use our own Miles Audio drivers
//
// DW1 has either drivers/sample.ad and drivers/sample.opl, but no sample.mt
// or fat.opl (although this version has it outside of the main game directory inside /drivers)
// It seems that there are multiple versions of Discworld 1
//
// Version 1:
// Has SAMPLE.AD for AdLib and SAMPLE.OPL for OPL-3
// Timbre files are inside a subdirectory of the CD called "/drivers". Main game files are in
// another subdirectory, which means the user has to copy those files over.
// Installer script copies all drivers directly to harddrive without name changes
//
// Version 2:
// Has FAT.OPL only (gets copied by the installer into MIDPAK.AD or MIDPAK.OPL)
// Timbre file is inside subdirectory "drivers" right in the main game directory.
// Installer copies FAT.OPL to MIDPAK.AD all the time, even when user selected AWE32
//
// Neither have timbre data for MT32
::MidiDriver::DeviceHandle dev = ::MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
::MusicType musicType = ::MidiDriver::getMusicType(dev);
Common::File fileClass;
switch (musicType) {
case MT_ADLIB:
if ((fileClass.exists("SAMPLE.AD")) || (fileClass.exists("SAMPLE.OPL"))) {
// Variant 1: drivers/sample.ad or drivers/sample.opl exists
_driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.OPL");
} else {
// Try variant 2: fat.opl should at least exist
if (fileClass.exists("FAT.OPL")) {
// Version 2: fat.opl, may be in drivers-subdirectory
_driver = Audio::MidiDriver_Miles_AdLib_create("", "FAT.OPL");
} else {
if (fileClass.exists("MIDPAK.AD")) {
// Version 2: drivers got installed and fat.opl got copied over by the user
_driver = Audio::MidiDriver_Miles_AdLib_create("MIDPAK.AD", "");
} else {
// Version 1: sample.ad / sample.opl, have to be copied over by the user for this version
// That's why we check those last, because then the user gets a proper error message for them
_driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.OPL");
}
}
break;
case MT_MT32: