aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-06 20:17:19 +0200
committerFilippos Karapetis2011-12-06 20:17:19 +0200
commit16c9620dbad66d7c1f2bc5f4d172393c34b92371 (patch)
tree433ea89233448f379b4ffbec8c0e52c0e6a592b4
parent7566d2c985e497ca2bca1db700a9fee7eabf9351 (diff)
downloadscummvm-rg350-16c9620dbad66d7c1f2bc5f4d172393c34b92371.tar.gz
scummvm-rg350-16c9620dbad66d7c1f2bc5f4d172393c34b92371.tar.bz2
scummvm-rg350-16c9620dbad66d7c1f2bc5f4d172393c34b92371.zip
DREAMWEB: 'grafittidoor', 'hotelcontrol', 'openhoteldoor', 'openhoteldoor2', 'opentomb' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover5
-rw-r--r--engines/dreamweb/dreamgen.cpp114
-rw-r--r--engines/dreamweb/dreamgen.h5
-rw-r--r--engines/dreamweb/stubs.h5
-rw-r--r--engines/dreamweb/use.cpp80
5 files changed, 90 insertions, 119 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 197909c338..eee658fb37 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -330,6 +330,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getundertimed',
'getxad',
'getyad',
+ 'grafittidoor',
'handclap',
'hangon',
'hangoncurs',
@@ -337,6 +338,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'hangonp',
'hangonw',
'hotelbell',
+ 'hotelcontrol',
'initialinv',
'initman',
'initrain',
@@ -425,11 +427,14 @@ generator = cpp(context, "DreamGen", blacklist = [
'openeden',
'openfile',
'openforsave',
+ 'openhoteldoor',
+ 'openhoteldoor2',
'openinv',
'openlouis',
'openpoolboss',
'openryan'
'opensarters',
+ 'opentomb',
'opentvdoor',
'openyourneighbour',
'othersmoker',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 3e63d186ce..33f1939d6e 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5075,34 +5075,6 @@ cupfromtapfull:
putBackObStuff();
}
-void DreamGenContext::hotelControl() {
- STACK_CHECK;
- _cmp(data.byte(kReallocation), 21);
- if (!flags.z())
- goto notrightcont;
- _cmp(data.byte(kMapx), 33);
- if (!flags.z())
- goto notrightcont;
- showFirstUse();
- putBackObStuff();
- return;
-notrightcont:
- showSecondUse();
- putBackObStuff();
-}
-
-void DreamGenContext::openTomb() {
- STACK_CHECK;
- _inc(data.byte(kProgresspoints));
- showFirstUse();
- data.word(kWatchingtime) = 35*2;
- data.word(kReeltowatch) = 1;
- data.word(kEndwatchreel) = 33;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.byte(kGetback) = 1;
-}
-
void DreamGenContext::notHeldError() {
STACK_CHECK;
createPanel();
@@ -5336,92 +5308,6 @@ void DreamGenContext::drawItAll() {
showIcon();
}
-void DreamGenContext::openHotelDoor() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto hoteldoorwith;
- withWhat();
- return;
-hoteldoorwith:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'K';
- ch = 'E';
- dl = 'Y';
- dh = 'A';
- compare();
- if (flags.z())
- goto keyonhotel1;
- cx = 300;
- al = 14;
- showPuzText();
- putBackObStuff();
- return;
-keyonhotel1:
- al = 16;
- playChannel1();
- showFirstUse();
- data.byte(kLockstatus) = 0;
- data.byte(kGetback) = 1;
-}
-
-void DreamGenContext::openHotelDoor2() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto hoteldoorwith2;
- withWhat();
- return;
-hoteldoorwith2:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'K';
- ch = 'E';
- dl = 'Y';
- dh = 'A';
- compare();
- if (flags.z())
- goto keyonhotel2;
- cx = 300;
- al = 14;
- showPuzText();
- putBackObStuff();
- return;
-keyonhotel2:
- al = 16;
- playChannel1();
- showFirstUse();
- putBackObStuff();
-}
-
-void DreamGenContext::grafittiDoor() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto grafwith;
- withWhat();
- return;
-grafwith:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'A';
- ch = 'P';
- dl = 'E';
- dh = 'N';
- compare();
- if (flags.z())
- goto dograf;
- cx = 300;
- al = 14;
- showPuzText();
- putBackObStuff();
- return;
-dograf:
- showFirstUse();
- putBackObStuff();
-}
-
void DreamGenContext::usePoolReader() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 93f62691b0..faad3a0c5f 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -564,7 +564,6 @@ public:
void isRyanHolding();
void showSlots();
void useCashCard();
- void openTomb();
void doSomeTalk();
void showSaveOps();
void introMonks1();
@@ -625,7 +624,6 @@ public:
void attendant();
void cantDrop();
void copper();
- void openHotelDoor();
void drinker();
void nextColon();
void placeFreeObject();
@@ -727,11 +725,9 @@ public:
void isSetObOnMap();
void getDestInfo();
void setupTimedUse();
- void grafittiDoor();
void makeCaps();
void read();
void additionalText();
- void hotelControl();
void mugger();
void searchForString();
void selectOpenOb();
@@ -771,7 +767,6 @@ public:
void inToInv();
void parser();
void setMouse();
- void openHotelDoor2();
void selectLocation();
void underTextLine();
void showNames();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index e275d1d2f0..4724ae2f81 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -547,6 +547,11 @@
void sLabDoorE();
void sLabDoorD();
void sLabDoorF();
+ void openHotelDoor();
+ void openHotelDoor2();
+ void grafittiDoor();
+ void openTomb();
+ void hotelControl();
void obsThatDoThings();
void makeMainScreen();
void openInv();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index f8a3054e65..c70c625969 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1025,4 +1025,84 @@ void DreamGenContext::useHole() {
}
}
+void DreamGenContext::openHotelDoor() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero
+ if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+ // Wrong item
+ cx = 300;
+ al = 14;
+ showPuzText();
+ putBackObStuff();
+ } else {
+ playChannel1(16);
+ showFirstUse();
+ data.byte(kLockstatus) = 0;
+ data.byte(kGetback) = 1;
+ }
+}
+
+void DreamGenContext::openHotelDoor2() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero
+ if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+ // Wrong item
+ cx = 300;
+ al = 14;
+ showPuzText();
+ putBackObStuff();
+ } else {
+ playChannel1(16);
+ showFirstUse();
+ putBackObStuff();
+ }
+}
+
+void DreamGenContext::grafittiDoor() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero
+ if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+ // Wrong item
+ cx = 300;
+ al = 14;
+ showPuzText();
+ putBackObStuff();
+ } else {
+ showFirstUse();
+ putBackObStuff();
+ }
+}
+
+void DreamGenContext::openTomb() {
+ data.byte(kProgresspoints)++;
+ showFirstUse();
+ data.word(kWatchingtime) = 35 * 2;
+ data.word(kReeltowatch) = 1;
+ data.word(kEndwatchreel) = 33;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::hotelControl() {
+ if (data.byte(kReallocation) != 21 || data.byte(kMapx) != 33)
+ showSecondUse(); // Not right control
+ else
+ showFirstUse();
+
+ putBackObStuff();
+}
+
} /*namespace dreamgen */