aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJames Brown2002-11-03 15:12:39 +0000
committerJames Brown2002-11-03 15:12:39 +0000
commit512f80552eefa34c56f61fbb6207108a6802ec62 (patch)
tree130162fda66491bb5d0ebbc03c6b20eb50b50f60 /scumm
parent4158976aaf27971c67a42b83fc6166f517ed807a (diff)
downloadscummvm-rg350-512f80552eefa34c56f61fbb6207108a6802ec62.tar.gz
scummvm-rg350-512f80552eefa34c56f61fbb6207108a6802ec62.tar.bz2
scummvm-rg350-512f80552eefa34c56f61fbb6207108a6802ec62.zip
Indy3 only uses the low 4 bits of a variable
svn-id: r5393
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index f66b31c3f1..fef4acf855 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -330,6 +330,7 @@ int Scumm::readVar(uint var)
var = 518;
}
#endif
+
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)");
return _vars[var];
}
@@ -362,7 +363,11 @@ int Scumm::readVar(uint var)
}
if (var & 0x4000) {
- var &= 0xFFF;
+ if (_gameId == GID_INDY3_256) {
+ var &= 0xF;
+ } else {
+ var &= 0xFFF;
+ }
checkRange(0x10, 0, var, "Local variable %d out of range(r)");
return vm.localvar[_currentScript][var];
}
@@ -422,7 +427,12 @@ void Scumm::writeVar(uint var, int value)
}
if (var & 0x4000) {
- var &= 0xFFF;
+ if (_gameId == GID_INDY3_256) {
+ var &= 0xF;
+ } else {
+ var &= 0xFFF;
+ }
+
checkRange(0x10, 0, var, "Local variable %d out of range(w)");
vm.localvar[_currentScript][var] = value;
return;