aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-12-06 01:38:40 +0100
committerBertrand Augereau2011-12-06 02:02:10 +0100
commitbc50c9e45704ab9d664123fc8f4b04c5dbb848f7 (patch)
treead03398e6cdbace22ee43cc4ed8842431b5a1efd
parent2362a3f689a3a87b342339e274a2f29e5125ddf2 (diff)
downloadscummvm-rg350-bc50c9e45704ab9d664123fc8f4b04c5dbb848f7.tar.gz
scummvm-rg350-bc50c9e45704ab9d664123fc8f4b04c5dbb848f7.tar.bz2
scummvm-rg350-bc50c9e45704ab9d664123fc8f4b04c5dbb848f7.zip
DREAMWEB: Ported 'gates' to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp40
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/people.cpp25
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 25 insertions, 43 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index bb8b3dc1c5..76b49d6c53 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -274,6 +274,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'frameoutnm',
'frameoutv',
'gamer',
+ 'gates',
'generalerror',
'getbackfromob',
'getblockofpixel',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index e08e54532e..c6a0950379 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -781,46 +781,6 @@ candles2fin:
showGameReel();
}
-void DreamGenContext::gates() {
- STACK_CHECK;
- checkSpeed();
- if (!flags.z())
- goto gatesfin;
- ax = es.word(bx+3);
- _inc(ax);
- _cmp(ax, 116);
- if (!flags.z())
- goto notbang;
- push(ax);
- push(bx);
- push(es);
- al = 17;
- playChannel1();
- es = pop();
- bx = pop();
- ax = pop();
-notbang:
- _cmp(ax, 110);
- if (flags.c())
- goto slowgates;
- es.byte(bx+5) = 2;
-slowgates:
- _cmp(ax, 120);
- if (!flags.z())
- goto gotgates;
- data.byte(kGetback) = 1;
- ax = 119;
-gotgates:
- es.word(bx+3) = ax;
- push(es);
- push(bx);
- intro3Text();
- bx = pop();
- es = pop();
-gatesfin:
- showGameReel();
-}
-
void DreamGenContext::introMagic2() {
STACK_CHECK;
checkSpeed();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d8cbbefa29..fd294f6be4 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -791,7 +791,6 @@ public:
void dropError();
void callEdensDLift();
void checkInside();
- void gates();
void newGame();
void setWalk();
void findPathOfPoint();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 1d0e77f6f0..c0b0b7a42c 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -45,7 +45,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
&DreamGenContext::mugger, &DreamGenContext::helicopter,
NULL, NULL,
&DreamGenContext::introMagic2, &DreamGenContext::candles2,
- &DreamGenContext::gates, &DreamGenContext::introMagic3,
+ NULL, &DreamGenContext::introMagic3,
&DreamGenContext::introMonks1, NULL,
&DreamGenContext::introMonks2, &DreamGenContext::handClap,
&DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq,
@@ -77,7 +77,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
/*&DreamGenContext::mugger*/NULL, /*&DreamGenContext::helicopter*/NULL,
&DreamGenContext::introMagic1, &DreamGenContext::introMusic,
/*&DreamGenContext::introMagic2*/NULL, /*&DreamGenContext::candles2*/NULL,
- /*&DreamGenContext::gates*/NULL, /*&DreamGenContext::introMagic3*/NULL,
+ &DreamGenContext::gates, /*&DreamGenContext::introMagic3*/NULL,
/*&DreamGenContext::intromonks1*/NULL, &DreamGenContext::candles,
/*&DreamGenContext::intromonks2*/NULL, /*&DreamGenContext::handClap*/NULL,
/*&DreamGenContext::monkAndRyan*/NULL, /*&DreamGenContext::endGameSeq*/NULL,
@@ -388,6 +388,27 @@ void DreamGenContext::candles(ReelRoutine &routine) {
showGameReel(&routine);
}
+void DreamGenContext::gates(ReelRoutine &routine) {
+ if (checkSpeed(routine)) {
+ uint16 nextReelPointer = routine.reelPointer() + 1;
+ if (nextReelPointer == 116)
+ playChannel1(17);
+ if (nextReelPointer >= 110)
+ routine.period = 2;
+ if (nextReelPointer == 120) {
+ data.byte(kGetback) = 1;
+ nextReelPointer = 119;
+ }
+ routine.setReelPointer(nextReelPointer);
+ push(es);
+ push(bx);
+ intro3Text();
+ bx = pop();
+ es = pop();
+ }
+ showGameReel(&routine);
+}
+
void DreamGenContext::security(ReelRoutine &routine) {
if (routine.reelPointer() == 32) {
if (data.byte(kLastweapon) == 1) {
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ad5bc4d217..f20117b991 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -413,6 +413,7 @@
void introMagic1(ReelRoutine &routine);
void introMusic(ReelRoutine &routine);
void candles(ReelRoutine &routine);
+ void gates(ReelRoutine &routine);
void security(ReelRoutine &routine);
void edenInBath(ReelRoutine &routine);
void louis(ReelRoutine &routine);