[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.218,1.219 scumm.cpp,1.48,1.49 scumm.h,1.409,1.410

Jonathan Gray khalek at users.sourceforge.net
Fri Jun 25 03:40:03 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15119

Modified Files:
	resource.cpp scumm.cpp scumm.h 
Log Message:
Check blocksize when reading MAXS, may potentially detect HE versions using it in future. Add/Correct some more HE targets.

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -d -r1.218 -r1.219
--- resource.cpp	25 Jun 2004 09:52:17 -0000	1.218
+++ resource.cpp	25 Jun 2004 10:39:34 -0000	1.219
@@ -430,7 +430,7 @@
 			break;
 
 		case MKID('MAXS'):
-			readMAXS();
+			readMAXS(itemsize);
 			break;
 
 		case MKID('DSOU'):
@@ -448,7 +448,8 @@
 			break;
 
 		default:
-			error("Bad ID '%s' found in index file directory!", tag2str(blocktype));
+			error("Bad ID %04X('%s') found in index file directory!", blocktype,
+					tag2str(blocktype));
 			return;
 		}
 	}
@@ -530,7 +531,10 @@
 	assert(id >= 0 && id < (int)(ARRAYSIZE(res.mode)));
 
 	if (num >= 2000) {
-		error("Too many %ss (%d) in directory", name, num);
+		/* FIXME: this used to be an error but it seems the newer humongous titles
+		 * exceed this presumably old limit, need to determine a new ceiling
+		 */
+		warning("Too many %ss (%d) in directory", name, num);
 	}
 
 	res.mode[id] = mode;
@@ -2034,7 +2038,7 @@
 	debug(1, "Total allocated size=%d, locked=%d(%d)", _allocatedSize, lockedSize, lockedNum);
 }
 
-void ScummEngine::readMAXS() {
+void ScummEngine::readMAXS(int blockSize) {
 	if (_version == 8) {                    // CMI
 		_fileHandle.seek(50 + 50, SEEK_CUR);            // 176 - 8
 		_numVariables = _fileHandle.readUint32LE();     // 1500
@@ -2087,6 +2091,8 @@
 
 		_shadowPaletteSize = NUM_SHADOW_PALETTE * 256;
 	} else if (_heversion >= 72) { // sputm7.2
+		if (blockSize != 32 + 8)
+			error("MAXS block of size %d not supported", blockSize);
 		_fileHandle.readUint16LE();
 		_numVariables = _fileHandle.readUint16LE();
 		_numBitVariables = _fileHandle.readUint16LE();
@@ -2115,6 +2121,8 @@
 		_numGlobalScripts = 200;
 		_shadowPaletteSize = 256;
 	} else if (_version == 6) {
+		if (blockSize != 30 + 8)
+			error("MAXS block of size %d not supported", blockSize);
 		_numVariables = _fileHandle.readUint16LE();
 		_fileHandle.readUint16LE();                      // 16 in Sam/DOTT
 		_numBitVariables = _fileHandle.readUint16LE();

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- scumm.cpp	25 Jun 2004 10:12:59 -0000	1.48
+++ scumm.cpp	25 Jun 2004 10:39:35 -0000	1.49
@@ -214,7 +214,7 @@
 	 /* Note that both full versions of Humongous games and demos were often released for
 	  * several interpreter versions... */
 	// Humongous Entertainment Scumm Version 6 (Windows versions are version 7 actually)
-	{"catalog", "Humongous Interactive Catalog", GID_HEGAME, 6, 60, MDT_NONE,
+	{"catalog", "Humongous Interactive Catalog", GID_HEGAME, 6, 70, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 	{"farm", "Let's Explore the Farm with Buzzy", GID_HEGAME, 6, 70, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
@@ -237,7 +237,8 @@
 	// Humongous Entertainment Scumm Version 8.0 ?  Scummsrc.80 
 	{"zoodemo", "Putt-Putt Saves the Zoo (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
-	{"freddemo", "Freddi Fish 1: The Case of the Missing Kelp Seeds (Demo)", GID_FREDDEMO, 6, 72, MDT_NONE,
+	/* has old MAXS block */
+	{"freddemo", "Freddi Fish 1: The Case of the Missing Kelp Seeds (Demo)", GID_FREDDEMO, 6, 71, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
 	{"ff2-demo", "Freddi Fish 2: The Case of the Haunted Schoolhouse (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
 	GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
@@ -295,7 +296,7 @@
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
 	{"puttrace", "Putt-Putt Enters the Race", GID_HEGAME, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
-	{"bluesabctimedemo", "Blue's ABC Time Demo", GID_HEGAME, 6, 72, MDT_NONE,
+	{"bluesabctimedemo", "Blue's ABC Time (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
 
 	// Humongous Entertainment Scumm Version 9.9 ?  Scummsys.99
@@ -323,6 +324,12 @@
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
 	{"spyozon", "Spyfox 3: Operation Ozone", GID_HEGAME, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
+	{"bb2demo", "Backyard Baseball 2001 (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
+	{"football2002", "Backyard Football 2002 (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
+	{"pjsamdemo", "Pajama Sam: No Need To Hide When It's Dark Outside (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES | GF_WINDOWS, 0},
 #endif
 	{NULL, NULL, 0, 0, 0, MDT_NONE, 0, 0}
 };

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.409
retrieving revision 1.410
diff -u -d -r1.409 -r1.410
--- scumm.h	24 Jun 2004 20:09:36 -0000	1.409
+++ scumm.h	25 Jun 2004 10:39:35 -0000	1.410
@@ -674,7 +674,7 @@
 	void loadRoomObjectsOldBundle();
 
 	virtual void readArrayFromIndexFile();
-	virtual void readMAXS();
+	virtual void readMAXS(int blockSize);
 	virtual void readIndexFile();
 	virtual void loadCharset(int i);
 	void nukeCharset(int i);





More information about the Scummvm-git-logs mailing list