aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2010-11-29 20:59:44 +0000
committerBastien Bouclet2010-11-29 20:59:44 +0000
commitbfd272a46ebae1198a489d113d0f50b9418ac202 (patch)
tree92084e51af213a19d55f72beffb4da88558aea2c /engines
parent056ebd43d46fe6a5b9bdb3a59c39c3db3ff18a04 (diff)
downloadscummvm-rg350-bfd272a46ebae1198a489d113d0f50b9418ac202.tar.gz
scummvm-rg350-bfd272a46ebae1198a489d113d0f50b9418ac202.tar.bz2
scummvm-rg350-bfd272a46ebae1198a489d113d0f50b9418ac202.zip
MOHAWK: Add a generic temp var for use by Myst scripts.
svn-id: r54632
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/myst_scripts.cpp19
-rw-r--r--engines/mohawk/myst_scripts.h14
-rw-r--r--engines/mohawk/myst_scripts_myst.cpp6
3 files changed, 24 insertions, 15 deletions
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 533bda8ba9..85c90249d7 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -217,8 +217,13 @@ MystScript MystScriptParser::readScript(Common::SeekableReadStream *stream, Myst
}
uint16 MystScriptParser::getVar(uint16 var) {
- warning("Unimplemented var getter 0x%02x (%d)", var, var);
- return _vm->_varStore->getVar(var);
+ switch(var) {
+ case 105:
+ return _tempVar;
+ default:
+ warning("Unimplemented var getter 0x%02x (%d)", var, var);
+ return _vm->_varStore->getVar(var);
+ }
}
void MystScriptParser::toggleVar(uint16 var) {
@@ -227,8 +232,14 @@ void MystScriptParser::toggleVar(uint16 var) {
}
bool MystScriptParser::setVarValue(uint16 var, uint16 value) {
- warning("Unimplemented var setter 0x%02x (%d)", var, var);
- _vm->_varStore->setVar(var, value);
+ if (var == 105) {
+ if (_tempVar != value)
+ _tempVar = value;
+ } else {
+ warning("Unimplemented var setter 0x%02x (%d)", var, var);
+ _vm->_varStore->setVar(var, value);
+ }
+
return false;
}
diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h
index 249345e2f2..c0d2ce6a70 100644
--- a/engines/mohawk/myst_scripts.h
+++ b/engines/mohawk/myst_scripts.h
@@ -131,20 +131,20 @@ protected:
const char *desc;
};
- const MystOpcode *_opcodes;
- void setupOpcodes();
- MystResource *_invokingResource;
uint16 _opcodeCount;
+ const MystOpcode *_opcodes;
- static const uint8 stack_map[];
- static const uint16 start_card[];
+ MystResource *_invokingResource;
uint16 _savedCardId;
uint16 _savedCursorId;
+ uint16 _tempVar; // Generic temp var used by the scripts
- void varUnusedCheck(uint16 op, uint16 var);
-
+ static const uint8 stack_map[];
+ static const uint16 start_card[];
+ void setupOpcodes();
+ void varUnusedCheck(uint16 op, uint16 var);
};
}
diff --git a/engines/mohawk/myst_scripts_myst.cpp b/engines/mohawk/myst_scripts_myst.cpp
index 33ce2f88f2..3020d26d15 100644
--- a/engines/mohawk/myst_scripts_myst.cpp
+++ b/engines/mohawk/myst_scripts_myst.cpp
@@ -2680,10 +2680,8 @@ void MystScriptParser_Myst::opcode_203(uint16 op, uint16 var, uint16 argc, uint1
break;
case kMystStack:
// Used for Card 4138 (Dock Forechamber Door)
- if (argc == 0) {
- g_opcode203Parameters.enabled = true;
- } else
- unknown(op, var, argc, argv);
+ // Set forechamber door to closed
+ setVarValue(105, 0);
break;
case kMechanicalStack:
// Used for Card 6043 (Weapons Rack with Snake Box)