From f35fafa52569abac058ffb1f7f2e2806919c43eb Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 15 Oct 2016 17:54:45 -0500 Subject: SCI32: Fix kPalVary(SetVary) in SCI2.1early games Game scripts pass an extra argument which is never used in SSCI. This happens e.g. when warping from room 620 to room 860 in LSL6hires. Adding a signature for kPalVarySetVary for SCI2.1early games only does not work because KQ7 1.51 is detected as SCI2.1early but the interpreter includes kPalVary code that matches SCI2.1mid. Fixes Trac#9611. --- engines/sci/engine/kernel_tables.h | 2 +- engines/sci/engine/kgraphics32.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 0f1210e0e1..09f9beeca9 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -278,7 +278,7 @@ static const SciKernelMapSubEntry kPalVary_subops[] = { { SIG_SCI16, 5, MAP_CALL(PalVaryChangeTicks), "i", NULL }, { SIG_SCI16, 6, MAP_CALL(PalVaryPauseResume), "i", NULL }, #ifdef ENABLE_SCI32 - { SIG_SCI32, 0, MAP_CALL(PalVarySetVary), "i(i)(i)(ii)", NULL }, + { SIG_SCI32, 0, MAP_CALL(PalVarySetVary), "i(i)(i)(i)(i)", NULL }, { SIG_SCI32, 1, MAP_CALL(PalVarySetPercent), "(i)(i)", kPalVarySetPercent_workarounds }, { SIG_SCI32, 2, MAP_CALL(PalVaryGetPercent), "", NULL }, { SIG_SCI32, 3, MAP_CALL(PalVaryOff), "", NULL }, diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index e5b8da4620..039373c387 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -972,7 +972,9 @@ reg_t kPalVarySetVary(EngineState *s, int argc, reg_t *argv) { int16 fromColor; int16 toColor; - if (argc > 4) { + if ((getSciVersion() >= SCI_VERSION_2_1_MIDDLE || g_sci->getGameId() == GID_KQ7) + && argc > 4) { + fromColor = argv[3].toSint16(); toColor = argv[4].toSint16(); } else { -- cgit v1.2.3