diff options
author | Joost Peters | 2004-01-27 23:05:02 +0000 |
---|---|---|
committer | Joost Peters | 2004-01-27 23:05:02 +0000 |
commit | 63be7c1323061db7f30897886c92b899814e0247 (patch) | |
tree | 27987aa27ce3e80ceb1221ae53fba2d7a2764256 | |
parent | 829df83f79ce9af815ee4c9a208e2404c5ab9903 (diff) | |
download | scummvm-rg350-63be7c1323061db7f30897886c92b899814e0247.tar.gz scummvm-rg350-63be7c1323061db7f30897886c92b899814e0247.tar.bz2 scummvm-rg350-63be7c1323061db7f30897886c92b899814e0247.zip |
Allow using a real MT-32 (can someone with one please test this?)
svn-id: r12641
-rw-r--r-- | queen/music.cpp | 2 | ||||
-rw-r--r-- | queen/music.h | 9 | ||||
-rw-r--r-- | queen/queen.cpp | 6 |
3 files changed, 12 insertions, 5 deletions
diff --git a/queen/music.cpp b/queen/music.cpp index 6ef7145a13..1e4b8e01d4 100644 --- a/queen/music.cpp +++ b/queen/music.cpp @@ -113,7 +113,7 @@ static const byte mt32_to_gm[128] = { _channelVolume[channel] = volume; //volume = volume * _masterVolume / 255; b = (b & 0xFF00FFFF) | (volume << 16); - } else if ((b & 0xF0) == 0xC0) { + } else if ((b & 0xF0) == 0xC0 && !_nativeMT32) { b = (b & 0xFFFF00FF) | mt32_to_gm[(b >> 8) & 0xFF] << 8; } else if ((b & 0xFFF0) == 0x007BB0) { diff --git a/queen/music.h b/queen/music.h index ca167452b8..c3bf135ddd 100644 --- a/queen/music.h +++ b/queen/music.h @@ -35,7 +35,8 @@ class MusicPlayer : public MidiDriver { public: MusicPlayer(MidiDriver *driver, byte *data, uint32 size); ~MusicPlayer(); - + + void hasNativeMT32(bool b) { _nativeMT32 = b; } void playMusic(); void stopMusic(); void setLoop(bool loop) { _looping = loop; } @@ -76,6 +77,7 @@ protected: MidiParser *_parser; MidiChannel *_channel[16]; byte _channelVolume[16]; + bool _nativeMT32; Common::RandomSource _rnd; @@ -97,10 +99,11 @@ class Music { public: Music(MidiDriver *_driver, QueenEngine *vm); ~Music(); + void hasNativeMT32(bool b) { _player->hasNativeMT32(b); } void playSong(uint16 songNum); void queueTuneList(int16 tuneList) { _player->queueTuneList(tuneList); } - void playMusic() { _player->playMusic(); } - void stopSong() { _player->stopMusic(); } + void playMusic() { _player->playMusic(); } + void stopSong() { _player->stopMusic(); } protected: byte *_musicData; diff --git a/queen/queen.cpp b/queen/queen.cpp index 57b9f58849..fd67fbff29 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -352,8 +352,12 @@ void QueenEngine::initialise(void) { MidiDriver *driver = GameDetector::createMidi(GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE)); if (!driver) driver = MidiDriver_ADLIB_create(_mixer); - + else if (ConfMan.getBool("native_mt32")) + driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); + _music = new Music(driver, this); + _music->hasNativeMT32(ConfMan.getBool("native_mt32")); + _sound = Sound::giveSound(_mixer, this, _resource->compression()); _walk = new Walk(this); _saveFileMan = _system->get_savefile_manager(); |