aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2009-09-17 16:01:21 +0000
committerJohannes Schickel2009-09-17 16:01:21 +0000
commitd98b1472ca6b9f753116bb365bb471ec29938d0b (patch)
treee0202c6e785da97e3e8bd9272fd4f7d3845f2068 /engines/kyra
parent297a130d5ed37926b3add153dd925b1ce3271a5a (diff)
downloadscummvm-rg350-d98b1472ca6b9f753116bb365bb471ec29938d0b.tar.gz
scummvm-rg350-d98b1472ca6b9f753116bb365bb471ec29938d0b.tar.bz2
scummvm-rg350-d98b1472ca6b9f753116bb365bb471ec29938d0b.zip
Add workaround in "o2_isAnySoundPlaying", which will hopefully make Kyra2 work on the Nintendo DS.
svn-id: r44163
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/script_hof.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index a811952801..c1917bc1d3 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -727,6 +727,20 @@ int KyraEngine_HoF::o2_showItemString(EMCState *script) {
int KyraEngine_HoF::o2_isAnySoundPlaying(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isAnySoundPlaying(%p) ()", (const void *)script);
+
+ // WORKAROUND
+ //
+ // The input script function in the skull scene does busy wait
+ // for the sound effect, which is played after completing the
+ // song, to finish. To avoid too much CPU use, we add some slight
+ // delay here.
+ //
+ // Also the Ninteno DS backend seems only to update the sound, when
+ // either OSystem::updateScreen or OSystem::delayMillis is called.
+ // So we have to call delay here, since otherwise the game would hang.
+ if (_currentScene == 16 && _currentChapter == 1)
+ delay(_tickLength);
+
return _sound->voiceIsPlaying() ? 1 : 0;
}