aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreamgen.cpp83
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/stubs.h2
-rw-r--r--engines/dreamweb/use.cpp63
5 files changed, 67 insertions, 85 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 4eafce7743..b663a01fba 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -772,6 +772,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'twodigitnum',
'undertextline',
'updatepeople',
+ 'useaxe',
'usebalcony',
'usebuttona',
'usecardreader1',
@@ -795,6 +796,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'useelvdoor',
'usefullcart',
'usehole',
+ 'usekey',
'useladder',
'useladderb',
'uselighter',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 851cca77fe..b917f58e87 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3830,58 +3830,6 @@ havecutwire:
data.byte(kGetback) = 1;
}
-void DreamGenContext::useKey() {
- STACK_CHECK;
- _cmp(data.byte(kLocation), 5);
- if (flags.z())
- goto usekey1;
- _cmp(data.byte(kLocation), 30);
- if (flags.z())
- goto usekey1;
- _cmp(data.byte(kLocation), 21);
- if (flags.z())
- goto usekey2;
- cx = 200;
- al = 1;
- showPuzText();
- putBackObStuff();
- return;
-usekey1:
- _cmp(data.byte(kMapx), 22);
- if (!flags.z())
- goto wrongroom1;
- _cmp(data.byte(kMapy), 10);
- if (!flags.z())
- goto wrongroom1;
- cx = 300;
- al = 0;
- showPuzText();
- data.byte(kCounttoclose) = 100;
- data.byte(kGetback) = 1;
- return;
-usekey2:
- _cmp(data.byte(kMapx), 11);
- if (!flags.z())
- goto wrongroom1;
- _cmp(data.byte(kMapy), 10);
- if (!flags.z())
- goto wrongroom1;
- cx = 300;
- al = 3;
- showPuzText();
- data.byte(kNewlocation) = 30;
- al = 2;
- fadeScreenDown();
- showFirstUse();
- putBackObStuff();
- return;
-wrongroom1:
- cx = 200;
- al = 2;
- showPuzText();
- putBackObStuff();
-}
-
void DreamGenContext::useStereo() {
STACK_CHECK;
_cmp(data.byte(kLocation), 0);
@@ -3944,37 +3892,6 @@ stereoon:
putBackObStuff();
}
-void DreamGenContext::useAxe() {
- STACK_CHECK;
- _cmp(data.byte(kReallocation), 22);
- if (!flags.z())
- goto notinpool;
- _cmp(data.byte(kMapy), 10);
- if (flags.z())
- goto axeondoor;
- showSecondUse();
- _inc(data.byte(kProgresspoints));
- data.byte(kLastweapon) = 2;
- data.byte(kGetback) = 1;
- removeObFromInv();
- return;
-notinpool:
- showFirstUse();
- return;
-/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/
-axeondoor:
- al = 15;
- cx = 300;
- showPuzText();
- _inc(data.byte(kProgresspoints));
- data.word(kWatchingtime) = 46*2;
- data.word(kReeltowatch) = 31;
- data.word(kEndwatchreel) = 77;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.byte(kGetback) = 1;
-}
-
void DreamGenContext::withWhat() {
STACK_CHECK;
createPanel();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 7be848813e..f146649b61 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -521,7 +521,6 @@ public:
void getFreeAd();
void removeObFromInv();
void heavy();
- void useKey();
void dirFile();
void pickupConts();
void nextColon();
@@ -549,7 +548,6 @@ public:
void rollEm();
void poolGuard();
void lookAtPlace();
- void useAxe();
void findAllOpen();
void fillOpen();
void findSetObject();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 18d90ff499..4376f5b42d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -334,6 +334,8 @@
void useSLab();
void usePipe();
void useOpenBox();
+ void useAxe();
+ void useKey();
void wheelSound();
void callHotelLift();
void useShield();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 0ede2f485a..531f465010 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1376,4 +1376,67 @@ void DreamGenContext::useOpenBox() {
showFirstUse();
}
+void DreamGenContext::useAxe() {
+ if (data.byte(kReallocation) != 22) {
+ // Not in pool
+ showFirstUse();
+ return;
+ }
+
+ if (data.byte(kMapy) == 10) {
+ // Axe on door
+ al = 15;
+ cx = 300;
+ showPuzText(15, 300);
+ data.byte(kProgresspoints)++;
+ data.word(kWatchingtime) = 46*2;
+ data.word(kReeltowatch) = 31;
+ data.word(kEndwatchreel) = 77;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ return;
+ }
+
+ showSecondUse();
+ data.byte(kProgresspoints)++;
+ data.byte(kLastweapon) = 2;
+ data.byte(kGetback) = 1;
+ removeObFromInv();
+}
+
+void DreamGenContext::useKey() {
+ switch(data.byte(kLocation)) {
+ case 5:
+ case 30:
+ if (data.byte(kMapx) == 22 && data.byte(kMapy) == 10) {
+ showPuzText(0, 300);
+ data.byte(kCounttoclose) = 100;
+ data.byte(kGetback) = 1;
+ } else {
+ // Wrong room
+ showPuzText(2, 200);
+ putBackObStuff();
+ }
+ break;
+ case 21:
+ if (data.byte(kMapx) == 11 && data.byte(kMapy) == 10) {
+ showPuzText(3, 300);
+ data.byte(kNewlocation) = 30;
+ al = 2;
+ fadeScreenDown();
+ showFirstUse();
+ putBackObStuff();
+ } else {
+ // Wrong room
+ showPuzText(2, 200);
+ putBackObStuff();
+ }
+ default:
+ showPuzText(1, 200);
+ putBackObStuff();
+ break;
+ }
+}
+
} // End of namespace DreamGen