aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound_adlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/sound_adlib.cpp')
-rw-r--r--engines/kyra/sound_adlib.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index 62551d2b09..32b09ecd2d 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -2303,11 +2303,23 @@ void SoundAdlibPC::play(uint8 track) {
if ((soundId == 0xFFFF && _v2) || (soundId == 0xFF && !_v2) || !_soundDataPtr)
return;
+ // HACK: Since we might call this when the engines is paused (on game load via GMM)
+ // we must unpause the engine here, so this will work properly
+
+ int pauseCount = 0;
+ while (_vm->isPaused()) {
+ ++pauseCount;
+ _vm->pauseEngine(false);
+ }
+
while ((_driver->callback(16, 0) & 8)) {
// We call the system delay and not the game delay to avoid concurrency issues.
_vm->_system->delayMillis(10);
}
+ while (pauseCount--)
+ _vm->pauseEngine(true);
+
if (_sfxPlayingSound != -1) {
// Restore the sounds's normal values.
_driver->callback(10, _sfxPlayingSound, int(1), int(_sfxPriority));