aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/sound_midi.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-13 03:57:44 +0000
committerJohannes Schickel2010-10-13 03:57:44 +0000
commit75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch)
treef29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/agi/sound_midi.cpp
parent48ee83b88957dab86bc763e9ef21a70179fa8679 (diff)
parente9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff)
downloadscummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend changes into the branch. I suppose the gp2x backend and probably all new backends, i.e. gph, dingux etc., might not compile anymore. Since I have no way of testing those it would be nice if porters could look into getting those up to speed in this branch. svn-id: r53399
Diffstat (limited to 'engines/agi/sound_midi.cpp')
-rw-r--r--engines/agi/sound_midi.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index 57c5d54b27..0c8b3fa36a 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -74,8 +74,15 @@ SoundGenMIDI::SoundGenMIDI(AgiEngine *vm, Audio::Mixer *pMixer) : SoundGen(vm, p
DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB);
_driver = MidiDriver::createMidi(dev);
+ if (ConfMan.getBool("native_mt32") || MidiDriver::getMusicType(dev) == MT_MT32) {
+ _nativeMT32 = true;
+ _driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+ } else {
+ _nativeMT32 = false;
+ }
+
memset(_channel, 0, sizeof(_channel));
- memset(_channelVolume, 255, sizeof(_channelVolume));
+ memset(_channelVolume, 127, sizeof(_channelVolume));
_masterVolume = 0;
this->open();
_smfParser = MidiParser::createParser_SMF();
@@ -121,6 +128,12 @@ int SoundGenMIDI::open() {
return ret;
_driver->setTimerCallback(this, &onTimer);
+
+ if (_nativeMT32)
+ _driver->sendMT32Reset();
+ else
+ _driver->sendGMReset();
+
return 0;
}