[Scummvm-cvs-logs] scummvm master -> 2701439250c4255981048a3bfe2bb003055e6d2e

tramboi bertrand_augereau at yahoo.fr
Sat Nov 19 14:56:20 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:
2701439250 DREAMWEB: 'monprint' ported to C++


Commit: 2701439250c4255981048a3bfe2bb003055e6d2e
    https://github.com/scummvm/scummvm/commit/2701439250c4255981048a3bfe2bb003055e6d2e
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-11-19T07:54:28-08:00

Commit Message:
DREAMWEB: 'monprint' ported to C++

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 470eea9..a398c28 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -249,6 +249,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'scrollmonitor',
 	'showcurrentfile',
 	'input',
+	'monprint',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 66df739..6d5952c 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3168,92 +3168,6 @@ realcreditsearly:
 	data.byte(kLasthardkey) =  0;
 }
 
-void DreamGenContext::monprint() {
-	STACK_CHECK;
-	data.byte(kKerning) = 1;
-	si = bx;
-	dl = 166;
-	di = data.word(kMonadx);
-	bx = data.word(kMonady);
-	ds = data.word(kTempcharset);
-printloop8:
-	push(bx);
-	push(di);
-	push(dx);
-	getnumber();
-	ch = 0;
-printloop7:
-	al = es.byte(si);
-	_inc(si);
-	_cmp(al, ':');
-	if (flags.z())
-		goto finishmon2;
-	_cmp(al, 0);
-	if (flags.z())
-		goto finishmon;
-	_cmp(al, 34);
-	if (flags.z())
-		goto finishmon;
-	_cmp(al, '=');
-	if (flags.z())
-		goto finishmon;
-	_cmp(al, '%');
-	if (!flags.z())
-		goto nottrigger;
-	ah = es.byte(si);
-	_inc(si);
-	_inc(si);
-	goto finishmon;
-nottrigger:
-	push(cx);
-	push(es);
-	modifychar();
-	printchar();
-	data.word(kCurslocx) = di;
-	data.word(kCurslocy) = bx;
-	data.word(kMaintimer) = 1;
-	printcurs();
-	vsync();
-	push(si);
-	push(dx);
-	push(ds);
-	push(es);
-	push(bx);
-	push(di);
-	lockmon();
-	di = pop();
-	bx = pop();
-	es = pop();
-	ds = pop();
-	dx = pop();
-	si = pop();
-	delcurs();
-	es = pop();
-	cx = pop();
-	if (--cx)
-		goto printloop7;
-finishmon2:
-	dx = pop();
-	di = pop();
-	bx = pop();
-	scrollmonitor();
-	data.word(kCurslocx) = di;
-	goto printloop8;
-finishmon:
-	dx = pop();
-	di = pop();
-	bx = pop();
-	_cmp(al, '%');
-	if (!flags.z())
-		goto nottrigger2;
-	data.byte(kLasttrigger) = ah;
-nottrigger2:
-	data.word(kCurslocx) = di;
-	scrollmonitor();
-	bx = si;
-	data.byte(kKerning) = 0;
-}
-
 void DreamGenContext::fillopen() {
 	STACK_CHECK;
 	deltextline();
@@ -15229,7 +15143,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_mode640x480: mode640x480(); break;
 		case addr_set16colpalette: set16colpalette(); break;
 		case addr_realcredits: realcredits(); break;
-		case addr_monprint: monprint(); break;
 		case addr_fillopen: fillopen(); break;
 		case addr_findallopen: findallopen(); break;
 		case addr_makemainscreen: makemainscreen(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index e4ad5f8..c74a556 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -452,7 +452,6 @@ public:
 	static const uint16 addr_makemainscreen = 0xc340;
 	static const uint16 addr_findallopen = 0xc32c;
 	static const uint16 addr_fillopen = 0xc324;
-	static const uint16 addr_monprint = 0xc314;
 	static const uint16 addr_realcredits = 0xc2f8;
 	static const uint16 addr_set16colpalette = 0xc2f4;
 	static const uint16 addr_mode640x480 = 0xc2f0;
@@ -1357,7 +1356,7 @@ public:
 	void delchar();
 	void getanyad();
 	void endgame();
-	void monprint();
+	//void monprint();
 	void usepipe();
 	//void startloading();
 	void getunderzoom();
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index 8ae9df5..f12d8ee 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -234,5 +234,53 @@ uint16 DreamGenContext::waitframes() {
 	return data.word(kMousebutton);
 }
 
+void DreamGenContext::monprint() {
+	uint16 originalBx = bx;
+	const char *string = (const char *)es.ptr(bx, 0);
+	const char *nextString = monprint(string);
+	bx = originalBx + (nextString - string);
+}
+
+const char *DreamGenContext::monprint(const char *string) {
+	data.byte(kKerning) = 1;
+	uint16 x = data.word(kMonadx);
+	Frame *tempCharset = (Frame *)segRef(data.word(kTempcharset)).ptr(0, 0);
+	const char *iterator = string;
+	while (true) {
+		uint16 count = getnumber(tempCharset, (const uint8 *)iterator, 166, false, &x);
+		do {
+			char c = *iterator++;
+			if (c == ':')
+				break;
+			if ((c == 0) || (c == 34) || (c == '='))
+				goto finishmon;
+			if (c == '%') {
+				data.byte(kLasttrigger) = *iterator;
+				iterator += 2;
+				goto finishmon;
+			}
+			c = engine->modifyChar(c);
+			printchar(tempCharset, &x, data.word(kMonady), c, 0, NULL, NULL);
+			data.word(kCurslocx) = x;
+			data.word(kCurslocy) = data.word(kMonady);
+			data.word(kMaintimer) = 1;
+			printcurs();
+			vsync();
+			lockmon();
+			delcurs();
+			--count;
+		}
+		while(count);
+		x = data.word(kMonadx);
+		scrollmonitor();
+		data.word(kCurslocx) = data.word(kMonadx);
+	}
+finishmon:
+	data.word(kCurslocx) = data.word(kMonadx);
+	scrollmonitor();
+	data.byte(kKerning) = 0;
+	return iterator;
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 2fdb7c0..2741c6b 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -302,4 +302,6 @@
 	void scrollmonitor();
 	void showcurrentfile();
 	void input();
+	void monprint();
+	const char *monprint(const char *string);
 






More information about the Scummvm-git-logs mailing list