aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/script_v2.cpp22
2 files changed, 20 insertions, 4 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 0008109788..c2a056e747 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -217,6 +217,7 @@ protected:
/* Version 2 script opcodes */
void o2_actorFromPos();
void o2_actorSet();
+ void o2_add();
void o2_addIndirect();
void o2_animateActor();
void o2_assignVarByte();
@@ -271,6 +272,7 @@ protected:
void o2_setState04();
void o2_setState08();
void o2_startScript();
+ void o2_subtract();
void o2_subIndirect();
void o2_verbOps();
void o2_waitForActor();
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 632a3c2ffe..5cfda5026a 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -105,7 +105,7 @@ void Scumm_v2::setupOpcodes() {
/* 38 */
OPCODE(o5_lessOrEqual),
OPCODE(o2_doSentence),
- OPCODE(o5_subtract),
+ OPCODE(o2_subtract),
OPCODE(o2_waitForActor),
/* 3C */
OPCODE(o5_stopSound),
@@ -145,7 +145,7 @@ void Scumm_v2::setupOpcodes() {
/* 58 */
OPCODE(o2_beginOverride),
OPCODE(o2_doSentence),
- OPCODE(o5_add),
+ OPCODE(o2_add),
OPCODE(o2_setBitVar),
/* 5C */
OPCODE(o2_dummy),
@@ -265,7 +265,7 @@ void Scumm_v2::setupOpcodes() {
/* B8 */
OPCODE(o5_lessOrEqual),
OPCODE(o2_doSentence),
- OPCODE(o5_subtract),
+ OPCODE(o2_subtract),
OPCODE(o2_waitForActor),
/* BC */
OPCODE(o5_stopSound),
@@ -305,7 +305,7 @@ void Scumm_v2::setupOpcodes() {
/* D8 */
OPCODE(o5_printEgo),
OPCODE(o2_doSentence),
- OPCODE(o5_add),
+ OPCODE(o2_add),
OPCODE(o2_setBitVar),
/* DC */
OPCODE(o2_dummy),
@@ -627,6 +627,20 @@ void Scumm_v2::o2_subIndirect() {
_scummVars[_resultVarNumber] -= a;
}
+void Scumm_v2::o2_add() {
+ int a;
+ getResultPos();
+ a = getVarOrDirectWord(0x80);
+ _scummVars[_resultVarNumber] += a;
+}
+
+void Scumm_v2::o2_subtract() {
+ int a;
+ getResultPos();
+ a = getVarOrDirectWord(0x80);
+ _scummVars[_resultVarNumber] -= a;
+}
+
void Scumm_v2::o2_waitForActor() {
if (derefActorSafe(getVarOrDirectByte(0x80), "o2_waitForActor")->moving) {
_scriptPointer -= 2;