aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorMartin Kiewitz2015-07-04 21:37:24 +0200
committerMartin Kiewitz2015-07-04 21:37:24 +0200
commitb8bec0aaa02975c7dbd1587c0175ec3d1b68a65f (patch)
treeacf45329112c7b32285d414dd612282d9da2289b /engines/tinsel
parent8e470918298bf09a7c18602b6d4a9b22c2753160 (diff)
downloadscummvm-rg350-b8bec0aaa02975c7dbd1587c0175ec3d1b68a65f.tar.gz
scummvm-rg350-b8bec0aaa02975c7dbd1587c0175ec3d1b68a65f.tar.bz2
scummvm-rg350-b8bec0aaa02975c7dbd1587c0175ec3d1b68a65f.zip
TINSEL: DW1: Miles Audio AdLib support for FAT.OPL
eriktorbjorn owns a version of DW1, that only has FAT.OPL and no SAMPLE.AD/SAMPLE.OPL. We check if SAMPLE.AD/.OPL are available, if not we try our luck with FAT.OPL
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/music.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index 80442b230f..7c6706dfa8 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -383,13 +383,22 @@ MidiMusicPlayer::MidiMusicPlayer(TinselEngine *vm) {
if ((vm->getGameId() == GID_DW1) && (milesAudioEnabled)) {
// Discworld 1 uses Miles Audio 3
// use our own Miles Audio drivers
- // DW1 has SAMPLE.AD + SAMPLE.OPL, but no SAMPLE.MT
+ //
+ // 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)
::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:
- _driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.OPL");
+ 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
+ _driver = Audio::MidiDriver_Miles_AdLib_create("", "FAT.OPL");
+ }
break;
case MT_MT32:
// Discworld 1 doesn't have a MT32 timbre file