aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-09-02 01:49:14 +0200
committerBertrand Augereau2011-09-02 03:49:28 +0200
commit7eed29c1a0e02f31d615e5f3780705e43ee4922d (patch)
treea98c796be9a21869bf2089f862f413372ed28cd2
parentcb410d5837571fad42faea0c625c8479e4d9b876 (diff)
downloadscummvm-rg350-7eed29c1a0e02f31d615e5f3780705e43ee4922d.tar.gz
scummvm-rg350-7eed29c1a0e02f31d615e5f3780705e43ee4922d.tar.bz2
scummvm-rg350-7eed29c1a0e02f31d615e5f3780705e43ee4922d.zip
DREAMWEB: 'isitdescribed' ported to C++
-rw-r--r--engines/dreamweb/dreamgen.cpp24
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp11
-rw-r--r--engines/dreamweb/stubs.h3
4 files changed, 14 insertions, 27 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 11d2a5117d..7309b4f75a 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -14836,29 +14836,6 @@ notasetid:
goto identifyset;
}
-void DreamGenContext::isitdescribed() {
- STACK_CHECK;
- push(ax);
- push(cx);
- push(es);
- push(bx);
- al = es.byte(bx+4);
- ah = 0;
- _add(ax, ax);
- bx = ax;
- es = data.word(kSetdesc);
- _add(bx, (0));
- ax = es.word(bx);
- _add(ax, (0+(130*2)));
- bx = ax;
- dl = es.byte(bx);
- bx = pop();
- es = pop();
- cx = pop();
- ax = pop();
- _cmp(dl, 0);
-}
-
void DreamGenContext::findpathofpoint() {
STACK_CHECK;
push(ax);
@@ -17915,7 +17892,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_madmanrun: madmanrun(); break;
case addr_identifyob: identifyob(); break;
case addr_checkifset: checkifset(); break;
- case addr_isitdescribed: isitdescribed(); break;
case addr_findpathofpoint: findpathofpoint(); break;
case addr_findfirstpath: findfirstpath(); break;
case addr_checkifpathison: checkifpathison(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6a991878cd..4e5505c1ee 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -113,7 +113,6 @@ public:
static const uint16 addr_checkifpathison = 0xca04;
static const uint16 addr_findfirstpath = 0xc9f0;
static const uint16 addr_findpathofpoint = 0xc9ec;
- static const uint16 addr_isitdescribed = 0xc9e8;
static const uint16 addr_checkifset = 0xc9dc;
static const uint16 addr_identifyob = 0xc9d4;
static const uint16 addr_madmanrun = 0xc9cc;
@@ -1463,7 +1462,7 @@ public:
void candles1();
void lookininterface();
void manasleep();
- void isitdescribed();
+ //void isitdescribed();
void hotelbell();
void loadspeech();
void interupttest();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 9e98fd068e..5b42e37079 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1737,6 +1737,17 @@ bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
return true;
}
+void DreamGenContext::isitdescribed() {
+ ObjPos *pos = (ObjPos *)es.ptr(bx, sizeof(ObjPos));
+ flags._z = !isitdescribed(pos);
+}
+
+bool DreamGenContext::isitdescribed(ObjPos *pos) {
+ uint16 offset = segRef(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
+ uint8 result = segRef(data.word(kSetdesc)).byte(kSettext + offset);
+ return result != 0;
+}
+
bool DreamGenContext::isCD() {
// The original sources has two codepaths depending if the game is 'if cd' or not
// This is a hack to guess which version to use with the assumption that if we have a cd version
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 15ff2ee62c..6cb96e9c0f 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -218,5 +218,6 @@
bool compare(uint8 index, uint8 flag, const char id[4]);
void pixelcheckset();
bool pixelcheckset(ObjPos *pos, uint8 x, uint8 y);
-
+ void isitdescribed();
+ bool isitdescribed(ObjPos *objPos);