aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-06 13:17:28 +0200
committerFilippos Karapetis2011-12-06 13:17:28 +0200
commitc244f6e66202f22570c706eb877807fe60d0b99a (patch)
tree5cda85ac5d0495f821ecfd9a213ddf6f182e4867
parent6ad12bc093be2cbc9ddc46d0373f1c60d72a39ee (diff)
downloadscummvm-rg350-c244f6e66202f22570c706eb877807fe60d0b99a.tar.gz
scummvm-rg350-c244f6e66202f22570c706eb877807fe60d0b99a.tar.bz2
scummvm-rg350-c244f6e66202f22570c706eb877807fe60d0b99a.zip
DREAMWEB: 'usechurchgate', 'usefullcart' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreamgen.cpp62
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/stubs.h2
-rw-r--r--engines/dreamweb/use.cpp47
5 files changed, 51 insertions, 64 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 9ef055769a..56f968eeec 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -580,6 +580,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'updatepeople',
'usebalcony',
'usecharset1',
+ 'usechurchgate',
'usechurchhole',
'usecoveredbox',
'usedryer',
@@ -588,6 +589,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'useelevator3',
'useelevator4',
'useelevator5',
+ 'usefullcart',
'useladder',
'useladderb',
'usehatch',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index f9f1667c77..a2f75bd842 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5441,28 +5441,6 @@ alreadyfull:
putBackObStuff();
}
-void DreamGenContext::useFullCart() {
- STACK_CHECK;
- _inc(data.byte(kProgresspoints));
- al = 2;
- ah = data.byte(kRoomnum);
- _add(ah, 6);
- turnAnyPathOn();
- data.byte(kManspath) = 4;
- data.byte(kFacing) = 4;
- data.byte(kTurntoface) = 4;
- data.byte(kFinaldest) = 4;
- findXYFromPath();
- data.byte(kResetmanxy) = 1;
- showFirstUse();
- data.word(kWatchingtime) = 72*2;
- data.word(kReeltowatch) = 58;
- data.word(kEndwatchreel) = 142;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.byte(kGetback) = 1;
-}
-
void DreamGenContext::usePlinth() {
STACK_CHECK;
_cmp(data.byte(kWithobject), 255);
@@ -7056,46 +7034,6 @@ void DreamGenContext::setupTimedUse() {
data.word(kTimedoffset) = bx;
}
-void DreamGenContext::useChurchGate() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto gatewith;
- withWhat();
- return;
-gatewith:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'C';
- ch = 'U';
- dl = 'T';
- dh = 'T';
- compare();
- if (flags.z())
- goto cutgate;
- cx = 300;
- al = 14;
- showPuzText();
- putBackObStuff();
- return;
-cutgate:
- showFirstUse();
- data.word(kWatchingtime) = 64*2;
- data.word(kReeltowatch) = 4;
- data.word(kEndwatchreel) = 70;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- data.byte(kGetback) = 1;
- _inc(data.byte(kProgresspoints));
- al = 3;
- turnPathOn();
- _cmp(data.byte(kAidedead), 0);
- if (flags.z())
- return /* (notopenchurch) */;
- al = 2;
- turnPathOn();
-}
-
void DreamGenContext::useGun() {
STACK_CHECK;
_cmp(data.byte(kObjecttype), 4);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 8dc36b7f11..a504450810 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -756,7 +756,6 @@ public:
void selectOpenOb();
void useGun();
void autoAppear();
- void useFullCart();
void newPlace();
void useCardReader1();
void useCardReader2();
@@ -780,7 +779,6 @@ public:
void execCommand();
void updateSymbolBot();
void findPuzText();
- void useChurchGate();
void monkAndRyan();
void swapWithInv();
void useControl();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index fa758232bb..6b90f74d43 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -397,6 +397,8 @@
void callHotelLift();
void useShield();
void useWall();
+ void useChurchGate();
+ void useFullCart();
void wearWatch();
void wearShades();
void checkFolderCoords();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index c60873c7b6..5bc8a4f93b 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -692,4 +692,51 @@ void DreamGenContext::sLabDoorF() {
}
}
+void DreamGenContext::useChurchGate() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char id[4] = { 'C', 'U', 'T', 'T' }; // 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 {
+ // Cut gate
+ showFirstUse();
+ data.word(kWatchingtime) = 64 * 2;
+ data.word(kReeltowatch) = 4;
+ data.word(kEndwatchreel) = 70;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ data.byte(kProgresspoints)++;
+ turnPathOn(3);
+ if (data.byte(kAidedead) != 0)
+ turnPathOn(2); // Open church
+ }
+}
+
+void DreamGenContext::useFullCart() {
+ data.byte(kProgresspoints)++;
+ turnAnyPathOn(2, data.byte(kRoomnum) + 6);
+ data.byte(kManspath) = 4;
+ data.byte(kFacing) = 4;
+ data.byte(kTurntoface) = 4;
+ data.byte(kFinaldest) = 4;
+ findXYFromPath();
+ data.byte(kResetmanxy) = 1;
+ showFirstUse();
+ data.word(kWatchingtime) = 72 * 2;
+ data.word(kReeltowatch) = 58;
+ data.word(kEndwatchreel) = 142;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
} /*namespace dreamgen */