[Scummvm-cvs-logs] scummvm master -> 87e60f843085fc0ae3ab9a513e22177ab5bc5816

bluegr md5 at scummvm.org
Thu Dec 8 10:38:15 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
87e60f8430 DREAMWEB: Port 'copper' to C++. Remove 'advisor' (unused)


Commit: 87e60f843085fc0ae3ab9a513e22177ab5bc5816
    https://github.com/scummvm/scummvm/commit/87e60f843085fc0ae3ab9a513e22177ab5bc5816
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-08T01:37:35-08:00

Commit Message:
DREAMWEB: Port 'copper' to C++. Remove 'advisor' (unused)

Changed paths:
    devtools/tasmrecover/tasm-recover
    engines/dreamweb/dreamgen.cpp
    engines/dreamweb/dreamgen.h
    engines/dreamweb/people.cpp
    engines/dreamweb/stubs.h



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 76cbca9..8d5ad95 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 8fc7ca1..b8bdbe6 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 39711a4..b7ec416 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 403f8f1..cd1f2d4 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 fe1706c..937dac1 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();






More information about the Scummvm-git-logs mailing list