Created
November 18, 2012 16:09
-
-
Save symm/4106019 to your computer and use it in GitHub Desktop.
Steam LucasArts Adventures patch (from http://scummvm.bencastricum.nl/) ported to ScummVM v1.5.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp | |
index 1c5c435..32b38ef 100644 | |
--- a/audio/audiostream.cpp | |
+++ b/audio/audiostream.cpp | |
@@ -33,6 +33,7 @@ | |
#include "audio/decoders/quicktime.h" | |
#include "audio/decoders/raw.h" | |
#include "audio/decoders/vorbis.h" | |
+#include "audio/decoders/cdda.h" | |
namespace Audio { | |
@@ -78,6 +79,13 @@ SeekableAudioStream *SeekableAudioStream::openStreamFile(const Common::String &b | |
} | |
} | |
+ if (stream == NULL) { | |
+ fileHandle->open("CDDA.SOU"); | |
+ if (fileHandle->isOpen()) { | |
+ stream = makeCDDAStream(fileHandle, DisposeAfterUse::YES); | |
+ fileHandle = 0; | |
+ } | |
+ } | |
delete fileHandle; | |
if (stream == NULL) | |
diff --git a/audio/decoders/cdda.cpp b/audio/decoders/cdda.cpp | |
new file mode 100644 | |
index 0000000..18f88ef | |
--- /dev/null | |
+++ b/audio/decoders/cdda.cpp | |
@@ -0,0 +1,118 @@ | |
+/* ScummVM - Graphic Adventure Engine | |
+ * | |
+ * ScummVM is the legal property of its developers, whose names | |
+ * are too numerous to list here. Please refer to the COPYRIGHT | |
+ * file distributed with this source distribution. | |
+ * | |
+ * This program is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU General Public License | |
+ * as published by the Free Software Foundation; either version 2 | |
+ * of the License, or (at your option) any later version. | |
+ | |
+ * This program is distributed in the hope that it will be useful, | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
+ * GNU General Public License for more details. | |
+ | |
+ * You should have received a copy of the GNU General Public License | |
+ * along with this program; if not, write to the Free Software | |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
+ * | |
+ */ | |
+ | |
+#include "audio/decoders/cdda.h" | |
+ | |
+#include "common/debug.h" | |
+#include "common/ptr.h" | |
+#include "common/stream.h" | |
+#include "common/textconsole.h" | |
+#include "common/util.h" | |
+ | |
+#include "audio/audiostream.h" | |
+ | |
+namespace Audio { | |
+ | |
+ | |
+#pragma mark - | |
+#pragma mark --- CDDA stream --- | |
+#pragma mark - | |
+ | |
+class CDDAStream : public SeekableAudioStream { | |
+protected: | |
+ Common::SeekableReadStream *_stream; | |
+ bool _disposeAfterUse; | |
+ uint8 _shiftLeft; | |
+ uint8 _shiftRight; | |
+ uint32 _pos; | |
+ | |
+public: | |
+ CDDAStream(Common::SeekableReadStream *stream, bool dispose); | |
+ virtual ~CDDAStream(); | |
+ | |
+ int readBuffer(int16 *buffer, const int numSamples); | |
+ bool isStereo() const { return 1; } | |
+ int getRate() const { return 44100; } | |
+ bool endOfData() const { return _stream->eos(); } | |
+ bool seek(const Timestamp &where); | |
+ Timestamp getLength() const { return 0; } | |
+}; | |
+ | |
+CDDAStream::CDDAStream(Common::SeekableReadStream *stream, bool dispose) : | |
+ _stream(stream), | |
+ _disposeAfterUse(dispose) { | |
+ | |
+ _shiftLeft = 0; | |
+ _shiftRight = 0; | |
+ _pos = 800; | |
+ _stream->seek(800, SEEK_SET); | |
+} | |
+ | |
+CDDAStream::~CDDAStream() { | |
+ if (_disposeAfterUse) | |
+ delete _stream; | |
+} | |
+ | |
+bool CDDAStream::seek(const Timestamp &where) { | |
+ | |
+ const uint32 seekSample = convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames(); | |
+ uint32 blocks = seekSample / 1176; | |
+ | |
+ _pos = 800 + blocks + seekSample; | |
+ return _stream->seek(_pos, SEEK_SET); | |
+} | |
+ | |
+int CDDAStream::readBuffer(int16 *buffer, const int numSamples) { | |
+ int samples; | |
+ | |
+ for (samples = 0 ; samples < numSamples && !_stream->eos() ; ) { | |
+ if ( !((_pos - 800) % 1177) ) { | |
+ _shiftRight = _stream->readByte(); | |
+ _shiftLeft = _shiftRight >> 4; | |
+ _shiftRight = _shiftRight & 0x0F; | |
+ _pos++; | |
+ } | |
+ buffer[samples++] = _stream->readSByte() << _shiftLeft; | |
+ buffer[samples++] = _stream->readSByte() << _shiftRight; | |
+ _pos += 2; | |
+ } | |
+ return samples; | |
+} | |
+ | |
+#pragma mark - | |
+#pragma mark --- CDDA factory functions --- | |
+#pragma mark - | |
+ | |
+SeekableAudioStream *makeCDDAStream( | |
+ Common::SeekableReadStream *stream, | |
+ DisposeAfterUse::Flag disposeAfterUse) { | |
+ SeekableAudioStream *s = new CDDAStream(stream, disposeAfterUse); | |
+ if (s && s->endOfData()) { | |
+ delete s; | |
+ return 0; | |
+ } else { | |
+ return s; | |
+ } | |
+ return 0; | |
+} | |
+ | |
+} // End of namespace Audio | |
diff --git a/audio/decoders/cdda.h b/audio/decoders/cdda.h | |
new file mode 100644 | |
index 0000000..877facd | |
--- /dev/null | |
+++ b/audio/decoders/cdda.h | |
@@ -0,0 +1,57 @@ | |
+/* ScummVM - Graphic Adventure Engine | |
+ * | |
+ * ScummVM is the legal property of its developers, whose names | |
+ * are too numerous to list here. Please refer to the COPYRIGHT | |
+ * file distributed with this source distribution. | |
+ * | |
+ * This program is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU General Public License | |
+ * as published by the Free Software Foundation; either version 2 | |
+ * of the License, or (at your option) any later version. | |
+ | |
+ * This program is distributed in the hope that it will be useful, | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
+ * GNU General Public License for more details. | |
+ | |
+ * You should have received a copy of the GNU General Public License | |
+ * along with this program; if not, write to the Free Software | |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
+ * | |
+ */ | |
+ | |
+/** | |
+ * @file | |
+ * Sound decoder used in engines: | |
+ * - scumm (Loom/Steam) | |
+ */ | |
+ | |
+#ifndef SOUND_CDDA_H | |
+#define SOUND_CDDA_H | |
+ | |
+#include "common/scummsys.h" | |
+#include "common/types.h" | |
+ | |
+namespace Common { | |
+class SeekableReadStream; | |
+} | |
+ | |
+namespace Audio { | |
+ | |
+class SeekableAudioStream; | |
+ | |
+/** | |
+ * Create a new SeekableAudioStream from the CDDA data in the given stream. | |
+ * Allows for seeking (which is why we require a SeekableReadStream). | |
+ * | |
+ * @param stream the SeekableReadStream from which to read the CDDA data | |
+ * @param disposeAfterUse whether to delete the stream after use | |
+ * @return a new SeekableAudioStream, or NULL, if an error occurred | |
+ */ | |
+SeekableAudioStream *makeCDDAStream( | |
+ Common::SeekableReadStream *stream, | |
+ DisposeAfterUse::Flag disposeAfterUse); | |
+ | |
+} // End of namespace Audio | |
+ | |
+#endif // #ifndef SOUND_CDDA_H | |
diff --git a/audio/module.mk b/audio/module.mk | |
index e3aa0aa..c0890ed 100644 | |
--- a/audio/module.mk | |
+++ b/audio/module.mk | |
@@ -27,6 +27,7 @@ MODULE_OBJS := \ | |
decoders/vorbis.o \ | |
decoders/wave.o \ | |
decoders/xa.o \ | |
+ decoders/cdda.o \ | |
mods/infogrames.o \ | |
mods/maxtrax.o \ | |
mods/module.o \ | |
diff --git a/common/platform.h b/common/platform.h | |
index 1891c70..127647a 100644 | |
--- a/common/platform.h | |
+++ b/common/platform.h | |
@@ -55,6 +55,8 @@ enum Platform { | |
kPlatformPSX, | |
kPlatformCDi, | |
kPlatformIOS, | |
+ /* Not really a platform */ | |
+ kPlatformSteam, | |
kPlatformUnknown = -1 | |
}; | |
diff --git a/engines/engine.cpp b/engines/engine.cpp | |
index 2ef4eca..7d341c7 100644 | |
--- a/engines/engine.cpp | |
+++ b/engines/engine.cpp | |
@@ -333,6 +333,9 @@ void Engine::checkCD() { | |
return; | |
#endif | |
+if (Common::File::exists("CDDA.SOU")) | |
+ return; | |
+ | |
char buffer[MAXPATHLEN]; | |
int i; | |
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp | |
index 8730592..798e934 100644 | |
--- a/engines/scumm/detection.cpp | |
+++ b/engines/scumm/detection.cpp | |
@@ -73,7 +73,9 @@ Common::String ScummEngine::generateFilename(const int room) const { | |
const int diskNumber = (room > 0) ? _res->_types[rtRoom][room]._roomno : 0; | |
Common::String result; | |
- if (_game.version == 4) { | |
+ if (!room && (_filenamePattern.genMethod == kGenDiskNumSteam || _filenamePattern.genMethod == kGenRoomNumSteam)) { | |
+ result = Common::String::format("testapp.exe"); | |
+ } else if (_game.version == 4) { | |
if (room == 0 || room >= 900) { | |
result = Common::String::format("%03d.lfl", room); | |
} else { | |
@@ -81,10 +83,12 @@ Common::String ScummEngine::generateFilename(const int room) const { | |
} | |
} else { | |
switch (_filenamePattern.genMethod) { | |
+ case kGenDiskNumSteam: | |
case kGenDiskNum: | |
result = Common::String::format(_filenamePattern.pattern, diskNumber); | |
break; | |
+ case kGenRoomNumSteam: | |
case kGenRoomNum: | |
result = Common::String::format(_filenamePattern.pattern, room); | |
break; | |
@@ -216,6 +220,11 @@ static Common::String generateFilenameForDetection(const char *pattern, Filename | |
Common::String result; | |
switch (genMethod) { | |
+ case kGenDiskNumSteam: | |
+ case kGenRoomNumSteam: | |
+ result = Common::String::format("testapp.exe" ); | |
+ break; | |
+ | |
case kGenDiskNum: | |
case kGenRoomNum: | |
result = Common::String::format(pattern, 0); | |
diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h | |
index 5ed6b5a..089cab9 100644 | |
--- a/engines/scumm/detection.h | |
+++ b/engines/scumm/detection.h | |
@@ -95,7 +95,9 @@ struct GameSettings { | |
enum FilenameGenMethod { | |
kGenDiskNum, | |
+ kGenDiskNumSteam, | |
kGenRoomNum, | |
+ kGenRoomNumSteam, | |
kGenHEMac, | |
kGenHEMacNoParens, | |
kGenHEPC, | |
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h | |
index be1b90e..6b29443 100644 | |
--- a/engines/scumm/detection_tables.h | |
+++ b/engines/scumm/detection_tables.h | |
@@ -221,6 +221,7 @@ static const GameSettings gameVariantsTable[] = { | |
{"indy3", "EGA", "ega", GID_INDY3, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, 0, UNK, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
{"indy3", "No AdLib", "ega", GID_INDY3, 3, 0, MDT_PCSPK | MDT_PCJR, 0, UNK, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
{"indy3", "VGA", "vga", GID_INDY3, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, GF_OLD256 | GF_FEW_LOCALS, Common::kPlatformPC, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
+ {"indy3", "Steam", "steam", GID_INDY3, 3, 0, MDT_PCSPK | MDT_ADLIB, GF_OLD256 | GF_FEW_LOCALS | GF_STEAM, Common::kPlatformPC, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
{"indy3", "FM-TOWNS", 0, GID_INDY3, 3, 0, MDT_TOWNS, GF_OLD256 | GF_FEW_LOCALS | GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GUIO_NOASPECT)}, | |
{"loom", "EGA", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO1(GUIO_NOSPEECH)}, | |
@@ -230,6 +231,7 @@ static const GameSettings gameVariantsTable[] = { | |
#endif | |
{"loom", "FM-TOWNS", 0, GID_LOOM, 3, 0, MDT_TOWNS, GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformFMTowns, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GUIO_NOASPECT)}, | |
{"loom", "VGA", "vga", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformPC, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
+ {"loom", "Steam", "steam", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS | GF_STEAM, Common::kPlatformPC, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
{"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, GF_16COLOR, Common::kPlatformPC, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)}, | |
@@ -246,6 +248,7 @@ static const GameSettings gameVariantsTable[] = { | |
{"atlantis", "", 0, GID_INDY4, 5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO0()}, | |
{"atlantis", "Floppy", 0, GID_INDY4, 5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO1(GUIO_NOSPEECH)}, | |
+ {"atlantis", "Steam", "steam", GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, GF_STEAM, UNK, GUIO_NONE}, | |
{"atlantis", "FM-TOWNS", 0, GID_INDY4, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO4(GUIO_MIDITOWNS, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_NOASPECT)}, | |
{"tentacle", "", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM, GF_USE_KEY, UNK, GUIO0()}, | |
@@ -257,7 +260,8 @@ static const GameSettings gameVariantsTable[] = { | |
#ifdef ENABLE_SCUMM_7_8 | |
{"ft", 0, 0, GID_FT, 7, 0, MDT_NONE, 0, UNK, GUIO1(GUIO_NOMIDI)}, | |
- {"dig", 0, 0, GID_DIG, 7, 0, MDT_NONE, 0, UNK, GUIO1(GUIO_NOMIDI)}, | |
+ {"dig", "", 0, GID_DIG, 7, 0, MDT_NONE, 0, UNK, GUIO_NOMIDI}, | |
+ {"dig", "Steam", "steam", GID_DIG, 7, 0, MDT_NONE, GF_STEAM, UNK, GUIO_NOMIDI}, | |
{"comi", 0, 0, GID_CMI, 8, 0, MDT_NONE, 0, Common::kPlatformWindows, GUIO2(GUIO_NOMIDI, GUIO_NOASPECT)}, | |
#endif | |
@@ -446,6 +450,7 @@ static const GameFilenamePattern gameFilenamesTable[] = { | |
{ "zak", "zak1.d64", kGenUnchanged, UNK_LANG, Common::kPlatformC64, "V1" }, // ... and zak2.d64 | |
{ "indy3", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 }, | |
+ { "indy3", "%02d.LFL", kGenRoomNumSteam, UNK_LANG, UNK, "Steam" }, | |
{ "indyloom", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 }, | |
{ "indyzak", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 }, | |
@@ -453,6 +458,7 @@ static const GameFilenamePattern gameFilenamesTable[] = { | |
{ "loom", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 }, | |
{ "loom", "%03d.LFL", kGenRoomNum, UNK_LANG, UNK, "VGA" }, // Loom CD | |
+ { "loom", "%03d.LFL", kGenRoomNumSteam, UNK_LANG, UNK, "Steam" }, | |
{ "pass", "%03d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 }, | |
@@ -466,6 +472,7 @@ static const GameFilenamePattern gameFilenamesTable[] = { | |
{ "monkey2", "mi2demo.%03d", kGenDiskNum, UNK_LANG, UNK, 0 }, | |
{ "atlantis", "atlantis.%03d", kGenDiskNum, UNK_LANG, UNK, 0 }, | |
+ { "atlantis", "atlantis.%03d", kGenDiskNumSteam, UNK_LANG, UNK, "Steam" }, | |
{ "atlantis", "fate.%03d", kGenDiskNum, UNK_LANG, UNK, 0 }, | |
{ "atlantis", "playfate.%03d", kGenDiskNum, UNK_LANG, UNK, 0 }, | |
{ "atlantis", "indy4.%03d", kGenDiskNum, Common::JA_JPN, Common::kPlatformFMTowns, "FM-TOWNS" }, | |
@@ -489,6 +496,7 @@ static const GameFilenamePattern gameFilenamesTable[] = { | |
#ifdef ENABLE_SCUMM_7_8 | |
{ "dig", "dig.la%d", kGenDiskNum, UNK_LANG, UNK, 0 }, | |
+ { "dig", "dig.la%d", kGenDiskNumSteam, UNK_LANG, UNK, "Steam" }, | |
{ "dig", "thedig.la%d", kGenDiskNum, UNK_LANG, UNK, "Demo" }, // Used by an alternate version of the demo | |
{ "dig", "The Dig Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, 0 }, | |
{ "dig", "The Dig Demo Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, "Demo" }, | |
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp | |
index b2093e9..95f182d 100644 | |
--- a/engines/scumm/resource.cpp | |
+++ b/engines/scumm/resource.cpp | |
@@ -241,12 +241,26 @@ void ScummEngine::askForDisk(const char *filename, int disknum) { | |
void ScummEngine::readIndexFile() { | |
uint32 blocktype, itemsize; | |
int numblock = 0; | |
+ int fileoffset = 0; | |
+ int maxblocks = 0; | |
debugC(DEBUG_GENERAL, "readIndexFile()"); | |
closeRoom(); | |
openRoom(0); | |
+ if (_game.features & GF_STEAM) { | |
+ if (_game.id == GID_INDY4) { | |
+ fileoffset = 0x036c50; | |
+ maxblocks = 8; | |
+ } | |
+ if (_game.id == GID_DIG) { | |
+ fileoffset = 0x05b2d8; | |
+ maxblocks = 10; | |
+ } | |
+ _fileHandle->seek(fileoffset, SEEK_SET); | |
+ } | |
+ | |
if (_game.version <= 5) { | |
// Figure out the sizes of various resources | |
while (true) { | |
@@ -280,8 +294,11 @@ void ScummEngine::readIndexFile() { | |
break; | |
} | |
_fileHandle->seek(itemsize - 8, SEEK_CUR); | |
+ numblock++; | |
+ if (maxblocks && numblock == maxblocks) | |
+ break; | |
} | |
- _fileHandle->seek(0, SEEK_SET); | |
+ _fileHandle->seek(fileoffset, SEEK_SET); | |
} | |
if (checkTryMedia(_fileHandle)) { | |
@@ -290,7 +307,9 @@ void ScummEngine::readIndexFile() { | |
return; | |
} | |
- | |
+ _fileHandle->seek(fileoffset, SEEK_SET); | |
+ | |
+ numblock=0; | |
while (true) { | |
blocktype = _fileHandle->readUint32BE(); | |
itemsize = _fileHandle->readUint32BE(); | |
@@ -298,14 +317,12 @@ void ScummEngine::readIndexFile() { | |
if (_fileHandle->eos() || _fileHandle->err()) | |
break; | |
- numblock++; | |
debug(2, "Reading index block of type '%s', size %d", tag2str(blocktype), itemsize); | |
readIndexBlock(blocktype, itemsize); | |
+ numblock++; | |
+ if (maxblocks && numblock == maxblocks) | |
+ break; | |
} | |
- | |
-// if (numblock!=9) | |
-// error("Not enough blocks read from directory"); | |
- | |
closeRoom(); | |
} | |
diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp | |
index 6215e86..d12fd4d 100644 | |
--- a/engines/scumm/resource_v4.cpp | |
+++ b/engines/scumm/resource_v4.cpp | |
@@ -53,12 +53,26 @@ void ScummEngine_v4::readIndexFile() { | |
uint16 blocktype; | |
uint32 itemsize; | |
int numblock = 0; | |
+ int fileoffset = 0; | |
+ int maxblocks = 0; | |
debug(9, "readIndexFile()"); | |
closeRoom(); | |
openRoom(0); | |
+ if (_game.features & GF_STEAM) { | |
+ if (_game.id == GID_INDY3) { | |
+ fileoffset=0x027908; | |
+ maxblocks = 5; | |
+ } | |
+ if (_game.id == GID_LOOM) { | |
+ fileoffset=0x02db70; | |
+ maxblocks = 6; | |
+ } | |
+ _fileHandle->seek(fileoffset, SEEK_SET); | |
+ } | |
+ | |
while (true) { | |
// Figure out the sizes of various resources | |
itemsize = _fileHandle->readUint32LE(); | |
@@ -89,25 +103,27 @@ void ScummEngine_v4::readIndexFile() { | |
if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns) | |
itemsize += 32; | |
break; | |
+ default: | |
+ error("Bad ID %c%c found in directory (blocknr %d)", blocktype & 0xFF, blocktype >> 8,numblock); | |
} | |
_fileHandle->seek(itemsize - 8, SEEK_CUR); | |
+ numblock++; | |
+ if (maxblocks && numblock == maxblocks) | |
+ break; | |
} | |
- _fileHandle->seek(0, SEEK_SET); | |
- | |
+ _fileHandle->seek(fileoffset, SEEK_SET); | |
readMAXS(0); | |
allocateArrays(); | |
+ numblock=0; | |
while (true) { | |
itemsize = _fileHandle->readUint32LE(); | |
+ blocktype = _fileHandle->readUint16LE(); | |
if (_fileHandle->eos() || _fileHandle->err()) | |
break; | |
- blocktype = _fileHandle->readUint16LE(); | |
- | |
- numblock++; | |
- | |
switch (blocktype) { | |
case 0x4E52: // 'NR' | |
@@ -143,8 +159,12 @@ void ScummEngine_v4::readIndexFile() { | |
break; | |
default: | |
- error("Bad ID %c%c found in directory", blocktype & 0xFF, blocktype >> 8); | |
+ error("Bad ID %c%c found in directory (blocknr %d)", blocktype & 0xFF, blocktype >> 8,numblock); | |
} | |
+ | |
+ numblock++; | |
+ if (maxblocks && numblock == maxblocks) | |
+ break; | |
} | |
closeRoom(); | |
} | |
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h | |
index d4eefe8..d317350 100644 | |
--- a/engines/scumm/scumm-md5.h | |
+++ b/engines/scumm/scumm-md5.h | |
@@ -17,6 +17,7 @@ static const MD5Table md5table[] = { | |
{ "008e76ec3ae58d0add637ea7aa299a2c", "freddi3", "", "", -1, Common::FR_FRA, Common::kPlatformMacintosh }, | |
{ "02cae0e7ff8504f73618391873d5781a", "freddi3", "HE 98.5", "", -1, Common::DE_DEU, Common::kPlatformWindows }, | |
{ "0305e850382b812fec6e5998ef88a966", "pajama", "", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown }, | |
+ { "0354ee0d14cde1264ec762261c04c14a", "loom", "Steam", "Steam", 8307, Common::EN_ANY, Common::kPlatformPC }, | |
{ "035deab53b47bc43abc763560d0f8d4b", "atlantis", "Floppy", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, | |
{ "037385a953789190298494d92b89b3d0", "catalog", "HE 72", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, | |
{ "03d3b18ee3fd68114e2a687c871e38d5", "freddi4", "HE 99", "Mini Game", -1, Common::EN_USA, Common::kPlatformWindows }, | |
@@ -351,6 +352,7 @@ static const MD5Table md5table[] = { | |
{ "7edd665bbede7ea8b7233f8e650be6f8", "samnmax", "", "CD", -1, Common::FR_FRA, Common::kPlatformUnknown }, | |
{ "7f45ddd6dbfbf8f80c0c0efea4c295bc", "maniac", "V1", "V1", 1972, Common::EN_ANY, Common::kPlatformPC }, | |
{ "7f945525abcd48015adf1632637a44a1", "pajama", "", "Demo", -1, Common::FR_FRA, Common::kPlatformUnknown }, | |
+ { "7fbcff27c323499beaedd605e1ebd47d", "indy3", "Steam", "Steam", 561152, Common::EN_ANY, Common::kPlatformPC }, | |
{ "7fc6cdb46b4c9d384c52327f4bca6416", "football", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, | |
{ "810a9da887aefa597b0cf3c77d262897", "BluesABCTime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, | |
{ "822807c3cd3b43a925cab2767ca6b453", "BluesTreasureHunt", "", "Disc 1", -1, Common::EN_ANY, Common::kPlatformUnknown }, | |
@@ -519,6 +521,7 @@ static const MD5Table md5table[] = { | |
{ "c8aac5e3e701874e2fa4117896f9e1b1", "freddi", "HE 73", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, | |
{ "c8c5baadcbfc8d0372ed4335abace8a7", "pajama3", "", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows }, | |
{ "c9717ee6059f1e43b768b464493d2fba", "fbpack", "", "", -1, Common::JA_JPN, Common::kPlatform3DO }, | |
+ { "ca6500edd900e51c69ef3f0a54d675db", "dig", "Steam", "Steam", 847872, Common::UNK_LANG, Common::kPlatformUnknown }, | |
{ "cb1559e8405d17a5a278a6b5ad9338d1", "freddi3", "", "Demo", 22718, Common::EN_ANY, Common::kPlatformUnknown }, | |
{ "cc04a076779379524ed4d9c5ee3c6fb1", "tentacle", "", "CD", 282467632, Common::EN_ANY, Common::kPlatformMacintosh }, | |
{ "cc0c4111449054f1692bb3c0c5e04629", "BluesBirthday", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, | |
@@ -620,6 +623,7 @@ static const MD5Table md5table[] = { | |
{ "f237bf8a5ef9af78b2a6a4f3901da341", "pajama", "", "Demo", 18354, Common::EN_ANY, Common::kPlatformUnknown }, | |
{ "f27b1ba0eadaf2a6617b2b58192d1dbf", "samnmax", "Floppy", "Floppy", -1, Common::DE_DEU, Common::kPlatformPC }, | |
{ "f2ec78e50bdc63b70044e9758be10914", "spyfox", "HE 98.5", "Demo", -1, Common::NL_NLD, Common::kPlatformMacintosh }, | |
+ { "f3c5d9bf3f091bd1f18dc1013fba5396", "atlantis", "Steam", "Steam", 12035, Common::EN_ANY, Common::kPlatformPC }, | |
{ "f3d55aea441e260e9e9c7d2a187097e0", "puttzoo", "", "Demo", 14337, Common::EN_ANY, Common::kPlatformWindows }, | |
{ "f40a7f495f59188ca57a9d1d50301bb6", "puttputt", "HE 60", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, | |
{ "f5228b0cc1c19e6ea8268ba2eeb61f60", "freddi", "HE 73", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows }, | |
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp | |
index d0f46f3..c775620 100644 | |
--- a/engines/scumm/scumm.cpp | |
+++ b/engines/scumm/scumm.cpp | |
@@ -1021,6 +1021,23 @@ Common::Error ScummEngine::init() { | |
SearchMan.addSubDirectoryMatching(gameDataDir, "data"); | |
} | |
#endif | |
+ if (_game.features & GF_STEAM) { | |
+ switch (_game.id) { | |
+ case GID_INDY3 : | |
+ SearchMan.addSubDirectoryMatching(gameDataDir, "indy3"); | |
+ break; | |
+ case GID_INDY4 : | |
+ SearchMan.addSubDirectoryMatching(gameDataDir, "atlantis"); | |
+ break; | |
+ case GID_LOOM : | |
+ SearchMan.addSubDirectoryMatching(gameDataDir, "loom"); | |
+ break; | |
+ case GID_DIG : | |
+ SearchMan.addSubDirectoryMatching(gameDataDir, "DIG"); | |
+ SearchMan.addSubDirectoryMatching(gameDataDir, "DIG/VIDEO"); | |
+ break; | |
+ } | |
+ } | |
// The kGenUnchanged method is only used for 'container files', i.e. files | |
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h | |
index c8cf096..5dbd874 100644 | |
--- a/engines/scumm/scumm.h | |
+++ b/engines/scumm/scumm.h | |
@@ -134,6 +134,9 @@ enum GameFeatures { | |
/** Games which have Audio CD tracks. */ | |
GF_AUDIOTRACKS = 1 << 9, | |
+ /** Games of which room/disk 0 is included in the testapp.exe. */ | |
+ GF_STEAM = 1 << 10, | |
+ | |
/** | |
* Games using only very few local variables in scripts. | |
* Apparently that is only the case for 256 color version of Indy3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment