diff options
-rw-r--r-- | scumm/intern.h | 3 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 41 |
2 files changed, 20 insertions, 24 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index b619978ff1..c120d1ee2b 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -214,10 +214,8 @@ protected: void o2_clearState02(); void o2_setState01(); void o2_clearState01(); - void o2_assignVarByteIndirect(); void o2_assignVarWordIndirect(); void o2_assignVarByte(); - void o2_assignVarWord(); void o2_setObjY(); void o2_getObjY(); void o2_setBitVar(); @@ -234,6 +232,7 @@ protected: void o2_ifNotState01(); void o2_actorSet(); void o2_waitForActor(); + void o2_waitForMessage(); void o2_waitForSentence(); void o2_restart(); void o2_drawObject(); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 6d3e61313e..280a83ab91 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -225,7 +225,7 @@ void Scumm_v2::setupOpcodes() { /* 98 */ OPCODE(o2_restart), OPCODE(o2_doSentence), - OPCODE(o2_assignVarWord), + OPCODE(o5_move), OPCODE(o2_setBitVar), /* 9C */ OPCODE(o5_startSound), @@ -250,7 +250,7 @@ void Scumm_v2::setupOpcodes() { /* AC */ OPCODE(o2_drawSentence), OPCODE(o5_putActorInRoom), - OPCODE(o2_waitForSentence), + OPCODE(o2_waitForMessage), OPCODE(o2_ifNotState04), /* B0 */ OPCODE(o2_matrixOps), @@ -458,14 +458,9 @@ void Scumm_v2::o2_clearState01() { clearStateCommon(0x01); } -void Scumm_v2::o2_assignVarByteIndirect() { - getResultPosIndirect(); - setResult(fetchScriptByte()); -} - void Scumm_v2::o2_assignVarWordIndirect() { getResultPosIndirect(); - setResult(fetchScriptWord()); + setResult(getVarOrDirectWord(0x80)); } void Scumm_v2::o2_assignVarByte() { @@ -473,11 +468,6 @@ void Scumm_v2::o2_assignVarByte() { setResult(fetchScriptByte()); } -void Scumm_v2::o2_assignVarWord() { - getResultPos(); - setResult(fetchScriptWord()); -} - void Scumm_v2::o2_setObjY() { int obj = getVarOrDirectWord(0x80); int y = fetchScriptByte(); @@ -599,6 +589,22 @@ void Scumm_v2::o2_waitForActor() { } } +void Scumm_v2::o2_waitForMessage() { + + if (_vars[VAR_HAVE_MSG]) { + _scriptPointer--; + o5_breakHere(); + } +} + +void Scumm_v2::o2_waitForSentence() { + if (_sentenceNum && !isScriptInUse(2)) + return; + + _scriptPointer--; + o5_breakHere(); +} + void Scumm_v2::o2_actorSet() { int act = getVarOrDirectByte(0x80); int arg = getVarOrDirectByte(0x40); @@ -637,15 +643,6 @@ void Scumm_v2::o2_actorSet() { } } -void Scumm_v2::o2_waitForSentence() { - if (_sentenceNum) - if (!isScriptInUse(2)) - return; - - _scriptPointer--; - o5_breakHere(); -} - void Scumm_v2::o2_restart() { warning("o2_restart NYI"); } |