diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 11d2a5117d12..7309b4f75a23 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -14836,29 +14836,6 @@ void DreamGenContext::checkifset() { 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 6a991878cd87..4e5505c1ee65 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -113,7 +113,6 @@ class DreamGenContext : public Context { 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 @@ class DreamGenContext : public Context { 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 9e98fd068ee2..5b42e3707973 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 15ff2ee62c75..6cb96e9c0f28 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);