diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 46 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/object.cpp | 33 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
5 files changed, 35 insertions, 47 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index da77e6facf..abb770cfd2 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -760,6 +760,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'seecommandtail', 'selectlocation', 'selectob', + 'selectopenob', 'selectslot', 'selectslot2', 'set16colpalette', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 8cd5dd43df..bca2232267 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -537,52 +537,6 @@ findopenp1: _add(bx, (0+(228*13))); } -void DreamGenContext::selectOpenOb() { - STACK_CHECK; - al = data.byte(kCommand); - getAnyAd(); - _cmp(al, 255); - if (!flags.z()) - goto canopenit1; - blank(); - return; -canopenit1: - _cmp(data.byte(kCommandtype), 224); - if (flags.z()) - goto alreadyopob; - data.byte(kCommandtype) = 224; - bl = data.byte(kCommand); - bh = data.byte(kObjecttype); - al = 38; - commandWithOb(); -alreadyopob: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (noopenob) */; - _and(ax, 1); - if (!flags.z()) - goto doopenob; - return; -doopenob: - al = data.byte(kCommand); - data.byte(kOpenedob) = al; - al = data.byte(kObjecttype); - data.byte(kOpenedtype) = al; - createPanel(); - showPanel(); - showMan(); - examIcon(); - showExit(); - openInv(); - openOb(); - underTextLine(); - readMouse(); - showPointer(); - workToScreen(); - delPointer(); -} - void DreamGenContext::useOpened() { STACK_CHECK; _cmp(data.byte(kOpenedob), 255); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 52009dc5ed..db9a8c2eeb 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -478,7 +478,6 @@ public: void getDestInfo(); void read(); void searchForString(); - void selectOpenOb(); void searchForFiles(); void getExAd(); void swapWithInv(); diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 4addfc404e..dff58050a5 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -793,4 +793,37 @@ bool DreamGenContext::checkObjectSizeCPP() { return false; } +void DreamGenContext::selectOpenOb() { + uint8 slotSize, slotCount; + getAnyAd(&slotSize, &slotCount); + if (slotCount == 255) { + // Can't open the object + blank(); + return; + } + + if (data.byte(kCommandtype) != 224) { + data.byte(kCommandtype) = 224; + commandWithOb(38, data.byte(kObjecttype), data.byte(kCommand)); + } + + if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1)) + return; + + data.byte(kOpenedob) = data.byte(kCommand); + data.byte(kOpenedtype) = data.byte(kObjecttype); + createPanel(); + showPanel(); + showMan(); + examIcon(); + showExit(); + openInv(); + openOb(); + underTextLine(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index ed0afa4ea9..547714e006 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -197,5 +197,6 @@ void lookAtPlace(); void inToInv(); void outOfInv(); + void selectOpenOb(); #endif |