aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2010-08-16 19:57:35 +0000
committerMax Horn2010-08-16 19:57:35 +0000
commit5602b2cf8127bb5dd9df23dd833e18070d60c568 (patch)
tree65e683da4d6b38b640f5d43af3f13699b3079899 /engines/scumm
parenteff2623f1042ea88df8c748ccae7fffca591bb87 (diff)
downloadscummvm-rg350-5602b2cf8127bb5dd9df23dd833e18070d60c568.tar.gz
scummvm-rg350-5602b2cf8127bb5dd9df23dd833e18070d60c568.tar.bz2
scummvm-rg350-5602b2cf8127bb5dd9df23dd833e18070d60c568.zip
SCUMM: Move setResult/getResultPos to script_v5.cpp
svn-id: r52129
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/script.cpp19
-rw-r--r--engines/scumm/script_v5.cpp19
2 files changed, 19 insertions, 19 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 29f0c025d2..223e9822e2 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -708,25 +708,6 @@ void ScummEngine::writeVar(uint var, int value) {
error("Illegal varbits (w)");
}
-void ScummEngine_v5::getResultPos() {
- int a;
-
- _resultVarNumber = fetchScriptWord();
- if (_resultVarNumber & 0x2000) {
- a = fetchScriptWord();
- if (a & 0x2000) {
- _resultVarNumber += readVar(a & ~0x2000);
- } else {
- _resultVarNumber += a & 0xFFF;
- }
- _resultVarNumber &= ~0x2000;
- }
-}
-
-void ScummEngine_v5::setResult(int value) {
- writeVar(_resultVarNumber, value);
-}
-
void ScummEngine::push(int a) {
assert(_scummStackPos >= 0 && _scummStackPos < ARRAYSIZE(_vmStack));
_vmStack[_scummStackPos++] = a;
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 5c20e0dfd3..08afdb8ec9 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -377,6 +377,25 @@ int ScummEngine_v5::getVarOrDirectWord(byte mask) {
return fetchScriptWordSigned();
}
+void ScummEngine_v5::getResultPos() {
+ int a;
+
+ _resultVarNumber = fetchScriptWord();
+ if (_resultVarNumber & 0x2000) {
+ a = fetchScriptWord();
+ if (a & 0x2000) {
+ _resultVarNumber += readVar(a & ~0x2000);
+ } else {
+ _resultVarNumber += a & 0xFFF;
+ }
+ _resultVarNumber &= ~0x2000;
+ }
+}
+
+void ScummEngine_v5::setResult(int value) {
+ writeVar(_resultVarNumber, value);
+}
+
void ScummEngine_v5::jumpRelative(bool cond) {
// We explicitly call ScummEngine::fetchScriptWord()
// to make this method work also in v0, which overloads