aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/stubs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r--engines/dreamweb/stubs.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 923c63602a..3a01872542 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1717,6 +1717,21 @@ void DreamGenContext::obicons() {
}
}
+void DreamGenContext::compare() {
+ char id[4] = { cl, ch, dl, dh };
+ flags._z = compare(al, ah, id);
+}
+
+bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
+ void *ptr = getanyaddir(index, flag);
+ const char *objId = (const char *)(((const uint8 *)ptr) + 12); // whether it is a DynObject or a SetObject
+ for (size_t i = 0; i < 4; ++i) {
+ if(id[i] != objId[i] + 'A')
+ return false;
+ }
+ return true;
+}
+
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