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/saga/music.cpp | 13 +++++++++++++ engines/saga/music.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'engines/saga') diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index e4a16e27da..eb79132495 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -60,6 +60,19 @@ MusicDriver::~MusicDriver() { delete _driver; } +int MusicDriver::open() { + int retValue = _driver->open(); + if (retValue) + return retValue; + + if (_nativeMT32) + _driver->sendMT32Reset(); + else + _driver->sendGMReset(); + + return 0; +} + void MusicDriver::setVolume(int volume) { volume = CLIP(volume, 0, 255); diff --git a/engines/saga/music.h b/engines/saga/music.h index 5cce3d4c04..e3d5723145 100644 --- a/engines/saga/music.h +++ b/engines/saga/music.h @@ -57,7 +57,7 @@ public: void setGM(bool isGM) { _isGM = isGM; } //MidiDriver interface implementation - int open() { return _driver->open(); } + int open(); void close() { _driver->close(); } void send(uint32 b); -- cgit v1.2.3