diff options
author | Max Horn | 2010-08-11 12:49:16 +0000 |
---|---|---|
committer | Max Horn | 2010-08-11 12:49:16 +0000 |
commit | b8ee574e40676a711e07312f859c11da988e517a (patch) | |
tree | 29545f500f5bdc1d78f72343d5cdbd7d367feb32 /engines | |
parent | aa9f9c7e7e68df016d39a163f6f0b121afa2e4e3 (diff) | |
download | scummvm-rg350-b8ee574e40676a711e07312f859c11da988e517a.tar.gz scummvm-rg350-b8ee574e40676a711e07312f859c11da988e517a.tar.bz2 scummvm-rg350-b8ee574e40676a711e07312f859c11da988e517a.zip |
SCUMM: _resultVarNumber and related methods are specific to v0-v5
svn-id: r51974
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/script.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 5 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 4 | ||||
-rw-r--r-- | engines/scumm/scumm_v5.h | 5 |
4 files changed, 12 insertions, 6 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index be9f69ffb5..29f0c025d2 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -708,7 +708,7 @@ void ScummEngine::writeVar(uint var, int value) { error("Illegal varbits (w)"); } -void ScummEngine::getResultPos() { +void ScummEngine_v5::getResultPos() { int a; _resultVarNumber = fetchScriptWord(); @@ -723,7 +723,7 @@ void ScummEngine::getResultPos() { } } -void ScummEngine::setResult(int value) { +void ScummEngine_v5::setResult(int value) { writeVar(_resultVarNumber, value); } diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index fc95060b6f..a349275b98 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -214,7 +214,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _opcode = 0; vm.numNestedScripts = 0; _lastCodePtr = NULL; - _resultVarNumber = 0; _scummStackPos = 0; memset(_vmStack, 0, sizeof(_vmStack)); _fileOffset = 0; @@ -631,6 +630,10 @@ ScummEngine_v5::ScummEngine_v5(OSystem *syst, const DetectorResult &dr) _flashlight.xStrips = 7; _flashlight.yStrips = 7; _flashlight.buffer = NULL; + + memset(_saveLoadVarsFilename, 0, sizeof(_saveLoadVarsFilename)); + + _resultVarNumber = 0; } ScummEngine_v4::ScummEngine_v4(OSystem *syst, const DetectorResult &dr) diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 42322ba5a2..8c3df21238 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -689,7 +689,7 @@ protected: const byte *_scriptPointer, *_scriptOrgPointer; byte _opcode, _currentScript; const byte * const *_lastCodePtr; - int _resultVarNumber, _scummStackPos; + int _scummStackPos; int _vmStack[150]; OpcodeEntry _opcodes[256]; @@ -745,8 +745,6 @@ protected: int fetchScriptDWordSigned(); void ignoreScriptWord() { fetchScriptWord(); } void ignoreScriptByte() { fetchScriptByte(); } - virtual void getResultPos(); - void setResult(int result); void push(int a); int pop(); virtual int readVar(uint var); diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h index 2580384fd8..71222470f4 100644 --- a/engines/scumm/scumm_v5.h +++ b/engines/scumm/scumm_v5.h @@ -50,6 +50,8 @@ protected: PARAM_3 = 0x20 }; + int _resultVarNumber; + public: ScummEngine_v5(OSystem *syst, const DetectorResult &dr); @@ -77,6 +79,9 @@ protected: virtual int getVarOrDirectByte(byte mask); virtual int getVarOrDirectWord(byte mask); + virtual void getResultPos(); + void setResult(int result); + virtual void animateCursor(); virtual void setBuiltinCursor(int index); |