aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-08 11:37:35 +0200
committerFilippos Karapetis2011-12-08 11:37:35 +0200
commit87e60f843085fc0ae3ab9a513e22177ab5bc5816 (patch)
tree05f92d7e745701378c5931705e522fe7a39e4579
parent5b32729e55447c0557cbcbdda79f12525362cc11 (diff)
downloadscummvm-rg350-87e60f843085fc0ae3ab9a513e22177ab5bc5816.tar.gz
scummvm-rg350-87e60f843085fc0ae3ab9a513e22177ab5bc5816.tar.bz2
scummvm-rg350-87e60f843085fc0ae3ab9a513e22177ab5bc5816.zip
DREAMWEB: Port 'copper' to C++. Remove 'advisor' (unused)
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreamgen.cpp67
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/people.cpp23
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 24 insertions, 71 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 76cbca9a40..8d5ad953d5 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -149,6 +149,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'addtopeoplelist',
'addtopresslist',
'adjustlen',
+ 'advisor',
'afterintroroom',
'aide',
'alleybarksound',
@@ -227,6 +228,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'convertkey',
'convicons',
'convnum',
+ 'copper',
'copyname',
'createfile',
'createpanel',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8fc7ca1f5e..b8bdbe6291 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -790,73 +790,6 @@ gotnext:
fadeScreenUpHalf();
}
-void DreamGenContext::advisor() {
- STACK_CHECK;
- checkSpeed();
- if (!flags.z())
- goto noadvisor;
- goto noadvisor;
- ax = es.word(bx+3);
- _inc(ax);
- _cmp(ax, 123);
- if (!flags.z())
- goto notendadvis;
- ax = 106;
- goto gotadvframe;
-notendadvis:
- _cmp(ax, 108);
- if (!flags.z())
- goto gotadvframe;
- push(ax);
- randomNumber();
- cl = al;
- ax = pop();
- _cmp(cl, 3);
- if (flags.c())
- goto gotadvframe;
- ax = 106;
-gotadvframe:
- es.word(bx+3) = ax;
-noadvisor:
- showGameReel();
- addToPeopleList();
-}
-
-void DreamGenContext::copper() {
- STACK_CHECK;
- checkSpeed();
- if (!flags.z())
- goto nocopper;
- ax = es.word(bx+3);
- _inc(ax);
- _cmp(ax, 94);
- if (!flags.z())
- goto notendcopper;
- ax = 64;
- goto gotcopframe;
-notendcopper:
- _cmp(ax, 81);
- if (flags.z())
- goto mightwait;
- _cmp(ax, 66);
- if (!flags.z())
- goto gotcopframe;
-mightwait:
- push(ax);
- randomNumber();
- cl = al;
- ax = pop();
- _cmp(cl, 7);
- if (flags.c())
- goto gotcopframe;
- _dec(ax);
-gotcopframe:
- es.word(bx+3) = ax;
-nocopper:
- showGameReel();
- addToPeopleList();
-}
-
void DreamGenContext::checkForExit() {
STACK_CHECK;
cl = data.byte(kRyanx);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 39711a4ee9..b7ec416221 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -606,10 +606,8 @@ public:
void dirFile();
void pickupConts();
void lockLightOff();
- void advisor();
void allPalette();
void cantDrop();
- void copper();
void placeFreeObject();
void putUnderZoom();
void findInvPos();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 403f8f1912..cd1f2d4d2a 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -39,7 +39,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
- &DreamGenContext::copper, &DreamGenContext::poolGuard,
+ NULL, &DreamGenContext::poolGuard,
NULL, &DreamGenContext::businessMan,
NULL, NULL,
&DreamGenContext::mugger, &DreamGenContext::helicopter,
@@ -71,7 +71,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
&DreamGenContext::genericPerson /*tattooMan*/, &DreamGenContext::attendant,
&DreamGenContext::keeper, &DreamGenContext::candles1,
&DreamGenContext::smallCandle, &DreamGenContext::security,
- /*&DreamGenContext::copper*/NULL, /*&DreamGenContext::poolGuard*/NULL,
+ &DreamGenContext::copper, /*&DreamGenContext::poolGuard*/NULL,
&DreamGenContext::rockstar, /*&DreamGenContext::businessMan*/NULL,
&DreamGenContext::train, &DreamGenContext::genericPerson /*aide*/,
/*&DreamGenContext::mugger*/NULL, /*&DreamGenContext::helicopter*/NULL,
@@ -569,6 +569,7 @@ void DreamGenContext::foghornSound(ReelRoutine &routine) {
}
void DreamGenContext::train(ReelRoutine &routine) {
+ // The original code has logic for this, but it is disabled
}
void DreamGenContext::louisChair(ReelRoutine &routine) {
@@ -669,4 +670,22 @@ void DreamGenContext::monkAndRyan(ReelRoutine &routine) {
showGameReel(&routine);
}
+void DreamGenContext::copper(ReelRoutine &routine) {
+ if (checkSpeed(routine)) {
+ uint16 nextReelPointer = routine.reelPointer() + 1;
+ if (nextReelPointer == 94) {
+ nextReelPointer = 64;
+ } else if (nextReelPointer == 81 || nextReelPointer == 66) {
+ // Might wait
+ if (engine->randomNumber() >= 7)
+ nextReelPointer--;
+ }
+
+ routine.setReelPointer(nextReelPointer);
+ }
+
+ showGameReel(&routine);
+ addToPeopleList(&routine);
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index fe1706c9c5..937dac1f64 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -431,6 +431,7 @@
void priest(ReelRoutine &routine);
void priestText(ReelRoutine &routine);
void monkAndRyan(ReelRoutine &routine);
+ void copper(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
void loadKeypad();