aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2012-06-24 19:52:37 +0300
committerFilippos Karapetis2012-06-24 19:55:28 +0300
commit99de89c974fc24bf58b034842750e522d7d441d4 (patch)
tree5f152740b7207fa5e1480d16beeefd531e9ddb75 /engines/sci
parent478fd0ed2957a766df2860c66fa476aa3665fc8f (diff)
downloadscummvm-rg350-99de89c974fc24bf58b034842750e522d7d441d4.tar.gz
scummvm-rg350-99de89c974fc24bf58b034842750e522d7d441d4.tar.bz2
scummvm-rg350-99de89c974fc24bf58b034842750e522d7d441d4.zip
SCI: Add a workaround for script bug #3537232
The bug in question is "SCI: SQ4 Floppy DOS title screen skipping too quickly", and is caused by game scripts not waiting between palette calls
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kgraphics.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 0ef268f108..ec8e0dbf1b 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -645,6 +645,20 @@ reg_t kPaletteAnimate(EngineState *s, int argc, reg_t *argv) {
if (paletteChanged)
g_sci->_gfxPalette->kernelAnimateSet();
+ // WORKAROUND: The game scripts in SQ4 floppy count the number of elapsed
+ // cycles in the intro from the number of successive kAnimate calls during
+ // the palette cycling effect, while showing the SQ4 logo. This worked in
+ // older computers because each animate call took awhile to complete.
+ // Normally, such scripts are handled automatically by our speed throttler,
+ // however in this case there are no calls to kGameIsRestarting (where the
+ // speed throttler gets called) between the different palette animation calls.
+ // Thus, we add a small delay between each animate call to make the whole
+ // palette animation effect slower and visible, and not have the logo screen
+ // get skipped because the scripts don't wait between animation steps. Fixes
+ // bug #3537232.
+ if (g_sci->getGameId() == GID_SQ4 && !g_sci->isCD() && s->currentRoomNumber() == 1)
+ g_sci->sleep(10);
+
return s->r_acc;
}