aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp49
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/stubs.h1
-rw-r--r--engines/dreamweb/use.cpp30
5 files changed, 32 insertions, 50 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 566ad8aced..ce8b025274 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -649,6 +649,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'rollendcredits',
'rollendcredits2',
'roomname',
+ 'runtap',
'runintroseq',
'saveems',
'savefileread',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 7ab361b264..09ea14583d 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3522,55 +3522,6 @@ finishpars:
di = offset_operand1;
}
-void DreamGenContext::runTap() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto tapwith;
- withWhat();
- return;
-tapwith:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'C';
- ch = 'U';
- dl = 'P';
- dh = 'E';
- compare();
- if (flags.z())
- goto fillcupfromtap;
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'C';
- ch = 'U';
- dl = 'P';
- dh = 'F';
- compare();
- if (flags.z())
- goto cupfromtapfull;
- cx = 300;
- al = 56;
- showPuzText();
- putBackObStuff();
- return;
-fillcupfromtap:
- al = data.byte(kWithobject);
- getExAd();
- es.byte(bx+15) = 'F'-'A';
- al = 8;
- playChannel1();
- cx = 300;
- al = 57;
- showPuzText();
- putBackObStuff();
- return;
-cupfromtapfull:
- cx = 300;
- al = 58;
- showPuzText();
- putBackObStuff();
-}
-
void DreamGenContext::notHeldError() {
STACK_CHECK;
createPanel();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 3bb554e8f7..92c6f82e12 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -511,7 +511,6 @@ public:
void startTalk();
void getAnyAd();
void reminders();
- void runTap();
void dumpDiaryKeys();
void checkForExit();
void lookInInterface();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index b32f5460ec..ed45e40b8d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -492,6 +492,7 @@
void useCart();
void useTrainer();
void useHole();
+ void runTap();
void chewy();
void sLabDoorA();
void sLabDoorB();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index f62daf9c9a..c591eca826 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1376,6 +1376,36 @@ void DreamGenContext::useOpenBox() {
showFirstUse();
}
+void DreamGenContext::runTap() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero
+ char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero
+
+ if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) {
+ // Fill cup from tap
+ DynObject *exObject = getExAd(data.byte(kWithobject));
+ exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup)
+ playChannel1(8);
+ showPuzText(57, 300);
+ putBackObStuff();
+ return;
+ }
+
+ if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) {
+ // Cup from tap full
+ showPuzText(58, 300);
+ putBackObStuff();
+ return;
+ }
+
+ showPuzText(56, 300);
+ putBackObStuff();
+}
+
void DreamGenContext::useAxe() {
if (data.byte(kReallocation) != 22) {
// Not in pool