diff options
-rw-r--r-- | engines/agos/drivers/accolade/mt32.cpp | 18 | ||||
-rw-r--r-- | engines/agos/midi.cpp | 17 |
2 files changed, 25 insertions, 10 deletions
diff --git a/engines/agos/drivers/accolade/mt32.cpp b/engines/agos/drivers/accolade/mt32.cpp index 630198fc86..f863ffba4c 100644 --- a/engines/agos/drivers/accolade/mt32.cpp +++ b/engines/agos/drivers/accolade/mt32.cpp @@ -23,6 +23,8 @@ #include "agos/agos.h" #include "agos/drivers/accolade/mididriver.h" +#include "audio/mididrv.h" + #include "common/config-manager.h" #include "common/file.h" #include "common/mutex.h" @@ -69,7 +71,7 @@ public: protected: Common::Mutex _mutex; MidiDriver *_driver; - bool _MT32; + bool _nativeMT32; // native MT32, may also be our MUNT, or MUNT over MIDI bool _isOpen; int _baseFreq; @@ -87,7 +89,7 @@ public: MidiDriver_Accolade_MT32::MidiDriver_Accolade_MT32() { _driver = NULL; _isOpen = false; - _MT32 = false; + _nativeMT32 = false; _baseFreq = 250; memset(_channelMapping, 0, sizeof(_channelMapping)); @@ -113,13 +115,14 @@ int MidiDriver_Accolade_MT32::open() { MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_PREFER_MT32); MusicType musicType = MidiDriver::getMusicType(dev); + // check, if we got a real MT32 (or MUNT, or MUNT over MIDI) switch (musicType) { case MT_MT32: - _MT32 = true; + _nativeMT32 = true; break; case MT_GM: if (ConfMan.getBool("native_mt32")) { - _MT32 = true; + _nativeMT32 = true; } break; default: @@ -134,7 +137,7 @@ int MidiDriver_Accolade_MT32::open() { if (ret) return ret; - if (_MT32) + if (_nativeMT32) _driver->sendMT32Reset(); else _driver->sendGMReset(); @@ -170,6 +173,11 @@ void MidiDriver_Accolade_MT32::send(uint32 b) { // Figure out the requested instrument byte midiInstrument = (b >> 8) & 0xFF; byte mappedInstrument = _instrumentMapping[midiInstrument]; + + // If there is no actual MT32 (or MUNT), we make a second mapping to General MIDI instruments + if (!_nativeMT32) { + mappedInstrument = (MidiDriver::_mt32ToGm[mappedInstrument]); + } // And replace it b = (b & 0xFFFF00FF) | (mappedInstrument << 8); } diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index 83c15fee45..604824777e 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -29,6 +29,8 @@ #include "agos/drivers/accolade/mididriver.h" +#include "gui/message.h" + namespace AGOS { @@ -114,12 +116,17 @@ int MidiPlayer::open(int gameType, bool isDemo) { case MT_MT32: break; case MT_GM: - if (ConfMan.getBool("native_mt32")) { - // Real MT32 - accoladeMusicType = MT_MT32; - } else { - _accoladeMode = false; + if (!ConfMan.getBool("native_mt32")) { + // Not a real MT32 / no MUNT + ::GUI::MessageDialog dialog(("You appear to be using a General MIDI device,\n" + "but your game only supports Roland MT32 MIDI.\n" + "We try to map the Roland MT32 instruments to\n" + "General MIDI ones. It is still possible that\n" + "some tracks sound incorrect.")); + dialog.runModal(); } + // Switch to MT32 driver in any case + accoladeMusicType = MT_MT32; break; default: _accoladeMode = false; |