diff options
author | James Brown | 2002-11-03 15:12:39 +0000 |
---|---|---|
committer | James Brown | 2002-11-03 15:12:39 +0000 |
commit | 512f80552eefa34c56f61fbb6207108a6802ec62 (patch) | |
tree | 130162fda66491bb5d0ebbc03c6b20eb50b50f60 /scumm | |
parent | 4158976aaf27971c67a42b83fc6166f517ed807a (diff) | |
download | scummvm-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.cpp | 14 |
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; |