diff options
author | Jonathan Gray | 2004-06-26 12:57:11 +0000 |
---|---|---|
committer | Jonathan Gray | 2004-06-26 12:57:11 +0000 |
commit | b02221a613e85cfde1830fe3635488f2a66ceabb (patch) | |
tree | 91e1a7d175478c67f27b0be34ce2896ae2a15ded /scumm | |
parent | 5268717ad402399f05338c810d2c8ec35e11d1a6 (diff) | |
download | scummvm-rg350-b02221a613e85cfde1830fe3635488f2a66ceabb.tar.gz scummvm-rg350-b02221a613e85cfde1830fe3635488f2a66ceabb.tar.bz2 scummvm-rg350-b02221a613e85cfde1830fe3635488f2a66ceabb.zip |
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
svn-id: r14073
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/resource.cpp | 49 | ||||
-rw-r--r-- | scumm/scumm.cpp | 60 | ||||
-rw-r--r-- | scumm/scumm.h | 6 |
3 files changed, 70 insertions, 45 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 1decdf6d09..c3e2e7882c 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -351,7 +351,9 @@ void ScummEngine::readIndexFile() { _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 @@ void ScummEngine::readIndexFile() { 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::resourceStats() { } 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 @@ void ScummEngine::readMAXS(int blockSize) { _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 @@ void ScummEngine::allocateArrays() { 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 @@ void ScummEngine::allocateArrays() { 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 @@ const char *resTypeFromId(int id) { return "Last"; case rtNumTypes: return "NumTypes"; + case rtImage: + return "Image"; default: sprintf(buf, "%d", id); return buf; diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index ec1ea56219..cfe04cf4df 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -260,78 +260,78 @@ static const ScummGameSettings scumm_settings[] = { #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} diff --git a/scumm/scumm.h b/scumm/scumm.h index 64947b95cd..19ca848dd5 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -207,7 +207,8 @@ enum ResTypes { rtRoomScripts = 17, rtRoomStart = 17, rtLast = 17, - rtNumTypes = 18 + rtImage = 19, + rtNumTypes = 20 }; enum { @@ -429,6 +430,7 @@ protected: 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 @@ protected: 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 |