[Scummvm-cvs-logs] scummvm master -> 1434bb35af0fc0c1896b603c05bc3eb4a9561789

bluegr md5 at scummvm.org
Tue Dec 6 13:14:44 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:
1434bb35af DREAMWEB: 'opentvdoor', 'useclearbox' ported to C++. Some cleanup.


Commit: 1434bb35af0fc0c1896b603c05bc3eb4a9561789
    https://github.com/scummvm/scummvm/commit/1434bb35af0fc0c1896b603c05bc3eb4a9561789
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-06T04:13:54-08:00

Commit Message:
DREAMWEB: 'opentvdoor', 'useclearbox' ported to C++. Some cleanup.

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 56f968e..11dea32 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -421,6 +421,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'openpoolboss',
 	'openryan'
 	'opensarters',
+	'opentvdoor',
 	'openyourneighbour',
 	'othersmoker',
 	'out22c',
@@ -582,6 +583,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'usecharset1',
 	'usechurchgate',
 	'usechurchhole',
+	'useclearbox',
 	'usecoveredbox',
 	'usedryer',
 	'useelevator1',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a2f75bd..4f8792c 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5611,39 +5611,6 @@ nextcart:
 	data.byte(kGetback) = 1;
 }
 
-void DreamGenContext::useClearBox() {
-	STACK_CHECK;
-	_cmp(data.byte(kWithobject), 255);
-	if (!flags.z())
-		goto clearboxwith;
-	withWhat();
-	return;
-clearboxwith:
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'R';
-	ch = 'A';
-	dl = 'I';
-	dh = 'L';
-	compare();
-	if (flags.z())
-		goto openbox;
-	cx = 300;
-	al = 14;
-	showPuzText();
-	putBackObStuff();
-	return;
-openbox:
-	_inc(data.byte(kProgresspoints));
-	showFirstUse();
-	data.word(kWatchingtime) = 80;
-	data.word(kReeltowatch) = 67;
-	data.word(kEndwatchreel) = 105;
-	data.byte(kWatchspeed) = 1;
-	data.byte(kSpeedcount) = 1;
-	data.byte(kGetback) = 1;
-}
-
 void DreamGenContext::useOpenBox() {
 	STACK_CHECK;
 	_cmp(data.byte(kWithobject), 255);
@@ -5776,34 +5743,6 @@ thingsonaltar:
 	data.byte(kGetback) = 1;
 }
 
-void DreamGenContext::openTVDoor() {
-	STACK_CHECK;
-	_cmp(data.byte(kWithobject), 255);
-	if (!flags.z())
-		goto tvdoorwith;
-	withWhat();
-	return;
-tvdoorwith:
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'U';
-	ch = 'L';
-	dl = 'O';
-	dh = 'K';
-	compare();
-	if (flags.z())
-		goto keyontv;
-	cx = 300;
-	al = 14;
-	showPuzText();
-	putBackObStuff();
-	return;
-keyontv:
-	showFirstUse();
-	data.byte(kLockstatus) = 0;
-	data.byte(kGetback) = 1;
-}
-
 void DreamGenContext::nextColon() {
 	STACK_CHECK;
 lookcolon:
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a504450..2c870ec 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -608,7 +608,6 @@ public:
 	void lookInInterface();
 	void loadSpeech();
 	void adjustLeft();
-	void useClearBox();
 	void entryAnims();
 	void getFreeAd();
 	void showArrows();
@@ -734,7 +733,6 @@ public:
 	void showGun();
 	void louisChair();
 	void locationPic();
-	void openTVDoor();
 	void triggerMessage();
 	void smallCandle();
 	void swapWithOpen();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6b90f74..18942e5 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -399,6 +399,8 @@
 	void useWall();
 	void useChurchGate();
 	void useFullCart();
+	void useClearBox();
+	void openTVDoor();
 	void wearWatch();
 	void wearShades();
 	void checkFolderCoords();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 5bc8a4f..d33ad97 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -331,13 +331,13 @@ void DreamGenContext::useShield() {
 		data.byte(kLastweapon) = 3;
 		showSecondUse();
 		data.byte(kGetback) = 1;
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		removeObFromInv();
 	}
 }
 
 void DreamGenContext::useCoveredBox() {
-	data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+	data.byte(kProgresspoints)++;
 	showFirstUse();
 	data.word(kWatchingtime) = 50;
 	data.word(kReeltowatch) = 41;
@@ -429,7 +429,7 @@ void DreamGenContext::useBalcony() {
 	turnPathOff(3);
 	turnPathOff(4);
 	turnPathOff(5);
-	data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+	data.byte(kProgresspoints)++;
 	data.byte(kManspath) = 6;
 	data.byte(kDestination) = 6;
 	data.byte(kFinaldest) = 6;
@@ -450,7 +450,7 @@ void DreamGenContext::useWindow() {
 		showSecondUse();
 		putBackObStuff();
 	} else {
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		showFirstUse();
 		data.byte(kNewlocation) = 29;
 		data.byte(kGetback) = 1;
@@ -458,7 +458,7 @@ void DreamGenContext::useWindow() {
 }
 
 void DreamGenContext::trapDoor() {
-	data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+	data.byte(kProgresspoints)++;
 	showFirstUse();
 	switchRyanOff();
 	data.word(kWatchingtime) = 20 * 2;
@@ -605,7 +605,7 @@ void DreamGenContext::sLabDoorA() {
 		data.byte(kWatchspeed) = 1;
 		data.byte(kSpeedcount) = 1;
 	} else {
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		data.word(kWatchingtime) = 60;
 		data.word(kEndwatchreel) = 42;
 		data.byte(kNewlocation) = 47;
@@ -625,7 +625,7 @@ void DreamGenContext::sLabDoorC() {
 		data.byte(kWatchspeed) = 1;
 		data.byte(kSpeedcount) = 1;
 	} else {
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		data.word(kWatchingtime) = 60;
 		data.word(kEndwatchreel) = 135;
 		data.byte(kNewlocation) = 47;
@@ -645,7 +645,7 @@ void DreamGenContext::sLabDoorD() {
 		data.byte(kWatchspeed) = 1;
 		data.byte(kSpeedcount) = 1;
 	} else {
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		data.word(kWatchingtime) = 60;
 		data.word(kEndwatchreel) = 102;
 		data.byte(kNewlocation) = 47;
@@ -665,7 +665,7 @@ void DreamGenContext::sLabDoorE() {
 		data.byte(kWatchspeed) = 1;
 		data.byte(kSpeedcount) = 1;
 	} else {
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		data.word(kWatchingtime) = 60;
 		data.word(kEndwatchreel) = 168;
 		data.byte(kNewlocation) = 47;
@@ -685,7 +685,7 @@ void DreamGenContext::sLabDoorF() {
 		data.byte(kWatchspeed) = 1;
 		data.byte(kSpeedcount) = 1;
 	} else {
-		data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1;
+		data.byte(kProgresspoints)++;
 		data.word(kWatchingtime) = 60;
 		data.word(kEndwatchreel) = 197;
 		data.byte(kNewlocation) = 47;
@@ -739,4 +739,51 @@ void DreamGenContext::useFullCart() {
 	data.byte(kGetback) = 1;
 }
 
+void DreamGenContext::useClearBox() {
+	if (data.byte(kWithobject) == 255) {
+		withWhat();
+		return;
+	}
+
+	char id[4] = { 'R', 'A', 'I', 'L' };	// TODO: convert to string with trailing zero
+	if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+		// Wrong item
+		cx = 300;
+		al = 14;
+		showPuzText();
+		putBackObStuff();
+	} else {
+		// Open box
+		data.byte(kProgresspoints)++;
+		showFirstUse();
+		data.word(kWatchingtime) = 80;
+		data.word(kReeltowatch) = 67;
+		data.word(kEndwatchreel) = 105;
+		data.byte(kWatchspeed) = 1;
+		data.byte(kSpeedcount) = 1;
+		data.byte(kGetback) = 1;
+	}
+}
+
+void DreamGenContext::openTVDoor() {
+	if (data.byte(kWithobject) == 255) {
+		withWhat();
+		return;
+	}
+
+	char id[4] = { 'U', 'L', 'O', 'K' };	// TODO: convert to string with trailing zero
+	if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+		// Wrong item
+		cx = 300;
+		al = 14;
+		showPuzText();
+		putBackObStuff();
+	} else {
+		// Key on TV
+		showFirstUse();
+		data.byte(kLockstatus) = 0;
+		data.byte(kGetback) = 1;
+	}
+}
+
 } /*namespace dreamgen */






More information about the Scummvm-git-logs mailing list