From 16c9620dbad66d7c1f2bc5f4d172393c34b92371 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 20:17:19 +0200 Subject: DREAMWEB: 'grafittidoor', 'hotelcontrol', 'openhoteldoor', 'openhoteldoor2', 'opentomb' ported to C++ --- devtools/tasmrecover/tasm-recover | 5 ++ engines/dreamweb/dreamgen.cpp | 114 -------------------------------------- engines/dreamweb/dreamgen.h | 5 -- engines/dreamweb/stubs.h | 5 ++ engines/dreamweb/use.cpp | 80 ++++++++++++++++++++++++++ 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 */ -- cgit v1.2.3