aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2016-11-25 22:03:30 -0600
committerColin Snover2016-12-03 12:21:54 -0600
commitbf293fface3d2eaf62466dca675c65118f347248 (patch)
tree8e1ee113059e548a68d55a899f97f6bf7854c020 /engines
parent68023904a4c4138cdd87e8f86ebddb19be802309 (diff)
downloadscummvm-rg350-bf293fface3d2eaf62466dca675c65118f347248.tar.gz
scummvm-rg350-bf293fface3d2eaf62466dca675c65118f347248.tar.bz2
scummvm-rg350-bf293fface3d2eaf62466dca675c65118f347248.zip
SCI: Fix non-responsive application warning during sysex transfers
This also fixes the display of the startup LCD message, which had been delayed until after the sysex transfer was finished.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sci.cpp13
-rw-r--r--engines/sci/sound/drivers/midi.cpp4
2 files changed, 11 insertions, 6 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 1e3ab2ae34..d725e36a5a 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -317,10 +317,6 @@ Common::Error SciEngine::run() {
// Must be called after game_init(), as they use _features
_kernel->loadKernelNames(_features);
- _soundCmd = new SoundCommandParser(_resMan, segMan, _kernel, _audio, _features->detectDoSoundType());
-
- syncSoundSettings();
- syncIngameAudioOptions();
// Load our Mac executable here for icon bar palettes and high-res fonts
loadMacExecutable();
@@ -328,6 +324,15 @@ Common::Error SciEngine::run() {
// Initialize all graphics related subsystems
initGraphics();
+ // Sound must be initialized after graphics because SysEx transfers at the
+ // start of the game must pump the event loop to avoid making the OS think
+ // that ScummVM is hanged, and pumping the event loop requires GfxCursor to
+ // be initialized
+ _soundCmd = new SoundCommandParser(_resMan, segMan, _kernel, _audio, _features->detectDoSoundType());
+
+ syncSoundSettings();
+ syncIngameAudioOptions();
+
// Patch in our save/restore code, so that dialogs are replaced
patchGameSaveRestore();
setLauncherLanguage();
diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index 5e82e4a729..badbe663ca 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -1053,7 +1053,7 @@ int MidiPlayer_Midi::open(ResourceManager *resMan) {
void MidiPlayer_Midi::close() {
if (_isMt32) {
// Send goodbye message
- sendMt32SysEx(0x200000, _goodbyeMsg, 20);
+ sendMt32SysEx(0x200000, _goodbyeMsg, 20, true);
}
_driver->close();
@@ -1069,8 +1069,8 @@ void MidiPlayer_Midi::sysEx(const byte *msg, uint16 length) {
if (_isMt32)
delay += 40;
- g_system->delayMillis(delay);
g_system->updateScreen();
+ g_sci->sleep(delay);
}
byte MidiPlayer_Midi::getPlayId() const {