[Scummvm-cvs-logs] scummvm master -> 9e1481fc07454aa10e4a32db9fe5a56bf32b834c

bluegr md5 at scummvm.org
Mon Dec 12 01:52:10 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:
9e1481fc07 DREAMWEB: Port 'showpuztext' to C++


Commit: 9e1481fc07454aa10e4a32db9fe5a56bf32b834c
    https://github.com/scummvm/scummvm/commit/9e1481fc07454aa10e4a32db9fe5a56bf32b834c
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-11T16:50:58-08:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index e34b00c..f721f87 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -657,6 +657,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'showpanel',
 	'showpcx',
 	'showpointer',
+	'showpuztext',
 	'showrain',
 	'showreelframe',
 	'showrightpage',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index c8d31f7..6137c32 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4796,29 +4796,6 @@ notfoundinside:
 		goto insideloop;
 }
 
-void DreamGenContext::showPuzText() {
-	STACK_CHECK;
-	push(cx);
-	findPuzText();
-	push(es);
-	push(si);
-	createPanel();
-	showPanel();
-	showMan();
-	showExit();
-	obIcons();
-	si = pop();
-	es = pop();
-	di = 36;
-	bx = 104;
-	dl = 241;
-	ah = 0;
-	printDirect();
-	workToScreenM();
-	cx = pop();
-	hangOnP();
-}
-
 void DreamGenContext::findPuzText() {
 	STACK_CHECK;
 	ah = 0;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index b61a980..ba03891 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -636,7 +636,6 @@ public:
 	void useGun();
 	void autoAppear();
 	void useHandle();
-	void showPuzText();
 	void incRyanPage();
 	void findExObject();
 	void clearChanges();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 73f65bb..e9cba0d 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4237,4 +4237,24 @@ void DreamGenContext::newPlace() {
 	}
 }
 
+void DreamGenContext::showPuzText() {
+	showPuzText(al, cx);
+}
+
+void DreamGenContext::showPuzText(uint16 command, uint16 count) {
+	// The original called findPuzText here and saved es:si. We call it below.
+	createPanel();
+	showPanel();
+	showMan();
+	showExit();
+	obIcons();
+	findPuzText();	// we call it here to set es:si correctly
+	uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(command * 2);
+	const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
+	uint16 y = 104;
+	DreamBase::printDirect(&string, 36, &y, 241, 241 & 1);
+	workToScreenM();
+	hangOnP(count);
+}
+
 } // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index e0b9b3e..ad60a1a 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -565,5 +565,7 @@
 	void cantDrop();
 	void getBack1();
 	void newPlace();
+	void showPuzText(uint16 command, uint16 count);
+	void showPuzText();
 
 #endif
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index d328e1d..76ecdc7 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -633,9 +633,7 @@ void DreamGenContext::sLabDoorB() {
 
 		if (flags.z()) {
 			// No crystal
-			al = 44;
-			cx = 200;
-			showPuzText();
+			showPuzText(44, 200);
 			putBackObStuff();
 		} else {
 			// Got crystal
@@ -740,9 +738,7 @@ bool DreamGenContext::defaultUseHandler(const char *id) {
 
 	if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
 		// Wrong item
-		cx = 300;
-		al = 14;
-		showPuzText();
+		showPuzText(14, 300);
 		putBackObStuff();
 		return true;	// event handled
 	}
@@ -834,15 +830,11 @@ void DreamGenContext::usePlate() {
 		data.byte(kGetback) = 1;
 	} else if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) {
 		// Tried knife
-		cx = 300;
-		al = 54;
-		showPuzText();
+		showPuzText(54, 300);
 		putBackObStuff();
 	} else {
 		// Wrong item
-		cx = 300;
-		al = 14;
-		showPuzText();
+		showPuzText(14, 300);
 		putBackObStuff();
 	}
 }
@@ -877,9 +869,7 @@ void DreamGenContext::useElvDoor() {
 		return;
 
 	// Axe on door
-	al = 15;
-	cx = 300;
-	showPuzText();
+	showPuzText(15, 300);
 	_inc(data.byte(kProgresspoints));
 	data.word(kWatchingtime) = 46 * 2;
 	data.word(kReeltowatch) = 31;
@@ -1039,16 +1029,12 @@ void DreamGenContext::useCardReader1() {
 		putBackObStuff();
 	} else if (data.word(kCard1money) != 0) {
 		// No cash
-		cx = 300;
-		al = 17;
-		showPuzText();
+		showPuzText(17, 300);
 		putBackObStuff();
 	} else {
 		// Get cash
 		playChannel1(16);
-		cx = 300;
-		al = 18;
-		showPuzText();
+		showPuzText(18, 300);
 		data.byte(kProgresspoints)++;
 		data.word(kCard1money) = 12432;
 		data.byte(kGetback) = 1;
@@ -1066,21 +1052,15 @@ void DreamGenContext::useCardReader2() {
 		putBackObStuff();
 	} else if (data.byte(kCard1money) == 0) {
 		// No cash
-		cx = 300;
-		al = 20;
-		showPuzText();
+		showPuzText(20, 300);
 		putBackObStuff();
 	} else if (data.byte(kGunpassflag) == 2) {
 		// Already got new
-		cx = 300;
-		al = 22;
-		showPuzText();
+		showPuzText(22, 300);
 		putBackObStuff();
 	} else {
 		playChannel1(18);
-		cx = 300;
-		al = 19;
-		showPuzText();
+		showPuzText(19, 300);
 		placeSetObject(94);
 		data.byte(kGunpassflag) = 1;
 		data.word(kCard1money) -= 2000;
@@ -1100,15 +1080,11 @@ void DreamGenContext::useCardReader3() {
 		putBackObStuff();
 	} else if (data.byte(kCardpassflag) != 0) {
 		// Already used it
-		cx = 300;
-		al = 26;
-		showPuzText();
+		showPuzText(26, 300);
 		putBackObStuff();
 	} else {
 		playChannel1(16);
-		cx = 300;
-		al = 25;
-		showPuzText();
+		showPuzText(25, 300);
 		data.byte(kProgresspoints)++;
 		data.word(kCard1money) -= 8300;
 		data.byte(kCardpassflag) = 1;
@@ -1127,9 +1103,7 @@ void DreamGenContext::useLighter() {
 		showFirstUse();
 		putBackObStuff();
 	} else {
-		cx = 300;
-		al = 9;
-		showPuzText();
+		showPuzText(9, 300);
 		DynObject *withObj = getExAd(data.byte(kWithobject));
 		withObj->mapad[0] = 255;
 		data.byte(kGetback) = 1;






More information about the Scummvm-git-logs mailing list