aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-16 00:15:04 +0200
committerFilippos Karapetis2011-12-16 00:15:04 +0200
commit66618f4e0245bb1f90cd08a1261d57483e73aaae (patch)
tree2621c68596e29348cc8c41154e81a1ab29c39be1 /engines
parent6792fa2fb650d4ac225b4b4352b41fd17323c4c4 (diff)
downloadscummvm-rg350-66618f4e0245bb1f90cd08a1261d57483e73aaae.tar.gz
scummvm-rg350-66618f4e0245bb1f90cd08a1261d57483e73aaae.tar.bz2
scummvm-rg350-66618f4e0245bb1f90cd08a1261d57483e73aaae.zip
DREAMWEB: Port 'endgameseq' to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp63
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/people.cpp41
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 40 insertions, 66 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index e4a5411ed7..804896de5f 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -123,69 +123,6 @@ combatover2:
data.byte(kMandead) = 2;
}
-void DreamGenContext::endGameSeq() {
- STACK_CHECK;
- checkSpeed();
- if (!flags.z())
- goto notendseq;
- ax = es.word(bx+3);
- _inc(ax);
- _cmp(ax, 51);
- if (!flags.z())
- goto gotendseq;
- _cmp(data.byte(kIntrocount), 140);
- if (flags.z())
- goto gotendseq;
- _inc(data.byte(kIntrocount));
- push(es);
- push(bx);
- textForEnd();
- bx = pop();
- es = pop();
- ax = 50;
-gotendseq:
- es.word(bx+3) = ax;
- _cmp(ax, 134);
- if (!flags.z())
- goto notfadedown;
- push(es);
- push(bx);
- push(ax);
- fadeScreenDownHalf();
- ax = pop();
- bx = pop();
- es = pop();
- goto notendseq;
-notfadedown:
- _cmp(ax, 324);
- if (!flags.z())
- goto notfadeend;
- push(es);
- push(bx);
- push(ax);
- fadeScreenDowns();
- data.byte(kVolumeto) = 7;
- data.byte(kVolumedirection) = 1;
- ax = pop();
- bx = pop();
- es = pop();
-notfadeend:
- _cmp(ax, 340);
- if (!flags.z())
- goto notendseq;
- data.byte(kGetback) = 1;
-notendseq:
- showGameReel();
- al = data.byte(kMapy);
- es.byte(bx+2) = al;
- ax = es.word(bx+3);
- _cmp(ax, 145);
- if (!flags.z())
- return /* (notendcreds) */;
- es.word(bx+3) = 146;
- rollEndCredits();
-}
-
void DreamGenContext::checkForExit() {
STACK_CHECK;
cl = data.byte(kRyanx);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 87b769f79e..c47be2f748 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -490,7 +490,6 @@ public:
void fadeScreenDownHalf();
void outOfOpen();
void dirCom();
- void endGameSeq();
void findFirstPath();
void startTalk();
void getAnyAd();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 003921b163..96c9ae89c9 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -48,7 +48,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
- NULL, &DreamGenContext::endGameSeq,
+ NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
@@ -80,7 +80,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
&DreamGenContext::gates, &DreamGenContext::introMagic3,
&DreamGenContext::introMonks1, &DreamGenContext::candles,
&DreamGenContext::introMonks2, &DreamGenContext::handClap,
- &DreamGenContext::monkAndRyan, /*&DreamGenContext::endGameSeq*/NULL,
+ &DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq,
&DreamGenContext::priest, &DreamGenContext::madman,
&DreamGenContext::madmansTelly, &DreamGenContext::alleyBarkSound,
&DreamGenContext::foghornSound, &DreamGenContext::carParkDrip,
@@ -1012,4 +1012,41 @@ void DreamGenContext::businessMan(ReelRoutine &routine) {
}
}
+void DreamGenContext::endGameSeq(ReelRoutine &routine) {
+ if (checkSpeed(routine)) {
+ uint16 nextReelPointer = routine.reelPointer() + 1;
+ if (nextReelPointer == 51 && data.byte(kIntrocount) != 140) {
+ data.byte(kIntrocount)++;
+ textForEnd();
+ nextReelPointer = 50;
+ }
+
+ routine.setReelPointer(nextReelPointer);
+ if (nextReelPointer == 134) {
+ push(es);
+ push(bx);
+ push(ax);
+ fadeScreenDownHalf();
+ ax = pop();
+ bx = pop();
+ es = pop();
+ } else if (nextReelPointer == 324) {
+ fadeScreenDowns();
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
+ }
+
+ if (nextReelPointer == 340)
+ data.byte(kGetback) = 1;
+ }
+
+ showGameReel(&routine);
+ routine.mapY = data.byte(kMapy);
+
+ if (routine.reelPointer() == 145) {
+ routine.setReelPointer(146);
+ rollEndCredits();
+ }
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 5b012d580e..0ee4171470 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -384,6 +384,7 @@
void helicopter(ReelRoutine &routine);
void mugger(ReelRoutine &routine);
void businessMan(ReelRoutine &routine);
+ void endGameSeq(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
uint8 nextSymbol(uint8 symbol);