diff options
author | Max Horn | 2003-05-21 14:25:14 +0000 |
---|---|---|
committer | Max Horn | 2003-05-21 14:25:14 +0000 |
commit | 743d9da78d1cc5f0b4b1fdb2d83fec91e8616913 (patch) | |
tree | 3b52c1bfc0c53573964e722d22d7ececafec40de /scumm | |
parent | e21604663fa71426bef8fad528626a4ef17d131a (diff) | |
download | scummvm-rg350-743d9da78d1cc5f0b4b1fdb2d83fec91e8616913.tar.gz scummvm-rg350-743d9da78d1cc5f0b4b1fdb2d83fec91e8616913.tar.bz2 scummvm-rg350-743d9da78d1cc5f0b4b1fdb2d83fec91e8616913.zip |
evil bug in V2 bitvar code fixed -> no more MM cutscene skip crash
svn-id: r7782
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 96da9ddb4c..f9218b663f 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -205,6 +205,7 @@ protected: void getResultPosIndirect(); virtual void getResultPos(); virtual int readVar(uint var); + virtual void writeVar(uint var, int value); virtual void ifStateCommon(byte type); virtual void ifNotStateCommon(byte type); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 33b5d296ac..4f81f7eb98 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -436,10 +436,16 @@ int Scumm_v2::readVar(uint var) { var = _scummVars[var]; checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)"); - debug(6, "readvar(%d) = %d", var, _scummVars[var]); + debug(1, "readvar(%d) = %d", var, _scummVars[var]); return _scummVars[var]; } +void Scumm_v2::writeVar(uint var, int value) { + checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)"); + debug(1, "writeVar(%d) = %d", var, value); + _scummVars[var] = value; +} + void Scumm_v2::getResultPosIndirect() { _resultVarNumber = _scummVars[fetchScriptByte()]; } @@ -529,7 +535,7 @@ void Scumm_v2::o2_getObjUnknown() { } void Scumm_v2::o2_setBitVar() { - byte var = fetchScriptWord(); + int var = fetchScriptWord(); byte a = getVarOrDirectByte(0x80); int bit_var = var + a; @@ -540,11 +546,12 @@ void Scumm_v2::o2_setBitVar() { _scummVars[bit_var] |= (1 << bit_offset); else _scummVars[bit_var] &= ~(1 << bit_offset); + } void Scumm_v2::o2_getBitVar() { getResultPos(); - byte var = fetchScriptWord(); + int var = fetchScriptWord(); byte a = getVarOrDirectByte(0x80); int bit_var = var + a; |