From 6588398ce6fab85e287b10c2781d3797d7639cb9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 15 Sep 2010 22:00:20 +0000 Subject: MIDI: Send a reset MIDI device signal on startup. This is currently done in the engine code. I adapted AGI, AGOS, DRACI, GROOVIE, LURE, MADE, QUEEN, SAGA, SKY, TINSEL and TOUCHE to send a reset device on startup. The sound output still works fine (started up a game from every engine), so this should hopefully not introduce any regressions. As far as I can tell it seems that SCUMM does send a proper device reset, so I did not touch it. KYRA only sends a proper reset for MT-32 currently. I am not sure about SCI though. This fixes bug #3066826 "SIMON: MIDI notes off when using RTL after SCI". svn-id: r52736 --- engines/draci/music.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'engines/draci/music.cpp') diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 8186d36068..509bf90121 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -40,13 +40,8 @@ MusicPlayer::MusicPlayer(MidiDriver *driver, const char *pathMask) : _parser(0), memset(_channel, 0, sizeof(_channel)); memset(_channelVolume, 255, sizeof(_channelVolume)); _masterVolume = 0; - this->open(); _smfParser = MidiParser::createParser_SMF(); _midiMusicData = NULL; - - // TODO: Load cmf.ins with the instrument table. It seems that an - // interface for such an operation is supported for AdLib. Maybe for - // this card, setting instruments is necessary. } MusicPlayer::~MusicPlayer() { @@ -89,6 +84,15 @@ int MusicPlayer::open() { if (ret) return ret; + if (_nativeMT32) + _driver->sendMT32Reset(); + else + _driver->sendGMReset(); + + // TODO: Load cmf.ins with the instrument table. It seems that an + // interface for such an operation is supported for AdLib. Maybe for + // this card, setting instruments is necessary. + _driver->setTimerCallback(this, &onTimer); return 0; } -- cgit v1.2.3 From b2c57117fd0749f0c39dbe6b9de65d2c0566ea1d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 15 Sep 2010 22:30:00 +0000 Subject: DRACI: Initialize MIDI channel volume properly. This fixes bug #3067148 "DRACI: Volume range not respected". It seems Draci's MIDI files do not setup the channel volume properly before using the channels, but rely on having the maxed out. Since formerly the channel volume was initialized to 255, it caused the channel volume to be zero in case the user used 128 for his volume settings (128*255/255=128, and MIDI volume goes from 0-127). svn-id: r52738 --- engines/draci/music.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/draci/music.cpp') diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 509bf90121..95b7ae08da 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -38,7 +38,7 @@ namespace Draci { MusicPlayer::MusicPlayer(MidiDriver *driver, const char *pathMask) : _parser(0), _driver(driver), _pathMask(pathMask), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false), _track(-1) { memset(_channel, 0, sizeof(_channel)); - memset(_channelVolume, 255, sizeof(_channelVolume)); + memset(_channelVolume, 127, sizeof(_channelVolume)); _masterVolume = 0; _smfParser = MidiParser::createParser_SMF(); _midiMusicData = NULL; -- cgit v1.2.3