SCI32: Fix kSetShowStyle version checks

Fix version checks and divisions table. Now the early SQ6 demos start.

Fix version typo introduced in e23f5fe855
This commit is contained in:
sluicebox 2023-07-18 11:45:03 -07:00
parent c3f6ccfdca
commit 5a9f14cc4e
2 changed files with 13 additions and 3 deletions

View File

@ -399,7 +399,7 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
// KQ7 2.0b uses a mismatched version of the Styler script (SCI2.1early script
// for SCI2.1mid engine), so the calls it makes to kSetShowStyle are wrong and
// put `divisions` where `pFadeArray` is supposed to be.
if (getSciVersion() <= SCI_VERSION_1_EARLY || g_sci->getGameId() == GID_KQ7) {
if (getSciVersion() <= SCI_VERSION_2_1_EARLY || g_sci->getGameId() == GID_KQ7) {
blackScreen = 0;
pFadeArray = NULL_REG;
divisions = argc > 7 ? argv[7].toSint16() : -1;
@ -419,7 +419,16 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
divisions = argc > 9 ? argv[9].toSint16() : -1;
}
if ((getSciVersion() < SCI_VERSION_2_1_MIDDLE && g_sci->getGameId() != GID_KQ7 && type == 15) || type > 15) {
// kShowStyleMorph (15) was introduced during SCI2.1early.
// It appears after LSL6 and PQ4, but so far the only known
// SCI2.1early games to use it are KQ7 and SQ6 demos.
int maxType = 15;
if (getSciVersion() < SCI_VERSION_2_1_EARLY ||
g_sci->getGameId() == GID_LSL6 ||
g_sci->getGameId() == GID_PQ4) {
maxType = 14;
}
if (type > maxType) {
error("Illegal show style %d for plane %04x:%04x", type, PRINT_REG(planeObj));
}

View File

@ -35,7 +35,8 @@ static int dissolveSequences[2][20] = {
/* SCI2.1mid+ */ { 0, 0, 3, 6, 12, 20, 48, 96, 184, 272, 576, 1280, 3232, 6912, 13568, 24576, 46080, 73728, 132096, 466944 }
};
static int16 divisionsDefaults[2][16] = {
/* SCI2.1early- */ { 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 40, 40, 101, 101 },
// the last element in SCI2.1early was added after LSL6 and PQ4
/* SCI2.1early- */ { 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 40, 40, 101, 101, 2 },
/* SCI2.1mid+ */ { 1, 20, 20, 20, 20, 10, 10, 10, 10, 20, 20, 6, 10, 101, 101, 2 }
};