diff options
author | Kirben | 2015-07-02 20:30:49 +1000 |
---|---|---|
committer | Kirben | 2015-07-02 20:30:49 +1000 |
commit | 46babcc3c4cd062b2d442435039ea67cff46b61b (patch) | |
tree | 2e33d263535d276f5893276e9178bfd7c44e7d9a /engines/made | |
parent | 905bcc444e79d1eca00907436b3ea8eaba86f6fb (diff) | |
download | scummvm-rg350-46babcc3c4cd062b2d442435039ea67cff46b61b.tar.gz scummvm-rg350-46babcc3c4cd062b2d442435039ea67cff46b61b.tar.bz2 scummvm-rg350-46babcc3c4cd062b2d442435039ea67cff46b61b.zip |
MADE: Add Miles support for RTZ, currently disabled for Adlib due to known issues.
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/music.cpp | 28 | ||||
-rw-r--r-- | engines/made/music.h | 1 |
2 files changed, 27 insertions, 2 deletions
diff --git a/engines/made/music.cpp b/engines/made/music.cpp index b2917b58ed..b11f071a76 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -28,11 +28,30 @@ #include "made/resource.h" #include "audio/midiparser.h" +#include "audio/miles.h" namespace Made { -MusicPlayer::MusicPlayer() : _isGM(false) { - MidiPlayer::createDriver(); +MusicPlayer::MusicPlayer() : _isGM(false),_milesAudioMode(false) { + MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32); + MusicType musicType = MidiDriver::getMusicType(dev); + + switch (musicType) { + case MT_ADLIB: + // Adlib disabled due to known issues + //_milesAudioMode = true; + //_driver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.AD"); + MidiPlayer::createDriver(); + break; + case MT_MT32: + _milesAudioMode = true; + _driver = Audio::MidiDriver_Miles_MT32_create(""); + break; + default: + _milesAudioMode = false; + MidiPlayer::createDriver(); + break; + } int ret = _driver->open(); if (ret == 0) { @@ -46,6 +65,11 @@ MusicPlayer::MusicPlayer() : _isGM(false) { } void MusicPlayer::send(uint32 b) { + if (_milesAudioMode) { + _driver->send(b); + return; + } + if ((b & 0xF0) == 0xC0 && !_isGM && !_nativeMT32) { b = (b & 0xFFFF00FF) | MidiDriver::_mt32ToGm[(b >> 8) & 0xFF] << 8; } diff --git a/engines/made/music.h b/engines/made/music.h index 95d1bd35c1..9c92cd0329 100644 --- a/engines/made/music.h +++ b/engines/made/music.h @@ -51,6 +51,7 @@ public: protected: bool _isGM; + bool _milesAudioMode; }; } // End of namespace Made |