aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-20 08:29:46 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commit905e2cd63f76271029133ac093647025f036176d (patch)
treefc3bf5ac60300c4760c1acb4f2b7c2d3ad0aad45
parenta7a371c63d1570714c7b5cb766f6acc3fd26f5fc (diff)
downloadscummvm-rg350-905e2cd63f76271029133ac093647025f036176d.tar.gz
scummvm-rg350-905e2cd63f76271029133ac093647025f036176d.tar.bz2
scummvm-rg350-905e2cd63f76271029133ac093647025f036176d.zip
ADL: Add hires2 opcode 0x20
-rw-r--r--engines/adl/adl.cpp4
-rw-r--r--engines/adl/adl_v2.cpp7
-rw-r--r--engines/adl/adl_v2.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index e2025b9b3d..a09ec69cd5 100644
--- a/engines/adl/adl.cpp
+++ b/engines/adl/adl.cpp
@@ -1040,7 +1040,7 @@ bool AdlEngine::matchCommand(ScriptEnv &env) const {
for (uint i = 0; i < env.getCondCount(); ++i) {
byte op = env.op();
- if (!_condOpcodes[op] || !_condOpcodes[op]->isValid())
+ if (op >= _condOpcodes.size() || !_condOpcodes[op] || !_condOpcodes[op]->isValid())
error("Unimplemented condition opcode %02x", op);
int numArgs = (*_condOpcodes[op])(env);
@@ -1058,7 +1058,7 @@ void AdlEngine::doActions(ScriptEnv &env) {
for (uint i = 0; i < env.getActCount(); ++i) {
byte op = env.op();
- if (!_actOpcodes[op] || !_actOpcodes[op]->isValid())
+ if (op >= _actOpcodes.size() || !_actOpcodes[op] || !_actOpcodes[op]->isValid())
error("Unimplemented action opcode %02x", op);
int numArgs = (*_actOpcodes[op])(env);
diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index e5e02d20fd..3db013deb1 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -101,6 +101,7 @@ void AdlEngine_v2::setupOpcodeTables() {
Opcode(o1_dropItem);
Opcode(o1_setRoomPic);
Opcode(o2_tellTime);
+ Opcode(o2_setRoomFromVar);
}
bool AdlEngine_v2::matchesCurrentPic(byte pic) const {
@@ -280,4 +281,10 @@ int AdlEngine_v2::o2_tellTime(ScriptEnv &e) {
return 0;
}
+int AdlEngine_v2::o2_setRoomFromVar(ScriptEnv &e) {
+ getCurRoom().curPicture = getCurRoom().picture;
+ _state.room = getVar(e.arg(1));
+ return 1;
+}
+
} // End of namespace Adl
diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index d4847193d0..01aa57c7af 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -62,6 +62,7 @@ protected:
int o2_moveAllItems(ScriptEnv &e);
int o2_placeItem(ScriptEnv &e);
int o2_tellTime(ScriptEnv &e);
+ int o2_setRoomFromVar(ScriptEnv &e);
struct {
Common::String time;