[Scummvm-cvs-logs] scummvm master -> 6792fa2fb650d4ac225b4b4352b41fd17323c4c4

bluegr md5 at scummvm.org
Thu Dec 15 23:04:06 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:
6792fa2fb6 DREAMWEB: Port 'businessman' to C++


Commit: 6792fa2fb650d4ac225b4b4352b41fd17323c4c4
    https://github.com/scummvm/scummvm/commit/6792fa2fb650d4ac225b4b4352b41fd17323c4c4
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-15T14:02:57-08:00

Commit Message:
DREAMWEB: Port 'businessman' to C++

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 bb350fc..89a830b 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -250,6 +250,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'bossman',
 	'bothchannels',
 	'bresenhams',
+	'businessman',
 	'buttoneight',
 	'buttonenter',
 	'buttonfive',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8892c84..e4a5411 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -26,103 +26,6 @@
 
 namespace DreamGen {
 
-void DreamGenContext::businessMan() {
-	STACK_CHECK;
-	data.byte(kPointermode) = 0;
-	data.word(kWatchingtime) = 2;
-	ax = es.word(bx+3);
-	_cmp(ax, 2);
-	if (!flags.z())
-		goto notfirstbiz;
-	push(ax);
-	push(bx);
-	push(es);
-	al = 49;
-	cx = 30;
-	dx = 1;
-	bl = 68;
-	bh = 174;
-	setupTimedUse();
-	es = pop();
-	bx = pop();
-	ax = pop();
-notfirstbiz:
-	_cmp(ax, 95);
-	if (flags.z())
-		goto buscombatwonend;
-	_cmp(ax, 49);
-	if (flags.z())
-		return /* (buscombatend) */;
-	checkSpeed();
-	if (!flags.z())
-		goto busspeed;
-	ax = es.word(bx+3);
-	_inc(ax);
-	_cmp(ax, 48);
-	if (!flags.z())
-		goto notbeforedeadb;
-	data.byte(kMandead) = 2;
-	goto gotbusframe;
-notbeforedeadb:
-	_cmp(ax, 15);
-	if (!flags.z())
-		goto buscombatwon;
-	_dec(ax);
-	_cmp(data.byte(kLastweapon), 3);
-	if (!flags.z())
-		goto notshieldonbus;
-	data.byte(kLastweapon) = -1;
-	data.byte(kCombatcount) = 0;
-	ax = 51;
-	goto gotbusframe;
-notshieldonbus:
-	_inc(data.byte(kCombatcount));
-	_cmp(data.byte(kCombatcount), 20);
-	if (!flags.z())
-		goto gotbusframe;
-	data.byte(kCombatcount) = 0;
-	ax = 15;
-	goto gotbusframe;
-buscombatwon:
-	_cmp(ax, 91);
-	if (!flags.z())
-		goto gotbusframe;
-	push(bx);
-	push(es);
-	al = 0;
-	turnPathOn();
-	al = 1;
-	turnPathOn();
-	al = 2;
-	turnPathOn();
-	al = 3;
-	turnPathOff();
-	data.byte(kManspath) = 5;
-	data.byte(kFinaldest) = 5;
-	findXYFromPath();
-	data.byte(kResetmanxy) = 1;
-	es = pop();
-	bx = pop();
-	ax = 92;
-	goto gotbusframe;
-gotbusframe:
-	es.word(bx+3) = ax;
-busspeed:
-	showGameReel();
-	al = data.byte(kMapy);
-	es.byte(bx+2) = al;
-	ax = es.word(bx+3);
-	_cmp(ax, 14);
-	if (!flags.z())
-		return /* (buscombatend) */;
-	data.word(kWatchingtime) = 0;
-	data.byte(kPointermode) = 2;
-	return;
-buscombatwonend:
-	data.byte(kPointermode) = 0;
-	data.word(kWatchingtime) = 0;
-}
-
 void DreamGenContext::poolGuard() {
 	STACK_CHECK;
 	ax = es.word(bx+3);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 5a61fcb..87b769f 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -509,7 +509,6 @@ public:
 	void selectOb();
 	void fadeUpMon();
 	void reExFromInv();
-	void businessMan();
 	void outOfInv();
 	void transferMap();
 	void purgeAnItem();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index e4e3682..003921b 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -40,7 +40,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
 	NULL, NULL,
 	NULL, NULL,
 	NULL, &DreamGenContext::poolGuard,
-	NULL, &DreamGenContext::businessMan,
+	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
@@ -72,7 +72,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
 	&DreamGenContext::keeper, &DreamGenContext::candles1,
 	&DreamGenContext::smallCandle, &DreamGenContext::security,
 	&DreamGenContext::copper, /*&DreamGenContext::poolGuard*/NULL,
-	&DreamGenContext::rockstar, /*&DreamGenContext::businessMan*/NULL,
+	&DreamGenContext::rockstar, &DreamGenContext::businessMan,
 	&DreamGenContext::train, &DreamGenContext::genericPerson /*aide*/,
 	&DreamGenContext::mugger, &DreamGenContext::helicopter,
 	&DreamGenContext::introMagic1, &DreamGenContext::introMusic,
@@ -948,4 +948,68 @@ void DreamGenContext::mugger(ReelRoutine &routine) {
 	}
 }
 
+void DreamGenContext::businessMan(ReelRoutine &routine) {
+	data.byte(kPointermode) = 0;
+	data.word(kWatchingtime) = 2;
+	if (routine.reelPointer() == 2) {
+		// First
+		DreamBase::setupTimedUse(49, 30, 1, 68, 174);
+		return;
+	}
+
+	if (routine.reelPointer() == 95) {
+		// Bus combat won - end
+		data.byte(kPointermode) = 0;
+		data.word(kWatchingtime) = 0;
+		return;
+	}
+
+	if (routine.reelPointer() == 49)
+		return; // buscombatend
+
+	if (checkSpeed(routine)) {
+		uint16 nextReelPointer = routine.reelPointer() + 1;
+		if (nextReelPointer == 48) {
+			data.byte(kMandead) = 2;	// before dead body
+		} else if (nextReelPointer == 15) {
+			nextReelPointer--;
+			if (data.byte(kLastweapon) == 3) {
+				// Shield bonus
+				data.byte(kLastweapon) = (byte)-1;
+				data.byte(kCombatcount) = 0;
+				nextReelPointer = 51;
+			} else {
+				// No shield bonus
+				data.byte(kCombatcount)++;
+				if (data.byte(kCombatcount) == 20) {
+					data.byte(kCombatcount) = 0;
+					nextReelPointer = 15;
+				}
+			}
+		} else {
+			// Bus combat won
+			if (nextReelPointer == 91) {
+				turnPathOn(0);
+				turnPathOn(1);
+				turnPathOn(2);
+				turnPathOff(3);
+				data.byte(kManspath) = 5;
+				data.byte(kFinaldest) = 5;
+				findXYFromPath();
+				data.byte(kResetmanxy) = 1;
+				nextReelPointer = 92;
+			}
+		}
+		
+		routine.setReelPointer(nextReelPointer);
+	}
+
+	showGameReel(&routine);
+	routine.mapY = data.byte(kMapy);
+	if (routine.reelPointer() == 14) {
+		data.word(kWatchingtime) = 0;
+		data.byte(kPointermode) = 2;
+	}
+}
+
 } // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 33e43eb..5b012d5 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -383,6 +383,7 @@
 	void heavy(ReelRoutine &routine);
 	void helicopter(ReelRoutine &routine);
 	void mugger(ReelRoutine &routine);
+	void businessMan(ReelRoutine &routine);
 	void singleKey(uint8 key, uint16 x, uint16 y);
 	void loadSaveBox();
 	uint8 nextSymbol(uint8 symbol);






More information about the Scummvm-git-logs mailing list