From 14a521a21177361184fee38242065a64c5fcdf05 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 18 May 2017 11:25:53 -0500 Subject: SCI32: Fix kPlatform operation for SCI2 through SCI2.1early Fixes Trac#9795. --- engines/sci/engine/kmisc.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index f0090cf9fb..31b9f779ea 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -617,7 +617,16 @@ reg_t kPlatform32(EngineState *s, int argc, reg_t *argv) { kGetCDDrive = 3 }; - const Operation operation = argc > 0 ? (Operation)argv[0].toSint16() : kGetPlatform; + Operation operation; + if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) { + if (argc == 0 || argv[0].toSint16() == 0) { + operation = kGetPlatform; + } else { + return NULL_REG; + } + } else { + operation = argc > 0 ? (Operation)argv[0].toSint16() : kGetPlatform; + } switch (operation) { case kGetPlatform: @@ -640,7 +649,7 @@ reg_t kPlatform32(EngineState *s, int argc, reg_t *argv) { case kGetCDSpeed: case kGetCDDrive: default: - return make_reg(0, 0); + return NULL_REG; } } -- cgit v1.2.3