[Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.78,1.79 scaler.cpp,1.6,1.7 scaler.h,1.2,1.3 system.h,1.19,1.20

Max Horn fingolfin at users.sourceforge.net
Sun Mar 2 10:30:42 CET 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv17606/common

Modified Files:
	gameDetector.cpp scaler.cpp scaler.h system.h 
Log Message:
Patch #691064: dot matrix scaler

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- gameDetector.cpp	1 Mar 2003 22:04:46 -0000	1.78
+++ gameDetector.cpp	2 Mar 2003 16:36:51 -0000	1.79
@@ -47,7 +47,7 @@
 	"\t-p<path>   - look for game in <path>\n"
 	"\t-x[<num>]  - load this savegame (default: 0 - autosave)\n"
 	"\t-f         - fullscreen mode\n"
-	"\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n"
+	"\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x,dotmatrix)\n"
 	"\t-e<mode>   - set music engine (see README for details)\n"
 	"\t-a         - specify game is amiga version\n"
 	"\t-q<lang>   - specify language (en,de,fr,it,pt,es,ja,zh,ko,hb)\n"
@@ -91,6 +91,7 @@
 	{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
 	{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
 	{"tv2x", "TV2x", GFX_TV2X},
+	{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
 	{0, 0}
 };
 

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- scaler.cpp	19 Jan 2003 22:28:36 -0000	1.6
+++ scaler.cpp	2 Mar 2003 16:36:52 -0000	1.7
@@ -32,6 +32,20 @@
 static uint32 redblueMask = 0xF81F;
 static uint32 greenMask = 0x7E0;
 
+static const uint16 dotmatrix_565[16] = {
+  0x01E0, 0x0007, 0x3800, 0x0000,
+  0x39E7, 0x0000, 0x39E7, 0x0000,
+  0x3800, 0x0000, 0x01E0, 0x0007,
+  0x39E7, 0x0000, 0x39E7, 0x0000
+};
+static const uint16 dotmatrix_555[16] = {
+  0x00E0, 0x0007, 0x1C00, 0x0000,
+  0x1CE7, 0x0000, 0x1CE7, 0x0000,
+  0x1C00, 0x0000, 0x00E0, 0x0007,
+  0x1CE7, 0x0000, 0x1CE7, 0x0000
+};
+static const uint16 *dotmatrix;
+
 int Init_2xSaI(uint32 BitFormat)
 {
 	if (BitFormat == 565) {
@@ -41,6 +55,7 @@
 		qlowpixelMask = 0x18631863;
 		redblueMask = 0xF81F;
 		greenMask = 0x7E0;
+		dotmatrix = dotmatrix_565;
 	} else if (BitFormat == 555) {
 		colorMask = 0x7BDE7BDE;
 		lowPixelMask = 0x04210421;
@@ -48,6 +63,7 @@
 		qlowpixelMask = 0x0C630C63;
 		redblueMask = 0x7C1F;
 		greenMask = 0x3E0;
+		dotmatrix = dotmatrix_555;
 	} else {
 		return 0;
 	}
@@ -825,6 +841,32 @@
 			*(q + j + 1) = p1;
 			*(q + j + nextlineDst) = (uint16)pi;
 			*(q + j + nextlineDst + 1) = (uint16)pi;
+		}
+		p += nextlineSrc;
+		q += nextlineDst << 1;
+	}
+}
+
+static inline uint16 DOT_16(uint16 c, int j, int i) {
+  return c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3)));
+}
+
+void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+					int width, int height)
+{
+	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
+	uint16 *p = (uint16 *)srcPtr;
+
+	unsigned int nextlineDst = dstPitch / sizeof(uint16);
+	uint16 *q = (uint16 *)dstPtr;
+
+	for (int j = 0, jj = 0; j < height; ++j, jj += 2) {
+		for (int i = 0, ii = 0; i < width; ++i, ii += 2) {
+			uint16 c = *(p + i);
+			*(q + ii) = DOT_16(c, jj, ii);
+			*(q + ii + 1) = DOT_16(c, jj, ii + 1);
+			*(q + ii + nextlineDst) = DOT_16(c, jj + 1, ii);
+			*(q + ii + nextlineDst + 1) = DOT_16(c, jj + 1, ii + 1);
 		}
 		p += nextlineSrc;
 		q += nextlineDst << 1;

Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- scaler.h	15 Jan 2003 02:11:37 -0000	1.2
+++ scaler.h	2 Mar 2003 16:36:52 -0000	1.3
@@ -38,5 +38,7 @@
 								uint8 *dstPtr, uint32 dstPitch, int width, int height);
 extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
 								uint8 *dstPtr, uint32 dstPitch, int width, int height);
+extern void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
+								uint8 *dstPtr, uint32 dstPitch, int width, int height);
 
 #endif

Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- system.h	29 Jan 2003 21:28:36 -0000	1.19
+++ system.h	2 Mar 2003 16:36:52 -0000	1.20
@@ -223,7 +223,8 @@
 	GFX_SUPER2XSAI = 4,
 	GFX_SUPEREAGLE = 5,
 	GFX_ADVMAME2X = 6,
-	GFX_TV2X = 7
+	GFX_TV2X = 7,
+	GFX_DOTMATRIX = 8
 };
 
 





More information about the Scummvm-git-logs mailing list