[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.222,1.223 scumm.cpp,1.58,1.59 scumm.h,1.412,1.413

Jonathan Gray khalek at users.sourceforge.net
Sat Jun 26 05:58:01 CEST 2004


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

Modified Files:
	resource.cpp scumm.cpp scumm.h 
Log Message:
Add initial support for reading sputm.9x index files.  Teach ScummVM about res type 13 (rtImage/AWIZ), although don't actually allocate when reading the DIRI block yet.  Error out when trying to read a sputm.9x DOBJ block as they are different to earlier versions and not yet supported

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -d -r1.222 -r1.223
--- resource.cpp	26 Jun 2004 05:08:02 -0000	1.222
+++ resource.cpp	26 Jun 2004 12:57:05 -0000	1.223
@@ -351,7 +351,9 @@
 				_fileHandle.read(_objectStateTable, num);
 				_fileHandle.read(_objectRoomTable, num);
 				memset(_objectOwnerTable, 0xFF, num);
-			} else if (_heversion >= 70) { // Windows titles
+			} else if (_heversion >= 90) { // newer windows titles
+				error("DOBJ reading not yet supported for Scummsys >= 90");
+			} else if (_heversion >= 70) { // older Windows titles
 				_fileHandle.read(_objectStateTable, num);
 				_fileHandle.read(_objectOwnerTable, num);
 				_fileHandle.read(_objectRoomTable, num);
@@ -394,7 +396,8 @@
 			debug(9, "found DIRM block, skipping");
 			break;
 			
-		case MKID('DIRI'):
+		case MKID('DIRI'): // Images?
+//			readResTypeList(rtImage, MKID('AWIZ'), "images");
 			num = _fileHandle.readUint16LE();
 			_fileHandle.seek(num + (8 * num), SEEK_CUR);
 			debug(9, "found DIRI block, skipping");
@@ -2045,6 +2048,10 @@
 }
 
 void ScummEngine::readMAXS(int blockSize) {
+	// FIXME: trying to detect multiple targets probably a better way to do this
+	if (_heversion >= 70 && blockSize > 38 && _heversion < 72)
+			_heversion = 72;
+
 	if (_version == 8) {                    // CMI
 		_fileHandle.seek(50 + 50, SEEK_CUR);            // 176 - 8
 		_numVariables = _fileHandle.readUint32LE();     // 1500
@@ -2096,19 +2103,31 @@
 			_numGlobalScripts = 2000;
 
 		_shadowPaletteSize = NUM_SHADOW_PALETTE * 256;
-	// check blocksize instead of just >= 72 as some 70 targets have later engine versions
-	// freddi being an example of this
-	} else if (_heversion >= 70 && blockSize > 38) { // sputm7.2
-		if (_heversion < 72)
-			_heversion = 72;
-		if (blockSize != 32 + 8) {
-			if (blockSize == 44 + 8)
+	} else if (_heversion >= 70 && (blockSize == 38 + 8)) { // Scummsys.9x
+		_numVariables = _fileHandle.readUint16LE();
+		_fileHandle.readUint16LE(); // not used in spydemo
+		_fileHandle.readUint16LE(); // _numLocalVariables ?
+		_numLocalObjects = _fileHandle.readUint16LE();
+		_numArray = _fileHandle.readUint16LE();
+		_fileHandle.readUint16LE(); // unknown
+		_fileHandle.readUint16LE(); // unknown
+		_numFlObject = _fileHandle.readUint16LE();
+		_numInventory = _fileHandle.readUint16LE();
+		_numRooms = _fileHandle.readUint16LE();
+		_numScripts = _fileHandle.readUint16LE();
+		_numSounds = _fileHandle.readUint16LE();
+		_numCharsets = _fileHandle.readUint16LE();
+		_numCostumes = _fileHandle.readUint16LE();
+		_numGlobalObjects = _fileHandle.readUint16LE();
+		_numImages = _fileHandle.readUint16LE();
+		_fileHandle.readUint16LE(); // unknown
+		_fileHandle.readUint16LE(); // _numLocalScripts?
+		_fileHandle.readUint16LE(); // unknown
+	} else if (_heversion >= 70 && (blockSize == 44 + 8)) { // C++ based engine
 				error("MAXS blocks from C++ based games not yet supported");
-			else if (blockSize == 38 + 8)
-				error("MAXS blocks from Scummsys.9x games not yet supported");
-			else
+	} else if (_heversion >= 70 && blockSize > 38) { // sputm7.2
+		if (blockSize != 32 + 8)
 				error("MAXS block of size %d not supported, please report", blockSize);
-		}
 		_fileHandle.readUint16LE();
 		_numVariables = _fileHandle.readUint16LE();
 		_numBitVariables = _fileHandle.readUint16LE();
@@ -2210,6 +2229,7 @@
 	debug(2, "Allocated %d space in numObjects", _numLocalObjects);
 	_scummVars = (int32 *)calloc(_numVariables, sizeof(int32));
 	_bitVars = (byte *)calloc(_numBitVariables >> 3, 1);
+	_images = (uint16 *)calloc(_numImages, sizeof(uint16));
 
 	allocResTypeData(rtCostume, (_features & GF_NEW_COSTUMES) ? MKID('AKOS') : MKID('COST'),
 								_numCostumes, "costume", 1);
@@ -2227,6 +2247,7 @@
 	allocResTypeData(rtString, MKID('NONE'), _numArray, "array", 0);
 	allocResTypeData(rtFlObject, MKID('NONE'), _numFlObject, "flobject", 0);
 	allocResTypeData(rtMatrix, MKID('NONE'), 10, "boxes", 0);
+	allocResTypeData(rtImage, MKID('AWIZ'), _numImages, "images", 1);
 }
 
 
@@ -2456,6 +2477,8 @@
 		return "Last";
 	case rtNumTypes:
 		return "NumTypes";
+	case rtImage:
+		return "Image";
 	default:
 		sprintf(buf, "%d", id);
 		return buf;

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- scumm.cpp	26 Jun 2004 06:58:39 -0000	1.58
+++ scumm.cpp	26 Jun 2004 12:57:11 -0000	1.59
@@ -260,78 +260,78 @@
 
 #ifdef HEGAMES
 	// Humongous Entertainment Scumm Version 9.0 ?  Scummsys.90
-	{"kinddemo", "Big Thinkers Kindergarten (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"kinddemo", "Big Thinkers Kindergarten (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"1grademo", "Big Thinkers First Grade (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"1grademo", "Big Thinkers First Grade (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"f3-mdemo", "Freddi Fish 3: The Case of the Stolen Conch Shell (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"f3-mdemo", "Freddi Fish 3: The Case of the Stolen Conch Shell (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 	// there is also a C++ engine based version of timedemo
-	{"timedemo", "Putt-Putt Travels Through Time (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"timedemo", "Putt-Putt Travels Through Time (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"spyfox", "Spyfox 1: Dry Cereal", GID_HEGAME, 6, 72, MDT_NONE,
+	{"spyfox", "Spyfox 1: Dry Cereal", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"foxdemo", "Spyfox 1: Dry Cereal (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"foxdemo", "Spyfox 1: Dry Cereal (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 	// there is also a C++ engine version of spydemo
-	{"spydemo", "Spyfox 1: Dry Cereal (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"spydemo", "Spyfox 1: Dry Cereal (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 
 	// Humongous Entertainment Scumm Version 9.5 ?  Scummsys.95
-	{"pj2demo", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"pj2demo", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"pajama2", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening", GID_HEGAME, 6, 72, MDT_NONE,
+	{"pajama2", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"chase", "Spy Fox in Cheese Chase Game", GID_HEGAME, 6, 72, MDT_NONE,
+	{"chase", "Spy Fox in Cheese Chase Game", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 
 	// Humongous Entertainment Scumm Version 9.8 ?  Scummsys.98
 	// these and later games can easily be identified by the .(a) file instead of a .he1
-	{"freddi4", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch", GID_HEGAME, 6, 72, MDT_NONE,
+	{"freddi4", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"f4-demo", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"f4-demo", "Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 	{"lost", "Pajama Sam's Lost & Found", GID_HEGAME, 6, 72, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"racedemo", "Putt-Putt Enters the Race (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"racedemo", "Putt-Putt Enters the Race (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"puttrace", "Putt-Putt Enters the Race", GID_HEGAME, 6, 72, MDT_NONE,
+	{"puttrace", "Putt-Putt Enters the Race", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"bluesabctimedemo", "Blue's ABC Time (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"bluesabctimedemo", "Blue's ABC Time (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 
 	// Humongous Entertainment Scumm Version 9.9 ?  Scummsys.99
-	{"sf2-demo", "Spyfox 2: Some Assembly Required (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"sf2-demo", "Spyfox 2: Some Assembly Required (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"spyfox2", "Spyfox 2: Some Assembly Required", GID_HEGAME, 6, 72, MDT_NONE,
+	{"spyfox2", "Spyfox 2: Some Assembly Required", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"mustard", "Spy Fox in Hold the Mustard", GID_HEGAME, 6, 72, MDT_NONE,
+	{"mustard", "Spy Fox in Hold the Mustard", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
 
 	// Humongous Entertainment Scumm Version ?  engine moved to c++ 
-	{"ff5demo", "Freddi Fish 5: The Case of the Creature of Coral Cave (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"ff5demo", "Freddi Fish 5: The Case of the Creature of Coral Cave (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"freddicove", "Freddi Fish 5: The Case of the Creature of Coral Cave", GID_HEGAME, 6, 72, MDT_NONE,
+	{"freddicove", "Freddi Fish 5: The Case of the Creature of Coral Cave", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"ffhsdemo", "Freddi Fish 2: The Case of the Haunted Schoolhouse (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"ffhsdemo", "Freddi Fish 2: The Case of the Haunted Schoolhouse (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"pj3-demo", "Pajama Sam 3: You Are What You Eat From Your Head to Your Feet (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"pj3-demo", "Pajama Sam 3: You Are What You Eat From Your Head to Your Feet (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"pajama3", "Pajama Sam 3: You Are What You Eat From Your Head to Your Feet", GID_HEGAME, 6, 72, MDT_NONE,
+	{"pajama3", "Pajama Sam 3: You Are What You Eat From Your Head to Your Feet", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"dog", "Putt-Putt and Pep's Dog on a Stick", GID_HEGAME, 6, 72, MDT_NONE,
+	{"dog", "Putt-Putt and Pep's Dog on a Stick", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"PuttsFunShop", "Putt-Putt's One-Stop Fun Shop", GID_HEGAME, 6, 72, MDT_NONE,
+	{"PuttsFunShop", "Putt-Putt's One-Stop Fun Shop", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"putttime", "Putt-Putt Travels Through Time", GID_HEGAME, 6, 72, MDT_NONE,
+	{"putttime", "Putt-Putt Travels Through Time", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"spyozon", "Spyfox 3: Operation Ozone", GID_HEGAME, 6, 72, MDT_NONE,
+	{"spyozon", "Spyfox 3: Operation Ozone", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"bb2demo", "Backyard Baseball 2001 (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"bb2demo", "Backyard Baseball 2001 (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"football2002", "Backyard Football 2002 (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"football2002", "Backyard Football 2002 (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0},
-	{"pjsamdemo", "Pajama Sam: No Need To Hide When It's Dark Outside (Demo)", GID_HEGAME, 6, 72, MDT_NONE,
+	{"pjsamdemo", "Pajama Sam: No Need To Hide When It's Dark Outside (Demo)", GID_HEGAME, 6, 90, MDT_NONE,
 	 GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 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.412
retrieving revision 1.413
diff -u -d -r1.412 -r1.413
--- scumm.h	25 Jun 2004 22:39:20 -0000	1.412
+++ scumm.h	26 Jun 2004 12:57:11 -0000	1.413
@@ -207,7 +207,8 @@
 	rtRoomScripts = 17,
 	rtRoomStart = 17,
 	rtLast = 17,
-	rtNumTypes = 18
+	rtImage = 19,
+	rtNumTypes = 20
 };
 
 enum {
@@ -429,6 +430,7 @@
 	
 	uint16 *_inventory;
 	uint16 *_newNames;
+	uint16 *_images;
 public:
 	// VAR is a wrapper around scummVar, which attempts to include additional
 	// useful information should an illegal var access be detected.
@@ -458,7 +460,7 @@
 	int _numGlobalObjects, _numArray, _numVerbs, _numFlObject;
 	int _numInventory, _numRooms, _numScripts, _numSounds;
 	int _numNewNames, _numGlobalScripts;
-	int _numActors;
+	int _numActors, _numImages;
 public:
 	int _numCostumes;	// FIXME - should be protected, used by Actor::remapActorPalette
 	int _numCharsets;	// FIXME - should be protected, used by CharsetRenderer





More information about the Scummvm-git-logs mailing list