From b8bec0aaa02975c7dbd1587c0175ec3d1b68a65f Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 4 Jul 2015 21:37:24 +0200 Subject: 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 --- engines/tinsel/music.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/tinsel/music.cpp') 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 -- cgit v1.2.3