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

bluegr md5 at scummvm.org
Sat Dec 17 01:05:45 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:
f9d4886e50 DREAMWEB: Port 'usestereo' to C++


Commit: f9d4886e50dc87535c34ec7c12c1e53fed3a3910
    https://github.com/scummvm/scummvm/commit/f9d4886e50dc87535c34ec7c12c1e53fed3a3910
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-16T16:04:31-08:00

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

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 6d99cb2..2b0e086 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -869,6 +869,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'useroutine',
 	'useshield',
 	'useslab',
+	'usestereo',
 	'usetempcharset',
 	'usetext',
 	'usetimedtext',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0a891cb..939e8c0 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2736,68 +2736,6 @@ lookcolon:
 		goto lookcolon;
 }
 
-void DreamGenContext::useStereo() {
-	STACK_CHECK;
-	_cmp(data.byte(kLocation), 0);
-	if (flags.z())
-		goto stereook;
-	cx = 400;
-	al = 4;
-	showPuzText();
-	putBackObStuff();
-	return;
-stereook:
-	_cmp(data.byte(kMapx), 11);
-	if (!flags.z())
-		goto stereonotok;
-	_cmp(data.byte(kMapy), 0);
-	if (flags.z())
-		goto stereook2;
-stereonotok:
-	cx = 400;
-	al = 5;
-	showPuzText();
-	putBackObStuff();
-	return;
-stereook2:
-	al = 'C';
-	ah = 'D';
-	cl = 'P';
-	ch = 'L';
-	findSetObject();
-	ah = 1;
-	checkInside();
-	_cmp(cl, (114));
-	if (!flags.z())
-		goto cdinside;
-	al = 6;
-	cx = 400;
-	showPuzText();
-	putBackObStuff();
-	getAnyAd();
-	al = 255;
-	es.byte(bx+10) = al;
-	return;
-cdinside:
-	getAnyAd();
-	al = es.byte(bx+10);
-	_xor(al, 1);
-	es.byte(bx+10) = al;
-	_cmp(al, 255);
-	if (flags.z())
-		goto stereoon;
-	al = 7;
-	cx = 400;
-	showPuzText();
-	putBackObStuff();
-	return;
-stereoon:
-	al = 8;
-	cx = 400;
-	showPuzText();
-	putBackObStuff();
-}
-
 void DreamGenContext::selectOb() {
 	STACK_CHECK;
 	findInvPos();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 86768e6..28711bb 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -518,7 +518,6 @@ public:
 	void getEitherAd();
 	void setPickup();
 	void dropObject();
-	void useStereo();
 	void showDiaryKeys();
 	void useOpened();
 	void signOn();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 27a5cee..b2417e7 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -395,6 +395,7 @@
 	void identifyOb();
 	void showSlots();
 	void useCashCard();
+	void useStereo();
 	void checkInside();
 	uint16 checkInside(uint16 command, uint16 type);
 
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index b4e7efd..4be3c7a 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1634,4 +1634,34 @@ void DreamGenContext::useCashCard() {
 	putBackObStuff();
 }
 
+void DreamGenContext::useStereo() {
+	if (data.byte(kLocation) != 0) {
+		showPuzText(4, 400);
+		putBackObStuff();
+	} else if (data.byte(kMapx) != 11) {
+		showPuzText(5, 400);
+		putBackObStuff();
+	} else if (checkInside(findSetObject("CDPL"), 1) == kNumexobjects) {
+		// No CD inside
+		showPuzText(6, 400);
+		putBackObStuff();
+		// TODO: Use the C++ version of getAnyAd()
+		getAnyAd();
+		es.byte(bx + 10) = 255;
+	} else {
+		// CD inside
+		getAnyAd();
+		es.byte(bx + 10) ^= 1;
+		if (es.byte(bx + 10) != 255) {
+			// Stereo off
+			showPuzText(7, 400);
+		} else {
+			// Stereo on
+			showPuzText(8, 400);
+		}
+
+		putBackObStuff();
+	}
+}
+
 } // End of namespace DreamGen






More information about the Scummvm-git-logs mailing list