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

wjp wjp at usecode.org
Thu Jul 28 21:16:32 CEST 2011


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

Summary:
7e88112ad2 DREAMWEB: Fix kerning in printchar
c626394f2b DREAMWEB: Fix rendering underlined characters


Commit: 7e88112ad2a27ad50f54fb84b92ec97c2262939a
    https://github.com/scummvm/scummvm/commit/7e88112ad2a27ad50f54fb84b92ec97c2262939a
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-07-28T12:09:51-07:00

Commit Message:
DREAMWEB: Fix kerning in printchar

ah should contain the next char to print for kernchars(), but
it was getting clobbered in one code path, and not even set in another.

Changed paths:
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index ec94ffc..2ac3751 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -307,14 +307,16 @@ void DreamGenContext::printchar(uint16 dst, uint16 src, uint16* x, uint16 y, uin
 		return;
 	push(si);
 	push(di);
+	push(ax);
 	if (data.byte(kForeignrelease) != 0)
 		y -= 3;
 	showframe(dst, src, *x, y, c - 32 + data.word(kCharshift), 0, width, height);
+	ax = pop();
 	di = pop();
 	si = pop();
 	_cmp(data.byte(kKerning), 0);
 	if (flags.z())
-		kernchars();
+		*width = kernchars(c, ah, *width);
 	(*x) += *width;
 }
 
@@ -408,6 +410,7 @@ void DreamGenContext::printdirect(uint16 x, uint16 *y, uint8 maxWidth, bool cent
 				return;
 			}
 			c = engine->modifyChar(c);
+			ah = es.byte(si); // get next char for kerning
 			uint8 width, height;
 			push(es);
 			printchar(es, ds, &i, *y, c, &width, &height);


Commit: c626394f2b6566bc310f7fb02b9449acc2e8f00f
    https://github.com/scummvm/scummvm/commit/c626394f2b6566bc310f7fb02b9449acc2e8f00f
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-07-28T12:13:02-07:00

Commit Message:
DREAMWEB: Fix rendering underlined characters

The frame number argument to showframe is 9 bits of ax in the
original asm, but was passed in a uint8.

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



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 2ac3751..3c05825 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -914,13 +914,16 @@ Sprite *DreamGenContext::spritetable() {
 	return sprite;
 }
 
-void DreamGenContext::showframe(uint16 dst, uint16 src, uint16 x, uint16 y, uint8 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) {
+void DreamGenContext::showframe(uint16 dst, uint16 src, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) {
+	// frameNumber takes up 9 bits of ax, and effectsFlag 7.
+	assert(!(effectsFlag & 1));
+
 	es = dst;
 	ds = src;
 	di = x;
 	bx = y;
-	al = frameNumber;
-	ah = effectsFlag;
+	ax = frameNumber | (effectsFlag << 8);
+
 
 	si = (ax & 0x1ff) * 6;
 	if (ds.word(si) == 0) {
@@ -983,7 +986,7 @@ void DreamGenContext::showframe(uint16 dst, uint16 src, uint16 x, uint16 y, uint
 
 void DreamGenContext::showframe() {
 	uint8 width, height;
-	showframe(es, ds, di, bx, al, ah, &width, &height);
+	showframe(es, ds, di, bx, ax & 0x1ff, ah & 0xfe, &width, &height);
 	cl = width;
 	ch = height;
 }
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 20d987d..b633684 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -58,7 +58,7 @@
 	uint8 kernchars(uint8 firstChar, uint8 secondChar, uint8 width);
 	Sprite *spritetable();
 	void showframe();
-	void showframe(uint16 dst, uint16 src, uint16 x, uint16 y, uint8 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
+	void showframe(uint16 dst, uint16 src, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
 	void printasprite(const Sprite *sprite);
 	void width160();
 	void multiput(uint16 x, uint16 y, uint8 width, uint8 height);






More information about the Scummvm-git-logs mailing list