aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-05-18 11:25:53 -0500
committerColin Snover2017-05-20 21:14:18 -0500
commit14a521a21177361184fee38242065a64c5fcdf05 (patch)
tree9e769db677b4d9a09f9ac9c4a99690ab50ec5625 /engines
parentcb657c0c0f0ba291218cde205f3f8ab5d228ff52 (diff)
downloadscummvm-rg350-14a521a21177361184fee38242065a64c5fcdf05.tar.gz
scummvm-rg350-14a521a21177361184fee38242065a64c5fcdf05.tar.bz2
scummvm-rg350-14a521a21177361184fee38242065a64c5fcdf05.zip
SCI32: Fix kPlatform operation for SCI2 through SCI2.1early
Fixes Trac#9795.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kmisc.cpp13
1 files changed, 11 insertions, 2 deletions
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;
}
}