aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
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 {