[Scummvm-cvs-logs] scummvm master -> f9419db947a8d1cb42ee389b377c7ec6030ad9dd

bluegr md5 at scummvm.org
Tue Dec 13 21:40:30 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:
f9419db947 DREAMWEB: Port 'bartender' and 'receptionist' to C++


Commit: f9419db947a8d1cb42ee389b377c7ec6030ad9dd
    https://github.com/scummvm/scummvm/commit/f9419db947a8d1cb42ee389b377c7ec6030ad9dd
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-13T12:39:34-08:00

Commit Message:
DREAMWEB: Port 'bartender' and 'receptionist' 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 c1f2872..42f6e27 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -229,6 +229,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'autolook',
 	'autosetwalk',
 	'backobject',
+	'bartender',
 	'barwoman',
 	'biblequote',
 	'blank',
@@ -637,6 +638,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'readoneblock',
 	'readsetdata',
 	'realcredits',
+	'receptionist',
 	'reconstruct',
 	'redes',
 	'redrawmainscrn',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 6394257..83b86f9 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -26,87 +26,6 @@
 
 namespace DreamGen {
 
-void DreamGenContext::receptionist() {
-	STACK_CHECK;
-	checkSpeed();
-	if (!flags.z())
-		goto gotrecep;
-	_cmp(data.byte(kCardpassflag), 1);
-	if (!flags.z())
-		goto notsetcard;
-	_inc(data.byte(kCardpassflag));
-	es.byte(bx+7) = 1;
-	es.word(bx+3) = 64;
-notsetcard:
-	_cmp(es.word(bx+3), 58);
-	if (!flags.z())
-		goto notdes1;
-	randomNumber();
-	_cmp(al, 30);
-	if (flags.c())
-		goto notdes2;
-	es.word(bx+3) = 55;
-	goto gotrecep;
-notdes1:
-	_cmp(es.word(bx+3), 60);
-	if (!flags.z())
-		goto notdes2;
-	randomNumber();
-	_cmp(al, 240);
-	if (flags.c())
-		goto gotrecep;
-	es.word(bx+3) = 53;
-	goto gotrecep;
-notdes2:
-	_cmp(es.word(bx+3), 88);
-	if (!flags.z())
-		goto notendcard;
-	es.word(bx+3) = 53;
-	goto gotrecep;
-notendcard:
-	_inc(es.word(bx+3));
-gotrecep:
-	showGameReel();
-	addToPeopleList();
-	al = es.byte(bx+7);
-	_and(al, 128);
-	if (flags.z())
-		return /* (nottalkedrecep) */;
-	data.byte(kTalkedtorecep) = 1;
-}
-
-void DreamGenContext::bartender() {
-	STACK_CHECK;
-	checkSpeed();
-	if (!flags.z())
-		goto gotsmoket;
-	_cmp(es.word(bx+3), 86);
-	if (!flags.z())
-		goto notsmoket1;
-	randomNumber();
-	_cmp(al, 18);
-	if (flags.c())
-		goto notsmoket2;
-	es.word(bx+3) = 81;
-	goto gotsmoket;
-notsmoket1:
-	_cmp(es.word(bx+3), 103);
-	if (!flags.z())
-		goto notsmoket2;
-	es.word(bx+3) = 81;
-	goto gotsmoket;
-notsmoket2:
-	_inc(es.word(bx+3));
-gotsmoket:
-	showGameReel();
-	_cmp(data.byte(kGunpassflag), 1);
-	if (!flags.z())
-		goto notgotgun;
-	es.byte(bx+7) = 9;
-notgotgun:
-	addToPeopleList();
-}
-
 void DreamGenContext::helicopter() {
 	STACK_CHECK;
 	ax = es.word(bx+3);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index b7fb249..a8e8a61 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -499,7 +499,6 @@ public:
 	void adjustUp();
 	void fadeScreenDownHalf();
 	void fadeDownMon();
-	void bartender();
 	void outOfOpen();
 	void dirCom();
 	void endGameSeq();
@@ -523,7 +522,6 @@ public:
 	void findInvPos();
 	void getKeyAndLogo();
 	void selectOb();
-	void receptionist();
 	void fadeUpMon();
 	void showDiaryPage();
 	void reExFromInv();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 84f6543..caaea26 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -29,13 +29,13 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
-	&DreamGenContext::receptionist, NULL,
+	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
 	&DreamGenContext::heavy, NULL,
 	NULL, NULL,
-	&DreamGenContext::bartender, NULL,
+	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
@@ -61,13 +61,13 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
 	&DreamGenContext::eden, &DreamGenContext::edenInBath,
 	&DreamGenContext::sparky, &DreamGenContext::smokeBloke,
 	&DreamGenContext::manAsleep, &DreamGenContext::drunk,
-	/*&DreamGenContext::receptionist*/NULL, &DreamGenContext::genericPerson /*maleFan*/,
+	&DreamGenContext::receptionist, &DreamGenContext::genericPerson /*maleFan*/,
 	&DreamGenContext::genericPerson /*femaleFan*/, &DreamGenContext::louis,
 	&DreamGenContext::louisChair, &DreamGenContext::soldier1,
 	&DreamGenContext::bossMan, &DreamGenContext::interviewer,
 	/*&DreamGenContext::heavy*/NULL, &DreamGenContext::manAsleep /*manAsleep2*/,
 	&DreamGenContext::genericPerson /*manSatStill*/, &DreamGenContext::drinker,
-	/*&DreamGenContext::bartender*/NULL, &DreamGenContext::genericPerson /*otherSmoker*/,
+	&DreamGenContext::bartender, &DreamGenContext::genericPerson /*otherSmoker*/,
 	&DreamGenContext::genericPerson /*tattooMan*/, &DreamGenContext::attendant,
 	&DreamGenContext::keeper, &DreamGenContext::candles1,
 	&DreamGenContext::smallCandle, &DreamGenContext::security,
@@ -777,4 +777,62 @@ void DreamGenContext::soldier1(ReelRoutine &routine) {
 	addToPeopleList(&routine);
 }
 
+void DreamGenContext::receptionist(ReelRoutine &routine) {
+	if (checkSpeed(routine)) {
+		if (data.byte(kCardpassflag) == 1) {
+			// Set card
+			data.byte(kCardpassflag)++;
+			routine.b7 = 1;
+			routine.b3 = 64;
+		}
+
+		if (routine.b3 != 58) {
+			// notdes1
+			if (routine.b3 != 60) {
+				// notdes2
+				if (routine.b3 != 88)
+					routine.b3++;	// not end card
+				else
+					routine.b3 = 53;
+			} else if (engine->randomNumber() >= 240) {
+				routine.b3 = 53;
+			}
+		} else if (engine->randomNumber() >= 30) {
+			routine.b3 = 55;
+		} else {
+			// notdes2
+			if (routine.b3 != 88)
+				routine.b3++;	// not end card
+			else
+				routine.b3 = 53;
+		}
+	}
+
+	showGameReel(&routine);
+	addToPeopleList(&routine);
+	if (routine.b7 & 128)
+		data.byte(kTalkedtorecep) = 1;
+}
+
+void DreamGenContext::bartender(ReelRoutine &routine) {
+	if (checkSpeed(routine)) {
+		if (routine.b3 == 86) {
+			if (engine->randomNumber() >= 18)
+				routine.b3 = 81;
+			else
+				routine.b3++;	// notsmoket2
+		} else if (routine.b3 == 103) {
+			routine.b3 = 81;	// notsmoket1
+		} else {
+			routine.b3++;	// notsmoket2
+		}
+	}
+
+	showGameReel(&routine);
+	if (data.byte(kGunpassflag) == 1)
+		routine.b7 = 9;	// got gun
+
+	addToPeopleList(&routine);
+}
+
 } // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6a8445b..5256111 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -417,6 +417,8 @@
 	void introMonks1(ReelRoutine &routine);
 	void introMonks2(ReelRoutine &routine);
 	void soldier1(ReelRoutine &routine);
+	void receptionist(ReelRoutine &routine);
+	void bartender(ReelRoutine &routine);
 	void singleKey(uint8 key, uint16 x, uint16 y);
 	void loadSaveBox();
 	void loadKeypad();






More information about the Scummvm-git-logs mailing list