diff options
author | Travis Howell | 2006-03-22 06:21:17 +0000 |
---|---|---|
committer | Travis Howell | 2006-03-22 06:21:17 +0000 |
commit | 5a8a32e350763639d9256b8d90bc4facc3ea72be (patch) | |
tree | b9f6cd23d66433d462ab68f73befd3f21474dec1 /engines/simon | |
parent | e0cf2743c9b211142cee27fc58459f18985db514 (diff) | |
download | scummvm-rg350-5a8a32e350763639d9256b8d90bc4facc3ea72be.tar.gz scummvm-rg350-5a8a32e350763639d9256b8d90bc4facc3ea72be.tar.bz2 scummvm-rg350-5a8a32e350763639d9256b8d90bc4facc3ea72be.zip |
Add initial support for Amiga and Macintosh versions of The Feeble Files
svn-id: r21399
Diffstat (limited to 'engines/simon')
-rw-r--r-- | engines/simon/game.cpp | 142 | ||||
-rw-r--r-- | engines/simon/intern.h | 12 | ||||
-rw-r--r-- | engines/simon/res.cpp | 19 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 67 | ||||
-rw-r--r-- | engines/simon/simon.h | 1 | ||||
-rw-r--r-- | engines/simon/vga.cpp | 4 |
6 files changed, 230 insertions, 15 deletions
diff --git a/engines/simon/game.cpp b/engines/simon/game.cpp index 551fe8e003..4d4f22e479 100644 --- a/engines/simon/game.cpp +++ b/engines/simon/game.cpp @@ -417,14 +417,42 @@ static GameMD5 gameMD5[] = { { GID_SIMON2WIN_PL, "e229f84d46fa83f99b4a7115679f3fb6", "stripped.txt", false}, { GID_SIMON2WIN_PL, "2082f8d02075e590300478853a91ffd9", "tbllist", false}, - { GID_FEEBLEFILES_2CD, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false }, - { GID_FEEBLEFILES_2CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, - - { GID_FEEBLEFILES_4CD, "a8746407a5b20a7da0da0a14c380af1c", "game22", false }, - { GID_FEEBLEFILES_4CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, - - { GID_FEEBLEFILES_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false }, - { GID_FEEBLEFILES_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + { GID_FEEBLEFILES_AMI_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false }, + { GID_FEEBLEFILES_AMI_DE, "f550f7915c5ce3a68c9f870f507449c2", "gfxindex.dat", false}, + { GID_FEEBLEFILES_AMI_DE, "bdb4cf3eacfeffc3aed4f90bf87c5690", "sfxindex.dat", false}, + { GID_FEEBLEFILES_AMI_DE, "e0f9e91213e4b6f684e2a9a67d7a4660", "spindex.dat", false}, + { GID_FEEBLEFILES_AMI_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_AMI_UK, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false }, + { GID_FEEBLEFILES_AMI_UK, "f550f7915c5ce3a68c9f870f507449c2", "gfxindex.dat", false}, + { GID_FEEBLEFILES_AMI_UK, "bdb4cf3eacfeffc3aed4f90bf87c5690", "sfxindex.dat", false}, + { GID_FEEBLEFILES_AMI_UK, "e0f9e91213e4b6f684e2a9a67d7a4660", "spindex.dat", false}, + { GID_FEEBLEFILES_AMI_UK, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_MAC_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false }, + { GID_FEEBLEFILES_MAC_DE, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false}, + { GID_FEEBLEFILES_MAC_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_MAC_FR, "ba90b40a47726039671d9e91630dd7ed", "game22", false }, + { GID_FEEBLEFILES_MAC_FR, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false}, + { GID_FEEBLEFILES_MAC_FR, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_MAC_SP, "71d7d2d5e479b053c5a9757f1702c9c3", "game22", false }, + { GID_FEEBLEFILES_MAC_SP, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false}, + { GID_FEEBLEFILES_MAC_SP, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_MAC_UK, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false }, + { GID_FEEBLEFILES_MAC_UK, "11a4853cb35956846976e9473ee0e41e", "graphics.vga", false}, + { GID_FEEBLEFILES_MAC_UK, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_2CD, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false }, + { GID_FEEBLEFILES_2CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_4CD, "a8746407a5b20a7da0da0a14c380af1c", "game22", false }, + { GID_FEEBLEFILES_4CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, + + { GID_FEEBLEFILES_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false }, + { GID_FEEBLEFILES_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false}, }; // Simon the Sorcerer 1 @@ -488,6 +516,20 @@ static GameFileDescription FEEBLEFILES_GameFiles[] = { {"tbllist", GAME_TBLFILE}, }; +static GameFileDescription FEEBLEFILES_AMI_GameFiles[] = { + {"game22", GAME_BASEFILE}, + {"gfxindex.dat", GAME_GFXIDXFILE}, + {"sfxindex.dat", GAME_SFXIDXFILE}, + {"spindex.dat", GAME_SPIDXFILE}, + {"tbllist", GAME_TBLFILE}, +}; + +static GameFileDescription FEEBLEFILES_MAC_GameFiles[] = { + {"game22", GAME_BASEFILE}, + {"graphics.vga", GAME_GFXIDXFILE}, + {"tbllist", GAME_TBLFILE}, +}; + static GameDescription gameDescriptions[] = { // Simon the Sorcerer 1 - English Acorn CD Demo { @@ -1076,7 +1118,85 @@ static GameDescription gameDescriptions[] = { Common::kPlatformWindows, }, - // The Feeble Files - English 2CD + // The Feeble Files - English Amiga CD + { + "feeble", + GType_FF, + GID_FEEBLEFILES_AMI_UK, + "CD", + ARRAYSIZE(FEEBLEFILES_AMI_GameFiles), + FEEBLEFILES_AMI_GameFiles, + GF_OLD_BUNDLE | GF_TALKIE, + Common::EN_USA, + Common::kPlatformAmiga, + }, + + // The Feeble Files - German Amiga CD + { + "feeble", + GType_FF, + GID_FEEBLEFILES_AMI_DE, + "CD", + ARRAYSIZE(FEEBLEFILES_AMI_GameFiles), + FEEBLEFILES_AMI_GameFiles, + GF_OLD_BUNDLE | GF_TALKIE, + Common::DE_DEU, + Common::kPlatformAmiga, + }, + + // The Feeble Files - English Macintosh CD + { + "feeble", + GType_FF, + GID_FEEBLEFILES_MAC_UK, + "CD", + ARRAYSIZE(FEEBLEFILES_MAC_GameFiles), + FEEBLEFILES_MAC_GameFiles, + GF_OLD_BUNDLE | GF_TALKIE, + Common::EN_USA, + Common::kPlatformMacintosh, + }, + + // The Feeble Files - French Macintosh CD + { + "feeble", + GType_FF, + GID_FEEBLEFILES_MAC_FR, + "CD", + ARRAYSIZE(FEEBLEFILES_MAC_GameFiles), + FEEBLEFILES_MAC_GameFiles, + GF_OLD_BUNDLE | GF_TALKIE, + Common::FR_FRA, + Common::kPlatformMacintosh, + }, + + // The Feeble Files - German Macintosh CD + { + "feeble", + GType_FF, + GID_FEEBLEFILES_MAC_DE, + "CD", + ARRAYSIZE(FEEBLEFILES_MAC_GameFiles), + FEEBLEFILES_MAC_GameFiles, + GF_OLD_BUNDLE | GF_TALKIE, + Common::DE_DEU, + Common::kPlatformMacintosh, + }, + + // The Feeble Files - Spanish Macintosh CD + { + "feeble", + GType_FF, + GID_FEEBLEFILES_MAC_SP, + "CD", + ARRAYSIZE(FEEBLEFILES_MAC_GameFiles), + FEEBLEFILES_MAC_GameFiles, + GF_OLD_BUNDLE | GF_TALKIE, + Common::ES_ESP, + Common::kPlatformMacintosh, + }, + + // The Feeble Files - English Windows 2CD { "feeble", GType_FF, @@ -1089,7 +1209,7 @@ static GameDescription gameDescriptions[] = { Common::kPlatformWindows, }, - // The Feeble Files - English 4CD + // The Feeble Files - English Windows 4CD { "feeble", GType_FF, @@ -1102,7 +1222,7 @@ static GameDescription gameDescriptions[] = { Common::kPlatformWindows, }, - // The Feeble Files - German 4CD + // The Feeble Files - German Windows 4CD { "feeble", GType_FF, diff --git a/engines/simon/intern.h b/engines/simon/intern.h index 523a588135..2f69688fd7 100644 --- a/engines/simon/intern.h +++ b/engines/simon/intern.h @@ -159,7 +159,11 @@ enum GameFileTypes { GAME_ICONFILE = 1 << 1, GAME_GMEFILE = 1 << 2, GAME_STRFILE = 1 << 3, - GAME_TBLFILE = 1 << 4 + GAME_TBLFILE = 1 << 4, + + GAME_GFXIDXFILE = 1 << 5, + GAME_SFXIDXFILE = 1 << 6, + GAME_SPIDXFILE = 1 << 7 }; enum GameIds { @@ -210,6 +214,12 @@ enum GameIds { GID_SIMON2WIN_DE2, GID_SIMON2WIN_PL, + GID_FEEBLEFILES_AMI_DE, + GID_FEEBLEFILES_AMI_UK, + GID_FEEBLEFILES_MAC_DE, + GID_FEEBLEFILES_MAC_FR, + GID_FEEBLEFILES_MAC_SP, + GID_FEEBLEFILES_MAC_UK, GID_FEEBLEFILES_2CD, GID_FEEBLEFILES_4CD, GID_FEEBLEFILES_DE diff --git a/engines/simon/res.cpp b/engines/simon/res.cpp index 0be063c065..e19a510138 100644 --- a/engines/simon/res.cpp +++ b/engines/simon/res.cpp @@ -128,6 +128,25 @@ uint16 SimonEngine::readUint16Wrapper(const void *src) { return READ_BE_UINT16(src); } +void SimonEngine::loadOffsets(const char *filename, int number, uint32 &file, uint32 &offset, uint32 &srcSize, uint32 &dstSize) { + Common::File in; + + int offsSize = (getPlatform() == Common::kPlatformAmiga) ? 16 : 12; + + /* read offsets from index */ + in.open(filename); + if (in.isOpen() == false) { + error("Can't open index file '%s'", filename); + } + + in.seek(number * offsSize, SEEK_SET); + offset = in.readUint32LE(); + dstSize = in.readUint32LE(); + srcSize = in.readUint32LE(); + file = in.readUint32LE(); + in.close(); +} + void SimonEngine::loadGamePcFile(const char *filename) { Common::File in; int num_inited_objects; diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 8787245e5c..f6a3025356 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -48,6 +48,10 @@ extern bool isSmartphone(void); #include "globals.h" #endif +#ifdef USE_ZLIB +#include <zlib.h> +#endif + using Common::File; namespace Simon { @@ -457,6 +461,17 @@ int SimonEngine::init(GameDetector &detector) { File::addDefaultDirectory(_gameDataPath + "execute/"); File::addDefaultDirectory(_gameDataPath + "EXECUTE/"); + // Add default file directories for Amiga & Macintosh + // versions of The Feeble Files + File::addDefaultDirectory(_gameDataPath + "gfx/"); + File::addDefaultDirectory(_gameDataPath + "GFX/"); + File::addDefaultDirectory(_gameDataPath + "movies/"); + File::addDefaultDirectory(_gameDataPath + "MOVIES/"); + File::addDefaultDirectory(_gameDataPath + "sfx/"); + File::addDefaultDirectory(_gameDataPath + "SFX/"); + File::addDefaultDirectory(_gameDataPath + "speech/"); + File::addDefaultDirectory(_gameDataPath + "SPEECH/"); + // Detect game if (!initGame()) { return -1; @@ -2250,7 +2265,10 @@ void SimonEngine::loadZone(uint vga_res) { vpe->vgaFile1 = read_vga_from_datfile_2(vga_res * 2, 1); vpe->vgaFile2 = read_vga_from_datfile_2(vga_res * 2 + 1, 2); - vpe->sfxFile = read_vga_from_datfile_2(vga_res * 2, 3); + + vpe->sfxFile = NULL; + if (getGameType() == GType_FF && getPlatform() == Common::kPlatformWindows) + read_vga_from_datfile_2(vga_res * 2, 3); } @@ -3676,7 +3694,52 @@ byte *SimonEngine::read_vga_from_datfile_2(uint id, uint type) { // is base on: 2 (lines) * 320 (screen width) * 10 (textheight) -- olki int extraBuffer = (id == 5 ? 6400 : 0); - if (getFeatures() & GF_OLD_BUNDLE) { + if (getGameType() == GType_FF && getPlatform() != Common::kPlatformWindows) { +#ifdef USE_ZLIB + File in; + char buf[15]; + byte *dst = NULL; + + uint32 file, offset, srcSize, dstSize; + if (getPlatform() == Common::kPlatformAmiga) { + loadOffsets((const char*)"gfxindex.dat", id / 2 * 3 + type, file, offset, srcSize, dstSize); + } else { + loadOffsets((const char*)"graphics.vga", id / 2 * 3 + type, file, offset, srcSize, dstSize); + } + + if (getPlatform() == Common::kPlatformAmiga) + sprintf(buf, "GFX%d.VGA", file); + else + sprintf(buf, "graphics.vga"); + + in.open(buf); + if (in.isOpen() == false) + error("read_vga_from_datfile_2: can't open %s", buf); + + dst = setup_vga_destination(dstSize); + + in.seek(offset, SEEK_SET); + if (srcSize != dstSize) { + byte *srcBuffer = (byte *)malloc(srcSize); + + if (in.read(srcBuffer, srcSize) != srcSize) + error("read_vga_from_datfile_2: read failed"); + + unsigned long decompressedSize = dstSize; + int result = uncompress(dst, &decompressedSize, srcBuffer, srcSize); + if (result != Z_OK) + error("read_vga_from_datfile_2() Zlib uncompress error"); + free(srcBuffer); + } else { + if (in.read(dst, dstSize) != dstSize) + error("read_vga_from_datfile_2: read failed"); + } + in.close(); +#else + error("Zlib support is required for Amiga and Macintosh versions"); +#endif + return dst; + } else if (getFeatures() & GF_OLD_BUNDLE) { File in; char buf[15]; uint32 size; diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 35d2ffd0e4..61b936d4d6 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -456,6 +456,7 @@ protected: void readItemChildren(Common::File *in, Item *item, uint tmp); void readItemFromGamePc(Common::File *in, Item *item); void loadGamePcFile(const char *filename); + void loadOffsets(const char *filename, int number, uint32 &file, uint32 &offset, uint32 &compressedSize, uint32 &size); void palette_fadeout(uint32 *pal_values, uint num); diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp index f34f5fa201..ba13f1dc6b 100644 --- a/engines/simon/vga.cpp +++ b/engines/simon/vga.cpp @@ -1881,7 +1881,9 @@ void SimonEngine::vc52_playSound() { if (getGameType() == GType_FF) { uint16 pan = vcReadNextWord(); uint16 vol = vcReadNextWord(); - _sound->playSoundData(_curSfxFile, sound, pan, vol, ambient); + + if (_curSfxFile != NULL) + _sound->playSoundData(_curSfxFile, sound, pan, vol, ambient); } else if (getGameType() == GType_SIMON2) { if (ambient) { _sound->playAmbient(sound); |