diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 18 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 5 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 15 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
5 files changed, 20 insertions, 21 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 29d24a5e59..75da6715ba 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -174,6 +174,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'delthisone', 'transferinv', 'obicons', + 'compare', ], skip_output = [ # These functions are processed but not output 'dreamweb', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 58c461963f..a426cedb73 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -10535,23 +10535,6 @@ doselob: useroutine(); } -void DreamGenContext::compare() { - STACK_CHECK; - _sub(dl, 'A'); - _sub(dh, 'A'); - _sub(cl, 'A'); - _sub(ch, 'A'); - push(cx); - push(dx); - getanyaddir(); - dx = pop(); - cx = pop(); - _cmp(es.word(bx+12), cx); - if (!flags.z()) - return /* (comparefin) */; - _cmp(es.word(bx+14), dx); -} - void DreamGenContext::findsetobject() { STACK_CHECK; _sub(al, 'A'); @@ -17893,7 +17876,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_useelvdoor: useelvdoor(); break; case addr_withwhat: withwhat(); break; case addr_selectob: selectob(); break; - case addr_compare: compare(); break; case addr_findsetobject: findsetobject(); break; case addr_findexobject: findexobject(); break; case addr_isryanholding: isryanholding(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 04bef1670d..3b680025cd 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -297,7 +297,6 @@ public: static const uint16 addr_isryanholding = 0xc6cc; static const uint16 addr_findexobject = 0xc6c8; static const uint16 addr_findsetobject = 0xc6c4; - static const uint16 addr_compare = 0xc6c0; static const uint16 addr_selectob = 0xc6bc; static const uint16 addr_withwhat = 0xc6b8; static const uint16 addr_useelvdoor = 0xc6b4; @@ -1359,7 +1358,7 @@ public: void showdiscops(); void advisor(); void additionaltext(); - //void kernchars(); + //void compare(); void othersmoker(); void dofade(); //void setuptimedtemp(); @@ -1406,7 +1405,7 @@ public: //void addtopeoplelist(); void hangoncurs(); void sparkydrip(); - void compare(); + //void kernchars(); void printcurs(); //void convertkey(); void outofopen(); 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 diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 6d431a856f..f99f0d6fbb 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -208,4 +208,6 @@ void obpicture(); void transferinv(); void obicons(); + void compare(); + bool compare(uint8 index, uint8 flag, const char id[4]); |