diff options
author | Filippos Karapetis | 2009-03-30 07:53:32 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-03-30 07:53:32 +0000 |
commit | e130aecc4f2650d86a41ee4d963b66e5421226bb (patch) | |
tree | 60b3a461c58166145fe5ec262a15c1cf94271d78 /engines | |
parent | 30473e313d8e4513a11dd29ea353db297d5223b4 (diff) | |
download | scummvm-rg350-e130aecc4f2650d86a41ee4d963b66e5421226bb.tar.gz scummvm-rg350-e130aecc4f2650d86a41ee4d963b66e5421226bb.tar.bz2 scummvm-rg350-e130aecc4f2650d86a41ee4d963b66e5421226bb.zip |
Wrapped all the still WIP SCI32-specific code around appropriate ifdef blocks. SCI32 has fundamental differences from previous SCI versions (e.g. direct point addressing is no longer possible), most of SCI32 games use SVGA resolutions and currently a lot of SCI32 specific code is missing (like, for example, the newer string and array handling functions, the widget system etc). This has been done in the same manner as in the SCUMM and SAGA engines.
svn-id: r39750
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/detection.cpp | 72 | ||||
-rw-r--r-- | engines/sci/engine/kernel.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.cpp | 6 | ||||
-rw-r--r-- | engines/sci/scicore/decompressor.cpp | 4 | ||||
-rw-r--r-- | engines/sci/scicore/decompressor.h | 4 | ||||
-rw-r--r-- | engines/sci/scicore/resource.cpp | 23 | ||||
-rw-r--r-- | engines/sci/scicore/resource.h | 2 | ||||
-rw-r--r-- | engines/sci/scicore/vocab_debug.cpp | 3 |
8 files changed, 91 insertions, 25 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index b623edd499..3ea5ab6aa9 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -47,8 +47,6 @@ static const PlainGameDescriptor SciGameTitles[] = { {"ecoquest", "EcoQuest: The Search for Cetus"}, {"ecoquest2", "EcoQuest II: Lost Secret of the Rainforest"}, {"freddypharkas", "Freddy Pharkas: Frontier Pharmacist"}, - {"gk1", "Gabriel Knight: Sins of the Fathers"}, - {"gk2", "The Beast Within: A Gabriel Knight Mystery"}, {"hoyle1", "Hoyle's Official Book of Games: Volume 1"}, {"hoyle2", "Hoyle's Official Book of Games: Volume 2"}, {"hoyle3", "Hoyle's Official Book of Games: Volume 3"}, @@ -57,7 +55,6 @@ static const PlainGameDescriptor SciGameTitles[] = { {"kq4sci", "King's Quest IV: The Perils of Rosella"}, {"kq5", "King's Quest V: Absence Makes the Heart Go Yonder"}, {"kq6", "King's Quest VI: Heir Today, Gone Tomorrow"}, - {"kq7", "King's Quest VII: The Princeless Bride"}, {"laurabow", "Laura Bow: The Colonel's Bequest"}, {"laurabow2", "Laura Bow 2: The Dagger of Amon Ra"}, {"lsl1sci", "Leisure Suit Larry in the Land of the Lounge Lizards"}, @@ -65,32 +62,37 @@ static const PlainGameDescriptor SciGameTitles[] = { {"lsl3", "Leisure Suit Larry 3: Passionate Patti in Pursuit of the Pulsating Pectorals"}, {"lsl5", "Leisure Suit Larry 5: Passionate Patti Does a Little Undercover Work"}, {"lsl6", "Leisure Suit Larry 6: Shape Up or Slip Out!"}, - {"lsl7", "Leisure Suit Larry 7: Love for Sail!"}, - {"lighthouse", "Lighthouse: The Dark Being"}, //{"fairytales", "Mixed-up Fairy Tales"}, {"mothergoose", "Mixed-Up Mother Goose"}, {"msastrochicken", "Ms. Astro Chicken"}, //{"pepper", "Pepper's Adventure in Time"}, - {"phantasmagoria", "Phantasmagoria"}, - {"phantasmagoria2", "Phantasmagoria II: A Puzzle of Flesh"}, {"pq1sci", "Police Quest: In Pursuit of the Death Angel"}, {"pq2", "Police Quest II: The Vengeance"}, {"pq3", "Police Quest III: The Kindred"}, - {"pq4", "Police Quest IV: Open Season"}, {"qfg1", "Quest for Glory I: So You Want to Be a Hero"}, {"qfg2", "Quest for Glory II: Trial by Fire"}, {"qfg3", "Quest for Glory III: Wages of War"}, - {"qfg4", "Quest for Glory IV: Shadows of Darkness"}, - {"rama", "RAMA"}, - {"shivers", "Shivers"}, - //{"shivers2", "Shivers II: Harvest of Souls"}, {"sq1sci", "Space Quest I: The Sarien Encounter"}, {"sq3", "Space Quest III: The Pirates of Pestulon"}, {"sq4", "Space Quest IV: Roger Wilco and the Time Rippers"}, {"sq5", "Space Quest V: The Next Mutation"}, - {"sq6", "Space Quest 6: The Spinal Frontier"}, {"islandbrain", "The Island of Dr. Brain"}, +#ifdef ENABLE_SCI32 + {"gk1", "Gabriel Knight: Sins of the Fathers"}, + {"gk2", "The Beast Within: A Gabriel Knight Mystery"}, + {"kq7", "King's Quest VII: The Princeless Bride"}, + {"lsl7", "Leisure Suit Larry 7: Love for Sail!"}, + {"lighthouse", "Lighthouse: The Dark Being"}, + {"phantasmagoria", "Phantasmagoria"}, + {"phantasmagoria2", "Phantasmagoria II: A Puzzle of Flesh"}, + {"pq4", "Police Quest IV: Open Season"}, + {"qfg4", "Quest for Glory IV: Shadows of Darkness"}, + {"rama", "RAMA"}, + {"shivers", "Shivers"}, + //{"shivers2", "Shivers II: Harvest of Souls"}, + {"sq6", "Space Quest 6: The Spinal Frontier"}, {"torin", "Torin's Passage"}, +#endif {0, 0} }; @@ -542,6 +544,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 1, 95) }, +#ifdef ENABLE_SCI32 // Gabriel Knight - English DOS Floppy {{"gk1", "", { {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10783}, @@ -562,7 +565,6 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(2, 000, 000) }, -#if 0 // Gabriel Knight - German DOS CD (from Tobis87) {{"gk1", "CD", { {"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392}, @@ -570,11 +572,9 @@ static const struct SciGameDescription SciGameDescriptions[] = { {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0}, {}, SCI_VERSION_AUTODETECT, - SCI_VERSION(0, 000, 000) // FIXME: add version here + SCI_VERSION(2, 000, 000) // FIXME: Not sure if this is the correct version }, -#endif -#if 0 // Gabriel Knight - Spanish DOS CD {{"gk1", "CD", { {"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404}, @@ -582,9 +582,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { {NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0}, {}, SCI_VERSION_AUTODETECT, - SCI_VERSION(0, 000, 000) // FIXME: add version here + SCI_VERSION(2, 000, 000) // FIXME: Not sure if this is the correct version }, -#endif // Gabriel Knight - English DOS CD Demo {{"gk1", "CD Demo", { @@ -618,6 +617,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#endif + // Hoyle 1 - English DOS (supplied by wibble92 in bug report #2644547) {{"hoyle1", "", { {"resource.map", 0, "9de9aa6d23569b3c8bf798503cf1216a", 7818}, @@ -894,6 +895,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 1, 54) }, +#ifdef ENABLE_SCI32 // King's Quest 7 - English DOS {{"kq7", "", { {"resource.map", 0, "2be9ab94429c721af8e05c507e048a15", 18697}, @@ -935,6 +937,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION_AUTODETECT, SCI_VERSION(2, 100, 2) }, +#endif // Laura Bow - English Amiga {{"laurabow", "", { @@ -1403,6 +1406,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 001, 115) }, +#ifdef ENABLE_SCI32 // Larry 6 - English/German DOS CD - HIRES {{"lsl6", "", { {"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872}, @@ -1412,6 +1416,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION_AUTODETECT, SCI_VERSION(2, 100, 002) }, +#endif // Larry 6 - German DOS CD - LORES (provided by richiefs in bug report #2670691) {{"lsl6", "", { @@ -1423,6 +1428,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 001, 115) }, +#ifdef ENABLE_SCI32 // Larry 6 - German DOS CD - HIRES (provided by richiefs in bug report #2670691) {{"lsl6", "", { {"resource.map", 0, "badfdf446ffed569a310d2c63a249421", 8896}, @@ -1432,6 +1438,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION_AUTODETECT, SCI_VERSION(2, 100, 002) }, +#endif // Larry 6 - French DOS CD - LORES (provided by richiefs in bug report #2670691) {{"lsl6", "", { @@ -1443,6 +1450,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 001, 115) }, +#ifdef ENABLE_SCI32 // Larry 6 - French DOS CD - HIRES (provided by richiefs in bug report #2670691) {{"lsl6", "", { {"resource.map", 0, "d184e9aa4f2d4b5670ddb3669db82cda", 8896}, @@ -1452,6 +1460,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION_AUTODETECT, SCI_VERSION(2, 100, 002) }, +#endif #if 0 // Larry 6 - Spanish DOS @@ -1465,6 +1474,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#ifdef ENABLE_SCI32 // Larry 7 - English DOS CD (from spookypeanut) {{"lsl7", "", { {"resmap.000", 0, "eae93e1b1d1ccc58b4691c371281c95d", 8188}, @@ -1557,6 +1567,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#endif // #ifdef ENABLE_SCI32 + // Mixed-Up Mother Goose - English Amiga (from www.back2roots.org) {{"mothergoose", "", { {"resource.map", 0, "4aa28ac93fae03cf854594da13d9229c", 2700}, @@ -1590,6 +1602,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 000, 679) }, +#ifdef ENABLE_SCI32 + #if 0 // Phantasmagoria - English DOS {{"phantasmagoria", "", { @@ -1634,6 +1648,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#endif // #ifdef ENABLE_SCI32 + // Police Quest 1 VGA Remake - English DOS {{"pq1sci", "VGA Remake", { {"resource.map", 0, "35efa814fb994b1cbdac9611e401da67", 5013}, @@ -1750,6 +1766,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 0, 510) // T.A00.052 }, +#ifdef ENABLE_SCI32 // Police Quest 4 - English DOS demo (from FRG) {{"pq4", "Demo", { {"resource.map", 0, "be56f87a1c4a13062a30a362df860c2f", 1472}, @@ -1779,6 +1796,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION_AUTODETECT, SCI_VERSION(2, 000, 000) }, +#endif // Quest for Glory 1 - English Amiga {{"qfg1", "", { @@ -1909,6 +1927,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#ifdef ENABLE_SCI32 #if 0 // Quest for Glory 4 - English DOS {{"qfg4", "", { @@ -2033,6 +2052,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#endif // #ifdef ENABLE_SCI32 + // Space Quest 1 VGA Remake - English Amiga (from www.back2roots.org) {{"sq1sci", "VGA Remake", { {"resource.map", 0, "106484b372af1d4cbf866472cc2813dc", 6396}, @@ -2329,6 +2350,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#ifdef ENABLE_SCI32 // Space Quest 6 - English DOS/Win3.11 CD {{"sq6", "", { {"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528}, @@ -2371,6 +2393,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, #endif +#endif // #ifdef ENABLE_SCI32 + // The Island of Dr. Brain - English 1.1 2.3.93 (from Quietust) {{"islandbrain", "", { {"resource.map", 0, "3c07da06bdd1689f9d07af78fb94d0ec", 3101}, @@ -2403,6 +2427,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION(1, 1, 53) }, +#ifdef ENABLE_SCI32 // Torin's Passage - English Windows {{"torin", "", { {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799}, @@ -2452,7 +2477,8 @@ static const struct SciGameDescription SciGameDescriptions[] = { SCI_VERSION_AUTODETECT, SCI_VERSION(2, 100, 2) }, - +#endif // #ifdef ENABLE_SCI32 + // SCI Fanmade Games FANMADE("Al Pond 2: Island Quest", "9625372e710d1a95d2027b48f9e325af", 1506, "a0f9aa65b9bf3d8703adff5a621f243c", 889843), FANMADE("Al Pond: Island Quest 2", "4cba6a5a4c8f66f21935ed78b0511a92", 870, "876587dc9a5ec569287a3dc4b29139d8", 613769), @@ -2525,7 +2551,11 @@ public: SciMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "SCI Engine"; + return "SCI Engine [SCI0, SCI01, SCI10, SCI11" +#ifdef ENABLE_SCI32 + ", SCI32" +#endif + "]"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 34912d2dc0..dc57e0da25 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -185,7 +185,9 @@ static int sci_max_allowed_unknown_kernel_functions[] = { 0x7b, // SCI1/EARLY 0x7b, // SCI1/LATE 0x7b, // SCI1.1 +#ifdef ENABLE_SCI32 0x0, // SCI32 +#endif }; #define DEFUN(nm, cname, sig) {KF_NEW, nm, {cname, sig, NULL}} diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index c81b6c83d6..a7e22129ec 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -55,8 +55,12 @@ GfxResManager::GfxResManager(int version, gfx_options_t *options, gfx_driver_t * if (_version < SCI_VERSION_01_VGA) { _staticPalette = gfx_sci0_pic_colors->getref(); - } else if (_version == SCI_VERSION_1_1 || _version == SCI_VERSION_32) { + } else if (_version == SCI_VERSION_1_1) { GFXDEBUG("Palettes are not yet supported in this SCI version\n"); +#ifdef ENABLE_SCI32 + } else if (_version == SCI_VERSION_32) { + GFXDEBUG("Palettes are not yet supported in this SCI version\n"); +#endif } else { Resource *res = resManager->findResource(kResourceTypePalette, 999, 0); if (res && res->data) diff --git a/engines/sci/scicore/decompressor.cpp b/engines/sci/scicore/decompressor.cpp index 06eeb8fe89..6d6921c505 100644 --- a/engines/sci/scicore/decompressor.cpp +++ b/engines/sci/scicore/decompressor.cpp @@ -705,6 +705,8 @@ int DecompressorDCL::unpackDCL(byte* dest) { return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE; } +#ifdef ENABLE_SCI32 + //---------------------------------------------- // STACpack/LZS decompressor for SCI32 // Based on Andre Beck's code from http://micky.ibh.de/~beck/stuff/lzs4i4l/ @@ -779,4 +781,6 @@ void DecompressorLZS::copyComp(int offs, int clen) { putByte(_dest[hpos++]); } +#endif // #ifdef ENABLE_SCI32 + } // End of namespace Sci diff --git a/engines/sci/scicore/decompressor.h b/engines/sci/scicore/decompressor.h index bdbfd3c823..9a566aa845 100644 --- a/engines/sci/scicore/decompressor.h +++ b/engines/sci/scicore/decompressor.h @@ -38,7 +38,9 @@ enum ResourceCompression { kCompLZW1View, // Comp3 + view Post-processing kCompLZW1Pic, // Comp3 + pic Post-processing kCompDCL, +#ifdef ENABLE_SCI32 kCompSTACpack // ? Used in SCI32 +#endif }; //---------------------------------------------- // Base class for decompressors @@ -179,6 +181,7 @@ protected: int huffman_lookup(int *tree); }; +#ifdef ENABLE_SCI32 //---------------------------------------------- // STACpack decompressor for SCI32 //---------------------------------------------- @@ -190,6 +193,7 @@ protected: uint16 getCompLen(); void copyComp(int offs, int clen); }; +#endif } // End of namespace Sci diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp index e0f3b8c8de..392ea3b560 100644 --- a/engines/sci/scicore/resource.cpp +++ b/engines/sci/scicore/resource.cpp @@ -487,9 +487,11 @@ ResourceManager::ResourceManager(int version, int maxMemory) { case SCI_VERSION_1_1: debug("Resmgr: Detected SCI1.1"); break; +#ifdef ENABLE_SCI32 case SCI_VERSION_32: debug("Resmgr: Couldn't determine SCI version"); break; +#endif default: debug("Resmgr: Couldn't determine SCI version"); break; @@ -692,11 +694,14 @@ int ResourceManager::detectMapVersion() { } return SCI_VERSION_1; } + +#ifdef ENABLE_SCI32 // late SCI1.1 and SCI32 maps have last directory entry set to 0xFF // offset set to filesize and 4 more bytes file.seek(off - 7, SEEK_SET); if (file.readByte() == 0xFF && file.readUint16LE() == file.size()) return SCI_VERSION_32; // TODO : check if there is a difference between these maps +#endif return SCI_VERSION_AUTODETECT; } @@ -786,6 +791,8 @@ int ResourceManager::detectVolVersion() { } if (!bFailed) return SCI_VERSION_1_1; + +#ifdef ENABLE_SCI32 // // Check for SCI32 v2 format (Gabriel Knight 1 CD) bFailed = false; @@ -809,6 +816,7 @@ int ResourceManager::detectVolVersion() { } if (!bFailed) return SCI_VERSION_32; +#endif // Failed to detect volume version return SCI_VERSION_AUTODETECT; @@ -1003,10 +1011,13 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) { res->number = number; res->id = resId;//res->number | (res->type << 16); res->source = _mapVersion < SCI_VERSION_1_1 ? getVolume(map, off >> 28) : getVolume(map, 0); - if (_mapVersion < SCI_VERSION_32) - res->file_offset = _mapVersion < SCI_VERSION_1_1 ? off & 0x0FFFFFFF : off << 1; - else +#ifdef ENABLE_SCI32 + if (_mapVersion >= SCI_VERSION_32) res->file_offset = off; // in SCI32 it's a plain offset + else +#endif + res->file_offset = _mapVersion < SCI_VERSION_1_1 ? off & 0x0FFFFFFF : off << 1; + } } } @@ -1046,6 +1057,7 @@ int ResourceManager::readResourceInfo(Resource *res, Common::File *file, szUnpacked = file->readUint16LE(); wCompression = file->readUint16LE(); break; +#ifdef ENABLE_SCI32 case SCI_VERSION_32: type = (ResourceType)(file->readByte() &0x7F); number = file->readUint16LE(); @@ -1053,6 +1065,7 @@ int ResourceManager::readResourceInfo(Resource *res, Common::File *file, szUnpacked = file->readUint32LE(); wCompression = file->readUint16LE(); break; +#endif default: return SCI_ERROR_INVALID_RESMAP_ENTRY; } @@ -1085,9 +1098,11 @@ int ResourceManager::readResourceInfo(Resource *res, Common::File *file, case 20: compression = kCompDCL; break; +#ifdef ENABLE_SCI32 case 32: compression = kCompSTACpack; break; +#endif default: compression = kCompUnknown; } @@ -1122,9 +1137,11 @@ int ResourceManager::decompress(Resource *res, Common::File *file) { case kCompDCL: dec = new DecompressorDCL; break; +#ifdef ENABLE_SCI32 case kCompSTACpack: dec = new DecompressorLZS; break; +#endif default: warning("Resource %s #%d: Compression method %d not supported", getResourceTypeName(res->type), res->number, compression); diff --git a/engines/sci/scicore/resource.h b/engines/sci/scicore/resource.h index 29cf38e265..75ad99f5b9 100644 --- a/engines/sci/scicore/resource.h +++ b/engines/sci/scicore/resource.h @@ -79,7 +79,9 @@ enum ResourceStatus { #define SCI_VERSION_1_EARLY 5 #define SCI_VERSION_1_LATE 6 #define SCI_VERSION_1_1 7 +#ifdef ENABLE_SCI32 #define SCI_VERSION_32 8 +#endif #define SCI_VERSION_LAST SCI_VERSION_1_LATE /* The last supported SCI version */ #define SCI_VERSION_1 SCI_VERSION_1_EARLY diff --git a/engines/sci/scicore/vocab_debug.cpp b/engines/sci/scicore/vocab_debug.cpp index 189024770d..deb2c2b2cf 100644 --- a/engines/sci/scicore/vocab_debug.cpp +++ b/engines/sci/scicore/vocab_debug.cpp @@ -569,8 +569,11 @@ char **vocabulary_get_knames(ResourceManager *resmgr, int *count) { case SCI_VERSION_1_LATE: return vocabulary_get_knames1(resmgr, count); case SCI_VERSION_1_1: + return vocabulary_get_knames11(resmgr, count); +#ifdef ENABLE_SCI32 case SCI_VERSION_32: return vocabulary_get_knames11(resmgr, count); +#endif default: return 0; } |