diff options
author | Travis Howell | 2004-08-25 02:34:17 +0000 |
---|---|---|
committer | Travis Howell | 2004-08-25 02:34:17 +0000 |
commit | 2917071bd616870f3edca551e491a70d18ed3e48 (patch) | |
tree | 35f4b5ddd63c923d72947575ee05b0c9558204d3 /scumm | |
parent | d3727e1c2a4ba7e262f415711ca8bb269a4e820c (diff) | |
download | scummvm-rg350-2917071bd616870f3edca551e491a70d18ed3e48.tar.gz scummvm-rg350-2917071bd616870f3edca551e491a70d18ed3e48.tar.bz2 scummvm-rg350-2917071bd616870f3edca551e491a70d18ed3e48.zip |
Add back change that were reverted by last commit.
Add comment
svn-id: r14736
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 4 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 45 |
2 files changed, 43 insertions, 6 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 9c8fa821c0..1898a18303 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -648,9 +648,9 @@ protected: int32 type; //0 int32 dim1start; //4 int32 dim1end; //8 - int32 dim2start; //0c + int32 dim2start; //0C int32 dim2end; //10 - byte data[1]; + byte data[1]; //14 } GCC_PACK; #if !defined(__GNUC__) diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index a52b0860bc..9dca4b48ce 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -48,7 +48,7 @@ void ScummEngine_v72he::setupOpcodes() { /* 00 */ OPCODE(o6_pushByte), OPCODE(o6_pushWord), - OPCODE(o6_pushByteVar), + OPCODE(o72_pushDWordVar), OPCODE(o6_pushWordVar), /* 04 */ OPCODE(o72_getString), @@ -151,8 +151,8 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_invalid), OPCODE(o6_wordArrayInc), /* 54 */ - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), + OPCODE(o72_objectX), + OPCODE(o72_objectY), OPCODE(o6_byteVarDec), OPCODE(o6_wordVarDec), /* 58 */ @@ -488,6 +488,18 @@ void ScummEngine_v72he::writeArray(int array, int idx2, int idx1, int value) { } } +void ScummEngine_v72he::o72_pushDWordVar() { + int a; + if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { + uint32 oldoffs = _scriptPointer - _scriptOrgPointer; + getScriptBaseAddress(); + _scriptPointer = _scriptOrgPointer + oldoffs; + } + a = READ_LE_UINT32(_scriptPointer); + _scriptPointer += 4; + push(a); +} + void ScummEngine_v72he::o72_getString() { int len; @@ -504,7 +516,7 @@ void ScummEngine_v72he::o72_compareStackList() { int value = pop(); if (num) { - for (i = 1; i < 128; i++) { + for (i = 1; i < num; i++) { if (args[i] == value) { push(1); break; @@ -515,6 +527,31 @@ void ScummEngine_v72he::o72_compareStackList() { } } +void ScummEngine_v72he::o72_objectX() { + int object = pop(); + int objnum = getObjectIndex(object); + + if (objnum == -1) { + push(0); + return; + } + + push(_objs[objnum].x_pos); +} + + +void ScummEngine_v72he::o72_objectY() { + int object = pop(); + int objnum = getObjectIndex(object); + + if (objnum == -1) { + push(0); + return; + } + + push(_objs[objnum].y_pos); +} + void ScummEngine_v72he::o72_startScript() { int args[16]; int script, flags; |