[Scummvm-cvs-logs] scummvm master -> 45794d1b829c1015f1d79205f2a4b28a811a036a

bluegr md5 at scummvm.org
Thu Dec 15 01:10:16 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:
45794d1b82 DREAMWEB: Port 'describeob', 'additionaltext' to C++


Commit: 45794d1b829c1015f1d79205f2a4b28a811a036a
    https://github.com/scummvm/scummvm/commit/45794d1b829c1015f1d79205f2a4b28a811a036a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-14T16:09:17-08:00

Commit Message:
DREAMWEB: Port 'describeob', 'additionaltext' to C++

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 4cf0b42..824cb92 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -209,6 +209,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'actualload',
 	'actualsave',
 	'addalong',
+	'additionaltext',
 	'addlength',
 	'addtopeoplelist',
 	'addtopresslist',
@@ -318,6 +319,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'delsprite',
 	'deltextline',
 	'delthisone',
+	'describeob',
 	'destselect',
 	'diarykeyp',
 	'diarykeyn',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a33f5a2..b882f9f 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1046,86 +1046,6 @@ void DreamGenContext::openOb() {
 	cs.word(bx) = ax;
 }
 
-void DreamGenContext::describeOb() {
-	STACK_CHECK;
-	getObTextStart();
-	di = 33;
-	bx = 92;
-	_cmp(data.byte(kForeignrelease),  0);
-	if (flags.z())
-		goto notsetd;
-	_cmp(data.byte(kObjecttype), 1);
-	if (!flags.z())
-		goto notsetd;
-	bx = 82;
-notsetd:
-	dl = 241;
-	ah = 16;
-	data.word(kCharshift) = 91+91;
-	printDirect();
-	data.word(kCharshift) = 0;
-	di = 36;
-	bx = 104;
-	_cmp(data.byte(kForeignrelease),  0);
-	if (flags.z())
-		goto notsetd2;
-	_cmp(data.byte(kObjecttype), 1);
-	if (!flags.z())
-		goto notsetd2;
-	bx = 94;
-notsetd2:
-	dl = 241;
-	ah = 0;
-	printDirect();
-	push(bx);
-	obsThatDoThings();
-	bx = pop();
-	additionalText();
-}
-
-void DreamGenContext::additionalText() {
-	STACK_CHECK;
-	_add(bx, 10);
-	push(bx);
-	al = data.byte(kCommand);
-	ah = data.byte(kObjecttype);
-	cl = 'C';
-	ch = 'U';
-	dl = 'P';
-	dh = 'E';
-	compare();
-	if (flags.z())
-		goto emptycup;
-	al = data.byte(kCommand);
-	ah = data.byte(kObjecttype);
-	cl = 'C';
-	ch = 'U';
-	dl = 'P';
-	dh = 'F';
-	compare();
-	if (flags.z())
-		goto fullcup;
-	bx = pop();
-	return;
-emptycup:
-	al = 40;
-	findPuzText();
-	bx = pop();
-	di = 36;
-	dl = 241;
-	ah = 0;
-	printDirect();
-	return;
-fullcup:
-	al = 39;
-	findPuzText();
-	bx = pop();
-	di = 36;
-	dl = 241;
-	ah = 0;
-	printDirect();
-}
-
 void DreamGenContext::getObTextStart() {
 	STACK_CHECK;
 	es = data.word(kFreedesc);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index c1829ec..d1a9471 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -528,7 +528,6 @@ public:
 	void showKeys();
 	void printmessage2();
 	void findOpenPos();
-	void describeOb();
 	void deleteExFrame();
 	void searchForSame();
 	void rollEm();
@@ -553,7 +552,6 @@ public:
 	void findPathOfPoint();
 	void getDestInfo();
 	void read();
-	void additionalText();
 	void mugger();
 	void searchForString();
 	void selectOpenOb();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 01169a8..e721d48 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -3396,6 +3396,33 @@ void DreamGenContext::obsThatDoThings() {
 	}
 }
 
+void DreamGenContext::describeOb() {
+	const uint8 *obText = getObTextStartCPP();
+	uint16 y = 92;
+	if (data.byte(kForeignrelease) && data.byte(kObjecttype) == 1)
+		y = 82;
+	data.word(kCharshift) = 91 + 91;
+	printDirect(obText, 33, y, 241, 241 & 1);
+	data.word(kCharshift) = 0;
+	if (data.byte(kForeignrelease) && data.byte(kObjecttype) == 1)
+		y = 94;
+	printDirect(obText, 36, y, 241, 241 & 1);
+	obsThatDoThings();
+
+	// Additional text
+	if (compare(data.byte(kCommand), data.byte(kObjecttype), "CUPE")) {
+		// Empty cup
+		uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(40 * 2);
+		const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
+		printDirect(string, 36, y + 10, 241, 241 & 1);
+	} else if (compare(data.byte(kCommand), data.byte(kObjecttype), "CUPF")) {
+		// Full cup
+		uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(39 * 2);
+		const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
+		printDirect(string, 36, y + 10, 241, 241 & 1);
+	}
+}
+
 void DreamGenContext::delEverything() {
 	if (data.byte(kMapysize) + data.word(kMapoffsety) < 182) {
 		mapToPanel();
@@ -4272,7 +4299,6 @@ void DreamGenContext::showPuzText() {
 }
 
 void DreamGenContext::showPuzText(uint16 command, uint16 count) {
-	findPuzText(); // FIXME: Unnecessary? (Input: al, Output: es:si)
 	createPanel();
 	showPanel();
 	showMan();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 16d7e67..3413c5e 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -588,5 +588,6 @@
 	uint16 findSetObject(const char *id);
 	void findExObject();
 	uint16 findExObject(const char *id);
+	void describeOb();
 
 #endif






More information about the Scummvm-git-logs mailing list