diff options
-rw-r--r-- | engines/agi/op_cmd.cpp | 23 | ||||
-rw-r--r-- | engines/agi/opcodes.cpp | 10 | ||||
-rw-r--r-- | engines/agi/opcodes.h | 3 | ||||
-rw-r--r-- | engines/agi/view.cpp | 6 |
4 files changed, 36 insertions, 6 deletions
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 01abf21230..7148ef6407 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -999,6 +999,15 @@ void cmdReposition(AgiGame *state, uint8 *p) { state->_vm->fixPosition(p0); } +void cmdRepositionV1(AgiGame *state, uint8 *p) { + vt.xPos2 = vt.xPos; + vt.yPos2 = vt.yPos; + vt.flags |= UPDATE_POS; + + vt.xPos = (vt.xPos + p1) & 0xff; + vt.yPos = (vt.yPos + p2) & 0xff; +} + void cmdRepositionTo(AgiGame *state, uint8 *p) { vt.xPos = p1; vt.yPos = p2; @@ -1087,6 +1096,10 @@ void cmdStopMotion(AgiGame *state, uint8 *p) { } } +void cmdStopMotionV1(AgiGame *state, uint8 *p) { + vt.flags &= ~ANIMATED; +} + void cmdStartMotion(AgiGame *state, uint8 *p) { vt.motion = MOTION_NORMAL; if (p0 == 0) { // ego only @@ -1095,6 +1108,10 @@ void cmdStartMotion(AgiGame *state, uint8 *p) { } } +void cmdStartMotionV1(AgiGame *state, uint8 *p) { + vt.flags |= ANIMATED; +} + void cmdPlayerControl(AgiGame *state, uint8 *p) { state->playerControl = true; state->viewTable[0].motion = MOTION_NORMAL; @@ -1173,7 +1190,11 @@ void cmdWander(AgiGame *state, uint8 *p) { state->playerControl = false; vt.motion = MOTION_WANDER; - vt.flags |= UPDATE; + if (getVersion() < 0x2000) { + vt.flags |= UPDATE | ANIMATED; + } else { + vt.flags |= UPDATE; + } } void cmdSetGameID(AgiGame *state, uint8 *p) { diff --git a/engines/agi/opcodes.cpp b/engines/agi/opcodes.cpp index 3b8406c9f4..5571d5c67c 100644 --- a/engines/agi/opcodes.cpp +++ b/engines/agi/opcodes.cpp @@ -83,14 +83,14 @@ AgiInstruction insV1[] = { { "move.obj", "nnnnn", &cmdMoveObj }, // 1F { "set.view", "nn", &cmdSetView }, // 20 { "follow.ego", "nnn", &cmdFollowEgo }, // 21 - { "...", "", &cmdUnknown }, // 22 # block - { "...", "", &cmdUnknown }, // 23 # unblock + { "block", "", &cmdBlock }, // 22 + { "unblock", "", &cmdUnblock }, // 23 { "ignore.blocks", "n", &cmdIgnoreBlocks }, // 24 { "observe.blocks", "n", &cmdObserveBlocks }, // 25 { "wander", "n", &cmdWander }, // 26 - { "reposition", "nvv", &cmdReposition }, // 27 - { "stop.motion", "n", &cmdStopMotion }, // 28 - { "start.motion", "n", &cmdStartMotion }, // 29 + { "reposition", "nvv", &cmdRepositionV1 }, // 27 + { "stop.motion", "n", &cmdStopMotionV1 }, // 28 + { "start.motion", "n", &cmdStartMotionV1 }, // 29 { "stop.cycling", "n", &cmdStopCycling }, // 2A { "start.cycling", "n", &cmdStartCycling }, // 2B { "stop.update", "n", &cmdStopUpdate }, // 2C diff --git a/engines/agi/opcodes.h b/engines/agi/opcodes.h index d0b741b502..afc617478b 100644 --- a/engines/agi/opcodes.h +++ b/engines/agi/opcodes.h @@ -81,6 +81,7 @@ void cmdPositionF(AgiGame *state, uint8 *p); void cmdPositionFV1(AgiGame *state, uint8 *p); void cmdGetPosn(AgiGame *state, uint8 *p); void cmdReposition(AgiGame *state, uint8 *p); // 0x28 +void cmdRepositionV1(AgiGame *state, uint8 *p); // 0x28 void cmdSetView(AgiGame *state, uint8 *p); void cmdSetViewF(AgiGame *state, uint8 *p); void cmdSetLoop(AgiGame *state, uint8 *p); @@ -120,7 +121,9 @@ void cmdReverseLoop(AgiGame *state, uint8 *p); void cmdReverseLoopV1(AgiGame *state, uint8 *p); void cmdCycleTime(AgiGame *state, uint8 *p); void cmdStopMotion(AgiGame *state, uint8 *p); +void cmdStopMotionV1(AgiGame *state, uint8 *p); void cmdStartMotion(AgiGame *state, uint8 *p); +void cmdStartMotionV1(AgiGame *state, uint8 *p); void cmdStepSize(AgiGame *state, uint8 *p); void cmdStepTime(AgiGame *state, uint8 *p); // 0x50 void cmdMoveObj(AgiGame *state, uint8 *p); diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp index e249b80de9..956d398fb4 100644 --- a/engines/agi/view.cpp +++ b/engines/agi/view.cpp @@ -299,6 +299,12 @@ void AgiEngine::setView(VtEntry *v, int n) { v->currentView = n; v->numLoops = v->viewData->numLoops; v->viewReplaced = true; + + if (getVersion() < 0x2000) { + v->stepSize = v->viewData->rdata[0]; + v->cycleTime = v->viewData->rdata[1]; + v->cycleTimeCount = 0; + } setLoop(v, v->currentLoop >= v->numLoops ? 0 : v->currentLoop); } |