aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-04-15 22:14:18 +0000
committerTravis Howell2006-04-15 22:14:18 +0000
commit53698416f212565afdf516f0f2cd5c1912f43c64 (patch)
tree94ea96764ceeedf057d53fa9da0581144d7c61cc
parente63763329cf96d9295d398c1c34d9818a00e3db7 (diff)
downloadscummvm-rg350-53698416f212565afdf516f0f2cd5c1912f43c64.tar.gz
scummvm-rg350-53698416f212565afdf516f0f2cd5c1912f43c64.tar.bz2
scummvm-rg350-53698416f212565afdf516f0f2cd5c1912f43c64.zip
Use different methods to avoid overflows to FF, to avoid regressions
svn-id: r21923
-rw-r--r--engines/simon/simon.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index 405d2dbe7e..0d680ba6cd 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -397,8 +397,10 @@ SimonEngine::SimonEngine(OSystem *syst)
memset(_speechIdArray4, 0, sizeof(_speechIdArray4));
memset(_bitArray, 0, sizeof(_bitArray));
+
memset(_variableArray, 0, sizeof(_variableArray));
memset(_variableArray2, 0, sizeof(_variableArray2));
+ _variableArrayPtr = 0;
memset(_windowArray, 0, sizeof(_windowArray));
@@ -995,8 +997,12 @@ uint SimonEngine::getVarOrByte() {
uint SimonEngine::getVarOrWord() {
uint a = READ_BE_UINT16(_codePtr);
_codePtr += 2;
- if (a >= 30000 && a < 30512)
- return readVariable(a - 30000);
+ if (a >= 30000 && a < 30512) {
+ if (getGameType() == GType_FF)
+ return (uint16)readVariable(a - 30000);
+ else
+ return readVariable(a - 30000);
+ }
return a;
}
@@ -3509,6 +3515,8 @@ int SimonEngine::go() {
else
_numTextBoxes = 20;
+ _variableArrayPtr = _variableArray;
+
_startMainScript = false;
_continousMainScript = false;
_startVgaScript = false;