aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-11 00:03:03 +0000
committerMax Horn2003-05-11 00:03:03 +0000
commit79d3863db4f358432279a8ee74114f78225f9502 (patch)
treef21213bf46db28870b0aa24fc1c8af78da5f86be
parentbf270d92432e44648d93598b8153b094e16ece3e (diff)
downloadscummvm-rg350-79d3863db4f358432279a8ee74114f78225f9502.tar.gz
scummvm-rg350-79d3863db4f358432279a8ee74114f78225f9502.tar.bz2
scummvm-rg350-79d3863db4f358432279a8ee74114f78225f9502.zip
more V2 'char coord' fixes
svn-id: r7427
-rw-r--r--scumm/intern.h105
-rw-r--r--scumm/script_v2.cpp24
-rw-r--r--scumm/scummvm.cpp4
3 files changed, 71 insertions, 62 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 738634ec85..2575d3342c 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -212,67 +212,68 @@ protected:
virtual void clearStateCommon(byte type);
/* Version 2 script opcodes */
- void o2_setState08();
- void o2_clearState08();
- void o2_setState04();
- void o2_clearState04();
- void o2_setState02();
- void o2_clearState02();
- void o2_setState01();
- void o2_clearState01();
- void o2_assignVarWordIndirect();
+ void o2_actorFromPos();
+ void o2_actorSet();
+ void o2_addIndirect();
+ void o2_animateActor();
void o2_assignVarByte();
- void o2_setObjY();
- void o2_getObjY();
- void o2_setBitVar();
+ void o2_assignVarWordIndirect();
+ void o2_chainScript();
+ void o2_clearState01();
+ void o2_clearState02();
+ void o2_clearState04();
+ void o2_clearState08();
+ void o2_cursorCommand();
+ void o2_cutscene();
+ void o2_delay();
+ void o2_doSentence();
+ void o2_drawObject();
+ void o2_drawSentence();
+ void o2_dummy();
+ void o2_endCutscene();
+ void o2_findObject();
+ void o2_getActorWalkBox();
+ void o2_getActorX();
+ void o2_getActorY();
void o2_getBitVar();
- void o2_addIndirect();
- void o2_subIndirect();
- void o2_ifState08();
- void o2_ifNotState08();
- void o2_ifState04();
- void o2_ifNotState04();
- void o2_ifState02();
+ void o2_getObjY();
+ void o2_ifClassOfIs();
+ void o2_ifNotState01();
void o2_ifNotState02();
+ void o2_ifNotState04();
+ void o2_ifNotState08();
void o2_ifState01();
- void o2_ifNotState01();
- void o2_actorSet();
- void o2_waitForActor();
- void o2_waitForMessage();
- void o2_waitForSentence();
- void o2_restart();
- void o2_drawObject();
- void o2_resourceRoutines();
- void o2_verbOps();
- void o2_doSentence();
- void o2_ifClassOfIs();
- void o2_walkActorTo();
- void o2_putActor();
- void o2_startScript();
+ void o2_ifState02();
+ void o2_ifState04();
+ void o2_ifState08();
+ void o2_loadRoomWithEgo();
+ void o2_matrixOps();
void o2_panCameraTo();
- void o2_setActorElevation();
- void o2_walkActorToObject();
+ void o2_pickupObject();
+ void o2_putActor();
void o2_putActorAtObject();
- void o2_animateActor();
- void o2_actorFromPos();
+ void o2_resourceRoutines();
+ void o2_restart();
+ void o2_roomOps();
void o2_saveLoadGame();
- void o2_getActorX();
- void o2_getActorY();
- void o2_loadRoomWithEgo();
- void o2_setOwnerOf();
- void o2_matrixOps();
+ void o2_setActorElevation();
+ void o2_setBitVar();
void o2_setCameraAt();
- void o2_roomOps();
- void o2_cutscene();
- void o2_chainScript();
- void o2_pickupObject();
void o2_setObjectName();
- void o2_cursorCommand();
- void o2_getActorWalkBox();
- void o2_endCutscene();
- void o2_drawSentence();
- void o2_delay();
- void o2_dummy();
+ void o2_setObjY();
+ void o2_setOwnerOf();
+ void o2_setState01();
+ void o2_setState02();
+ void o2_setState04();
+ void o2_setState08();
+ void o2_startScript();
+ void o2_subIndirect();
+ void o2_verbOps();
+ void o2_waitForActor();
+ void o2_waitForMessage();
+ void o2_waitForSentence();
+ void o2_walkActorTo();
+ void o2_walkActorToObject();
};
class Scumm_v4 : public Scumm_v3 {
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 77312ef504..842d854a5a 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -99,7 +99,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* 34 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_setState01),
/* 38 */
@@ -179,7 +179,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* 74 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_clearState01),
/* 78 */
@@ -259,7 +259,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* B4 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_setState02),
/* B8 */
@@ -339,7 +339,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* F4 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_clearState01),
/* F8 */
@@ -851,6 +851,8 @@ void Scumm_v2::o2_walkActorTo() {
a = derefActorSafe(getVarOrDirectByte(0x80), "o2_walkActorTo");
x = getVarOrDirectByte(0x40) * 8;
y = getVarOrDirectByte(0x20) * 2;
+
+ assert(a);
a->ignoreBoxes = true; // FIXME: Disabling walkboxes
a->startWalkActor(x, y, -1); // for now, just to debug the intro
}
@@ -863,8 +865,7 @@ void Scumm_v2::o2_putActor() {
x = getVarOrDirectByte(0x40) * 8;
y = getVarOrDirectByte(0x20) * 2;
- if (!a)
- return;
+ assert(a);
a->putActor(x, y, a->room);
}
@@ -931,11 +932,18 @@ void Scumm_v2::o2_animateActor() {
void Scumm_v2::o2_actorFromPos() {
int x, y;
getResultPos();
- x = getVarOrDirectByte(0x80);
- y = getVarOrDirectByte(0x40);
+ x = getVarOrDirectByte(0x80) * 8;
+ y = getVarOrDirectByte(0x40) * 2;
setResult(getActorFromPos(x, y));
}
+void Scumm_v2::o2_findObject() {
+ getResultPos();
+ int x = getVarOrDirectByte(0x80) * 8;
+ int y = getVarOrDirectByte(0x40) * 2;
+ setResult(findObject(x, y));
+}
+
void Scumm_v2::o2_saveLoadGame() {
getResultPos();
byte a = getVarOrDirectByte(0x80);
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index b3e2ea31fc..3db0581bf4 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -885,8 +885,8 @@ int Scumm::scummLoop(int delta) {
}
VAR(VAR_HAVE_MSG) = (_haveMsg == 0xFE) ? 0xFF : _haveMsg;
if (_features & GF_AFTER_V2) {
- VAR(VAR_VIRT_MOUSE_X) = _virtual_mouse_x;
- VAR(VAR_VIRT_MOUSE_Y) = _virtual_mouse_y;
+ VAR(VAR_VIRT_MOUSE_X) = _virtual_mouse_x / 8;
+ VAR(VAR_VIRT_MOUSE_Y) = _virtual_mouse_y / 2;
} else {
VAR(VAR_VIRT_MOUSE_X) = _virtual_mouse_x;
VAR(VAR_VIRT_MOUSE_Y) = _virtual_mouse_y;