aboutsummaryrefslogtreecommitdiff
path: root/engines/adl
diff options
context:
space:
mode:
authorWalter van Niftrik2017-02-15 22:20:22 +0100
committerWalter van Niftrik2017-02-15 22:22:16 +0100
commit41f097fe1ab3057f246f76936a58546b30610e8f (patch)
tree071980395d66d4f4a7c934df074724e1a123cbec /engines/adl
parent832a0dcf1261b7eec7873c4682d5d2e6ebf7f668 (diff)
downloadscummvm-rg350-41f097fe1ab3057f246f76936a58546b30610e8f.tar.gz
scummvm-rg350-41f097fe1ab3057f246f76936a58546b30610e8f.tar.bz2
scummvm-rg350-41f097fe1ab3057f246f76936a58546b30610e8f.zip
ADL: Fix hires6 conditional opcode 0x0a
Diffstat (limited to 'engines/adl')
-rw-r--r--engines/adl/adl.cpp26
-rw-r--r--engines/adl/adl.h2
-rw-r--r--engines/adl/adl_v5.cpp8
-rw-r--r--engines/adl/adl_v5.h2
4 files changed, 17 insertions, 21 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index 845fc524e1..34e398de91 100644
--- a/engines/adl/adl.cpp
+++ b/engines/adl/adl.cpp
@@ -58,7 +58,7 @@ AdlEngine::AdlEngine(OSystem *syst, const AdlGameDescription *gd) :
_isRestarting(false),
_isRestoring(false),
_isQuitting(false),
- _skipOneCommand(false),
+ _abortScript(false),
_gameDescription(gd),
_console(nullptr),
_messageIds(),
@@ -1320,20 +1320,18 @@ bool AdlEngine::doOneCommand(const Commands &commands, byte verb, byte noun) {
Commands::const_iterator cmd;
for (cmd = commands.begin(); cmd != commands.end(); ++cmd) {
-
- if (_skipOneCommand) {
- _skipOneCommand = false;
- continue;
- }
-
ScriptEnv env(*cmd, _state.room, verb, noun);
if (matchCommand(env)) {
doActions(env);
return true;
}
+
+ if (_abortScript) {
+ _abortScript = false;
+ return false;
+ }
}
- _skipOneCommand = false;
return false;
}
@@ -1341,11 +1339,6 @@ void AdlEngine::doAllCommands(const Commands &commands, byte verb, byte noun) {
Commands::const_iterator cmd;
for (cmd = commands.begin(); cmd != commands.end(); ++cmd) {
- if (_skipOneCommand) {
- _skipOneCommand = false;
- continue;
- }
-
ScriptEnv env(*cmd, _state.room, verb, noun);
if (matchCommand(env)) {
doActions(env);
@@ -1353,9 +1346,12 @@ void AdlEngine::doAllCommands(const Commands &commands, byte verb, byte noun) {
if (_isRestarting)
return;
}
- }
- _skipOneCommand = false;
+ if (_abortScript) {
+ _abortScript = false;
+ return;
+ }
+ }
}
Common::String AdlEngine::toAscii(const Common::String &str) {
diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index 3630cd69b9..75df3395d7 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -391,7 +391,7 @@ protected:
bool _isRestarting, _isRestoring, _isQuitting;
bool _canSaveNow, _canRestoreNow;
- bool _skipOneCommand;
+ bool _abortScript;
const AdlGameDescription *_gameDescription;
diff --git a/engines/adl/adl_v5.cpp b/engines/adl/adl_v5.cpp
index 795899c070..be0c31a64c 100644
--- a/engines/adl/adl_v5.cpp
+++ b/engines/adl/adl_v5.cpp
@@ -66,7 +66,7 @@ void AdlEngine_v5::setupOpcodeTables() {
// 0x08
Opcode(o4_isVarGT);
Opcode(o1_isCurPicEQ);
- Opcode(o5_skipOneCommand);
+ Opcode(o5_abortScript);
SetOpcodeTable(_actOpcodes);
// 0x00
@@ -131,10 +131,10 @@ int AdlEngine_v5::o5_isNounNotInRoom(ScriptEnv &e) {
return 1;
}
-int AdlEngine_v5::o5_skipOneCommand(ScriptEnv &e) {
- OP_DEBUG_0("\t&& SKIP_ONE_COMMAND()");
+int AdlEngine_v5::o5_abortScript(ScriptEnv &e) {
+ OP_DEBUG_0("\t&& ABORT_SCRIPT()");
- _skipOneCommand = true;
+ _abortScript = true;
setVar(2, 0);
return -1;
diff --git a/engines/adl/adl_v5.h b/engines/adl/adl_v5.h
index bb1cc3015a..7836ec6b04 100644
--- a/engines/adl/adl_v5.h
+++ b/engines/adl/adl_v5.h
@@ -41,7 +41,7 @@ protected:
virtual RegionChunkType getRegionChunkType(const uint16 addr) const;
int o5_isNounNotInRoom(ScriptEnv &e);
- int o5_skipOneCommand(ScriptEnv &e);
+ int o5_abortScript(ScriptEnv &e);
int o5_dummy(ScriptEnv &e);
int o5_setTextMode(ScriptEnv &e);
int o5_setRegionRoom(ScriptEnv &e);