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

tramboi bertrand_augereau at yahoo.fr
Wed Sep 7 04:08:28 CEST 2011


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
09a734bd25 DREAMWEB: 'findnextcolon' ported to C++
3884ec6355 DREAMWEB: 'getobtextstart' C++ wrapper
ef1eb9ba24 DREAMWEB: 'usetext' ported to C++
ad3b70b539 DREAMWEB: Simpler flavour of 'printdirect' for cases when the output layout information is not needed by the client
bf5b2244c6 DREAMWEB: Cleaning of 'useroutine' using new functions


Commit: 09a734bd25a341ec0483f28c77406d6de41ab30f
    https://github.com/scummvm/scummvm/commit/09a734bd25a341ec0483f28c77406d6de41ab30f
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-06T18:41:05-07:00

Commit Message:
DREAMWEB: 'findnextcolon' ported 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 7b317e4..33e232b 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -194,6 +194,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'useroutine',
 	'hangon',
 	'hangonp',
+	'findnextcolon',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 068f3fc..5c71dc9 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4253,19 +4253,6 @@ foundmatch:
 	bx = pop();
 }
 
-void DreamGenContext::findnextcolon() {
-	STACK_CHECK;
-isntcolon:
-	al = es.byte(si);
-	_inc(si);
-	_cmp(al, 0);
-	if (flags.z())
-		return /* (endofcolon) */;
-	_cmp(al, ':');
-	if (!flags.z())
-		goto isntcolon;
-}
-
 void DreamGenContext::inventory() {
 	STACK_CHECK;
 	_cmp(data.byte(kMandead), 1);
@@ -17072,7 +17059,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_obsthatdothings: obsthatdothings(); break;
 		case addr_getobtextstart: getobtextstart(); break;
 		case addr_searchforsame: searchforsame(); break;
-		case addr_findnextcolon: findnextcolon(); break;
 		case addr_inventory: inventory(); break;
 		case addr_setpickup: setpickup(); break;
 		case addr_examinventory: examinventory(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6db6f73..9e209f7 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -477,7 +477,6 @@ public:
 	static const uint16 addr_examinventory = 0xc384;
 	static const uint16 addr_setpickup = 0xc380;
 	static const uint16 addr_inventory = 0xc37c;
-	static const uint16 addr_findnextcolon = 0xc378;
 	static const uint16 addr_searchforsame = 0xc374;
 	static const uint16 addr_getobtextstart = 0xc370;
 	static const uint16 addr_obsthatdothings = 0xc36c;
@@ -1852,7 +1851,7 @@ public:
 	void soundonreels();
 	void usegun();
 	void autoappear();
-	void findnextcolon();
+	//void findnextcolon();
 	//void readmouse4();
 	void openryan();
 	void callhotellift();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 60bd317..bd589b2 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1899,5 +1899,22 @@ void DreamGenContext::hangonp(uint16 count) {
 	data.byte(kPointermode) = 0;
 }
 
+void DreamGenContext::findnextcolon() {
+	uint8 *initialString = es.ptr(si, 0);
+	uint8 *string = initialString;
+	al = findnextcolon(&string);
+	si += (string - initialString);
+}
+
+uint8 DreamGenContext::findnextcolon(uint8 **string) {
+	uint8 c;
+	do {
+		c = **string;
+		++(*string);
+	} while ((c != 0) && (c != ':'));
+	return c;
+}
+
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 943d890..3149363 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -235,5 +235,6 @@
 	void hangon(uint16 frameCount);
 	void hangonp();
 	void hangonp(uint16 count);
-
+	uint8 findnextcolon(uint8 **string);
+	void findnextcolon();
 


Commit: 3884ec6355d4445c278d9d011d16940c3ef8697b
    https://github.com/scummvm/scummvm/commit/3884ec6355d4445c278d9d011d16940c3ef8697b
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-06T18:44:40-07:00

Commit Message:
DREAMWEB: 'getobtextstart' C++ wrapper

Changed paths:
    engines/dreamweb/stubs.cpp
    engines/dreamweb/stubs.h



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index bd589b2..034f794 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1915,6 +1915,15 @@ uint8 DreamGenContext::findnextcolon(uint8 **string) {
 	return c;
 }
 
+uint8 *DreamGenContext::getobtextstartCPP() {
+	push(es);
+	push(si);
+	getobtextstart();
+	uint8 *result = es.ptr(si, 0);
+	si = pop();
+	es = pop();
+	return result;
+}
 
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 3149363..26acdde 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -237,4 +237,6 @@
 	void hangonp(uint16 count);
 	uint8 findnextcolon(uint8 **string);
 	void findnextcolon();
+	uint8 *getobtextstartCPP();
+
 


Commit: ef1eb9ba24959b16568f83b8a8a6ddf27ae40bab
    https://github.com/scummvm/scummvm/commit/ef1eb9ba24959b16568f83b8a8a6ddf27ae40bab
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-06T18:53:53-07:00

Commit Message:
DREAMWEB: 'usetext' ported 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 33e232b..8238c7e 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -195,6 +195,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'hangon',
 	'hangonp',
 	'findnextcolon',
+	'usetext',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 5c71dc9..df235c5 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -10276,26 +10276,6 @@ notfoundinside:
 		goto insideloop;
 }
 
-void DreamGenContext::usetext() {
-	STACK_CHECK;
-	push(es);
-	push(si);
-	createpanel();
-	showpanel();
-	showman();
-	showexit();
-	obicons();
-	si = pop();
-	es = pop();
-	di = 36;
-	bx = 104;
-	dl = 241;
-	al = 0;
-	ah = 0;
-	printdirect();
-	worktoscreenm();
-}
-
 void DreamGenContext::putbackobstuff() {
 	STACK_CHECK;
 	createpanel();
@@ -17252,7 +17232,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_findexobject: findexobject(); break;
 		case addr_isryanholding: isryanholding(); break;
 		case addr_checkinside: checkinside(); break;
-		case addr_usetext: usetext(); break;
 		case addr_putbackobstuff: putbackobstuff(); break;
 		case addr_showpuztext: showpuztext(); break;
 		case addr_findpuztext: findpuztext(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 9e209f7..cbc376e 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -283,7 +283,6 @@ public:
 	static const uint16 addr_findpuztext = 0xc6e0;
 	static const uint16 addr_showpuztext = 0xc6dc;
 	static const uint16 addr_putbackobstuff = 0xc6d8;
-	static const uint16 addr_usetext = 0xc6d4;
 	static const uint16 addr_checkinside = 0xc6d0;
 	static const uint16 addr_isryanholding = 0xc6cc;
 	static const uint16 addr_findexobject = 0xc6c8;
@@ -1535,7 +1534,7 @@ public:
 	void vsync();
 	//void finishedwalking();
 	void findinvpos();
-	void usetext();
+	void dumpmenu();
 	void hangonpq();
 	void liftnoise();
 	void workoutframes();
@@ -1552,7 +1551,7 @@ public:
 	void getkeyandlogo();
 	void selectob();
 	//void checkcoords();
-	void dumpmenu();
+	//void usetext();
 	void chewy();
 	void accesslighton();
 	void useplinth();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 26acdde..4a97fd2 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -238,5 +238,6 @@
 	uint8 findnextcolon(uint8 **string);
 	void findnextcolon();
 	uint8 *getobtextstartCPP();
-
+	void usetext(const uint8 *string);
+	void usetext();
 
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 194aed4..38fac02 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -163,5 +163,20 @@ void DreamGenContext::useroutine() {
 	data.byte(kCommandtype) = 255;
 }
 
+void DreamGenContext::usetext() {
+	usetext(es.ptr(si, 0));
+}
+
+void DreamGenContext::usetext(const uint8 *string) {
+	createpanel();
+	showpanel();
+	showman();
+	showexit();
+	obicons();
+	uint16 y = 104;
+	printdirect(&string, 36, &y, 241, true);
+	worktoscreenm();
+}
+
 } /*namespace dreamgen */
 


Commit: ad3b70b539173a8a036529a19904ae11bec4477c
    https://github.com/scummvm/scummvm/commit/ad3b70b539173a8a036529a19904ae11bec4477c
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-06T18:58:04-07:00

Commit Message:
DREAMWEB: Simpler flavour of 'printdirect' for cases when the output layout information is not needed by the client

Changed paths:
    engines/dreamweb/print.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/stubs.h
    engines/dreamweb/use.cpp



diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index c1dbfc0..b6ec957 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -138,6 +138,10 @@ void DreamGenContext::printdirect() {
 	bx = y;
 }
 
+void DreamGenContext::printdirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
+	printdirect(&string, x, &y, maxWidth, centered);
+}
+
 void DreamGenContext::printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) {
 	data.word(kLastxpos) = x;
 	const Frame *charSet = (const Frame *)segRef(data.word(kCurrentset)).ptr(0, 0);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 034f794..7d4f055 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1103,19 +1103,14 @@ void DreamGenContext::commandwithob(uint8 command, uint8 type, uint8 index) {
 	uint16 commandText = kTextstart + segRef(data.word(kCommandtext)).word(command * 2);
 	uint8 textLen = data.byte(kTextlen);
 	{
-		uint16 y = data.word(kTextaddressy);
 		const uint8 *string = segRef(data.word(kCommandtext)).ptr(commandText, 0);
-		printdirect(&string, data.word(kTextaddressx), &y, textLen, (bool)(textLen & 1));
+		printdirect(string, data.word(kTextaddressx), data.word(kTextaddressy), textLen, (bool)(textLen & 1));
 	}
 	copyname(type, index, commandLine);
 	uint16 x = data.word(kLastxpos);
 	if (command != 0)
 		x += 5;
-	{
-		uint16 y = data.word(kTextaddressy);
-		const uint8 *string = commandLine;
-		printdirect(&string, x, &y, textLen, (bool)(textLen & 1));
-	}
+	printdirect(commandLine, x, data.word(kTextaddressy), textLen, (bool)(textLen & 1));
 	data.byte(kNewtextline) = 1;
 }
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 4a97fd2..66e32de 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -47,6 +47,7 @@
 	void printchar(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height);
 	void printdirect();
 	void printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered);
+	void printdirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered);
 	void printmessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered);
 	void printmessage();
 	void usetimedtext();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 38fac02..f584de2 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -173,8 +173,7 @@ void DreamGenContext::usetext(const uint8 *string) {
 	showman();
 	showexit();
 	obicons();
-	uint16 y = 104;
-	printdirect(&string, 36, &y, 241, true);
+	printdirect(string, 36, 104, 241, true);
 	worktoscreenm();
 }
 


Commit: bf5b2244c66d5da4d3495b3667908c83e07a7d80
    https://github.com/scummvm/scummvm/commit/bf5b2244c66d5da4d3495b3667908c83e07a7d80
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-06T19:00:56-07:00

Commit Message:
DREAMWEB: Cleaning of 'useroutine' using new functions

Changed paths:
    engines/dreamweb/use.cpp



diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index f584de2..d6648b5 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -136,14 +136,11 @@ void DreamGenContext::useroutine() {
 	}
 
 	delpointer();
-	getobtextstart();
-	findnextcolon();
-	if (al != 0) {
-		findnextcolon();
-		if (al != 0) {
-			al = es.byte(si);
-			if (al != 0) {
-				usetext();
+	uint8 *obText = getobtextstartCPP();
+	if (findnextcolon(&obText) != 0) {
+		if (findnextcolon(&obText) != 0) {
+			if (*obText != 0) {
+				usetext(obText);
 				hangonp(400);
 				putbackobstuff();
 				return;






More information about the Scummvm-git-logs mailing list