diff options
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 22 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 2 |
4 files changed, 7 insertions, 21 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 63399b1303..2dbaafda18 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -511,7 +511,7 @@ protected: void o6_findAllObjects(); void o6_pickVarRandom(); void o6_getDateTime(); - void o6_unknownE1(); + void o6_getPixel(); void o6_setBoxSet(); void o6_shuffle(); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index ce7a7b4256..d20ef2a95d 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -331,7 +331,7 @@ void ScummEngine_v6::setupOpcodes() { OPCODE(o6_invalid), /* E0 */ OPCODE(o6_invalid), - OPCODE(o6_unknownE1), + OPCODE(o6_getPixel), OPCODE(o6_invalid), OPCODE(o6_pickVarRandom), /* E4 */ @@ -3104,7 +3104,7 @@ void ScummEngine_v6::o6_getDateTime() { VAR(VAR_TIMEDATE_SECOND) = t->tm_sec; } -void ScummEngine_v6::o6_unknownE1() { +void ScummEngine_v6::o6_getPixel() { // this opcode check ground area in minigame "Asteroid Lander" in the dig int x, y; @@ -3116,28 +3116,14 @@ void ScummEngine_v6::o6_unknownE1() { x = pop(); } - if (x > _screenWidth - 1) { - push(-1); - return; - } - if (x < 0) { - push(-1); - return; - } - - if (y < 0) { - push(-1); - return; - } - VirtScreen *vs = findVirtScreen(y); - if (vs == NULL) { + if (vs == NULL || x > _screenWidth - 1 || x < 0) { push(-1); return; } - int offset = (y - vs->topline) * vs->width + x + _screenLeft; + int offset = (y - vs->topline) * vs->width + x + vs->xstart; byte area = *(vs->screenPtr + offset); push(area); diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 1bbd189ec8..634fe1ea73 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -333,7 +333,7 @@ void ScummEngine_v6he::setupOpcodes() { OPCODE(o6_rename), /* E0 */ OPCODE(o6_soundOps), - OPCODE(o6_unknownE1), + OPCODE(o6_getPixel), OPCODE(o6_localizeArray), OPCODE(o6_pickVarRandom), /* E4 */ diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index ff62eea9e9..a365010f8c 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -333,7 +333,7 @@ void ScummEngine_v7he::setupOpcodes() { OPCODE(o6_rename), /* E0 */ OPCODE(o6_soundOps), - OPCODE(o6_unknownE1), + OPCODE(o6_getPixel), OPCODE(o6_localizeArray), OPCODE(o6_pickVarRandom), /* E4 */ |