aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-03-18 20:32:01 +0000
committerPaweł Kołodziejski2003-03-18 20:32:01 +0000
commit4cdfd9c2beae3de73a9ee19ae1db8609b8667e6c (patch)
tree00ef5f9e723f1daec68ea06006678481c8edb8a3
parent52bf93a8aa055f54eb155a7f205cbfc805e51dbf (diff)
downloadscummvm-rg350-4cdfd9c2beae3de73a9ee19ae1db8609b8667e6c.tar.gz
scummvm-rg350-4cdfd9c2beae3de73a9ee19ae1db8609b8667e6c.tar.bz2
scummvm-rg350-4cdfd9c2beae3de73a9ee19ae1db8609b8667e6c.zip
added script opcode for dig minigame
svn-id: r6834
-rw-r--r--scumm/intern.h1
-rw-r--r--scumm/script_v6.cpp35
2 files changed, 35 insertions, 1 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 8af677560c..4f9d704c87 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -377,6 +377,7 @@ protected:
void o6_pickVarRandom();
void o6_getDateTime();
void o6_unknownE0();
+ void o6_unknownE1();
void o6_unknownE4();
void o6_localizeArray();
void o6_shuffle();
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 23440e47c9..009415172c 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -323,7 +323,7 @@ void Scumm_v6::setupOpcodes() {
OPCODE(o6_invalid),
/* E0 */
OPCODE(o6_unknownE0),
- OPCODE(o6_invalid),
+ OPCODE(o6_unknownE1),
OPCODE(o6_localizeArray),
OPCODE(o6_pickVarRandom),
/* E4 */
@@ -2922,6 +2922,39 @@ void Scumm_v6::o6_getDateTime() {
_vars[VAR_TIMEDATE_SECOND] = t->tm_sec;
}
+void Scumm_v6::o6_unknownE1() {
+ // this opcode check ground area in minigame in the dig
+ int x = pop();
+ int y = pop();
+
+ if (x > _realWidth - 1) {
+ push(-1);
+ return;
+ }
+ if (x < 0) {
+ push(-1);
+ return;
+ }
+
+ if (y < 0) {
+ push(-1);
+ return;
+ }
+
+ VirtScreen *vs = findVirtScreen(y);
+
+ if (vs == NULL) {
+ push(-1);
+ return;
+ }
+
+ // FIXME: something is wrong, it take wrong position or wrong buffer check
+ int offset = (y - vs->topline) * _realWidth + x + vs->tdirty[0];
+
+ byte area = *(getResourceAddress(rtBuffer, vs->number + 1) + offset);
+ push(area);
+}
+
void Scumm_v6::o6_unknownE0() {
int a = fetchScriptByte();
warning("o6_unknownEO(%d) stub", a);