[Scummvm-git-logs] scummvm master -> 17f0acacb9fed4fec875c73c4a6edce19e39c7ba
elasota
noreply at scummvm.org
Mon Aug 1 22:55:45 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
17f0acacb9 MTROPOLIS: Update detection+boot to handle data-fork-only copy of Mac Obsidian
Commit: 17f0acacb9fed4fec875c73c4a6edce19e39c7ba
https://github.com/scummvm/scummvm/commit/17f0acacb9fed4fec875c73c4a6edce19e39c7ba
Author: elasota (ejlasota at gmail.com)
Date: 2022-08-01T18:55:04-04:00
Commit Message:
MTROPOLIS: Update detection+boot to handle data-fork-only copy of Mac Obsidian
Changed paths:
engines/mtropolis/boot.cpp
engines/mtropolis/detection.h
engines/mtropolis/detection_tables.h
diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index 93854b70a27..19b838ae0f7 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -40,17 +40,6 @@ namespace MTropolis {
namespace Boot {
-enum FileCategory {
- kFileCategoryPlayer,
- kFileCategoryExtension,
- kFileCategoryProjectAdditionalSegment,
- kFileCategoryProjectMainSegment,
-
- kFileCategorySpecial,
-
- kFileCategoryUnknown,
-};
-
struct FileIdentification {
union Tag {
uint32 value;
@@ -60,7 +49,7 @@ struct FileIdentification {
FileIdentification();
Common::String fileName;
- FileCategory category;
+ MTropolisFileType category;
Tag macType;
Tag macCreator;
@@ -68,7 +57,7 @@ struct FileIdentification {
Common::SharedPtr<Common::SeekableReadStream> stream;
};
-FileIdentification::FileIdentification() : category(kFileCategoryUnknown) {
+FileIdentification::FileIdentification() : category(MTFT_AUTO) {
macType.value = 0;
macCreator.value = 0;
}
@@ -211,7 +200,7 @@ void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::Sha
ident.macCreator.value = request.creator;
ident.macType.value = request.type;
ident.resMan = resMan;
- ident.category = kFileCategoryUnknown;
+ ident.category = MTFT_AUTO;
files.push_back(ident);
}
@@ -224,7 +213,7 @@ void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::Sha
ident.fileName = "Obsidian Data 1";
ident.macCreator.value = MKTAG('M', 'f', 'P', 'l');
ident.macType.value = MKTAG('M', 'F', 'm', 'm');
- ident.category = kFileCategoryUnknown;
+ ident.category = MTFT_AUTO;
ident.stream = startupStream;
files.push_back(ident);
}
@@ -235,7 +224,7 @@ void ObsidianGameDataHandler::categorizeSpecialFiles(Common::Array<FileIdentific
// Flag RSGKit as Special so it doesn't get fed to the cursor loader
for (FileIdentification &file : files) {
if (file.fileName == "Obsidian Installer" || file.fileName == "RSGKit.rPP" || file.fileName == "RSGKit.r95")
- file.category = kFileCategorySpecial;
+ file.category = MTFT_SPECIAL;
}
}
@@ -566,8 +555,10 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
Boot::FileIdentification ident;
ident.fileName = fileName;
- ident.category = Boot::kFileCategoryUnknown;
- if (!Boot::getMacTypesForFile(fileName, ident.macType.value, ident.macCreator.value))
+ ident.category = static_cast<MTropolisFileType>(fileDesc->fileType);
+ ident.macType.value = 0;
+ ident.macCreator.value = 0;
+ if (ident.category == MTFT_AUTO && !Boot::getMacTypesForFile(fileName, ident.macType.value, ident.macCreator.value))
error("Couldn't determine Mac file type code for file '%s'", fileName);
macFiles.push_back(ident);
@@ -591,7 +582,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
bool haveAnyMFxm = false;
for (Boot::FileIdentification &macFile : macFiles) {
- if (macFile.category == Boot::kFileCategoryUnknown) {
+ if (macFile.category == MTFT_AUTO) {
switch (macFile.macType.value) {
case MKTAG('M', 'F', 'm', 'm'):
haveAnyMFmm = true;
@@ -617,25 +608,25 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
// Identify unknown files
for (Boot::FileIdentification &macFile : macFiles) {
- if (macFile.category == Boot::kFileCategoryUnknown) {
+ if (macFile.category == MTFT_AUTO) {
switch (macFile.macType.value) {
case MKTAG('M', 'F', 'm', 'm'):
- macFile.category = Boot::kFileCategoryProjectMainSegment;
+ macFile.category = MTFT_MAIN;
break;
case MKTAG('M', 'F', 'm', 'x'):
- macFile.category = isMT2CrossPlatform ? Boot::kFileCategoryProjectMainSegment : Boot::kFileCategoryProjectAdditionalSegment;
+ macFile.category = isMT2CrossPlatform ? MTFT_MAIN : MTFT_ADDITIONAL;
break;
case MKTAG('M', 'F', 'x', 'm'):
case MKTAG('M', 'F', 'x', 'x'):
- macFile.category = Boot::kFileCategoryProjectAdditionalSegment;
+ macFile.category = MTFT_ADDITIONAL;
break;
case MKTAG('A', 'P', 'P', 'L'):
- macFile.category = Boot::kFileCategoryPlayer;
+ macFile.category = MTFT_PLAYER;
break;
case MKTAG('M', 'F', 'c', 'o'):
case MKTAG('M', 'F', 'c', 'r'):
case MKTAG('M', 'F', 'X', 'O'):
- macFile.category = Boot::kFileCategoryExtension;
+ macFile.category = MTFT_EXTENSION;
break;
default:
error("Failed to categorize input file '%s'", macFile.fileName.c_str());
@@ -650,16 +641,16 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
// Bin segments
for (Boot::FileIdentification &macFile : macFiles) {
switch (macFile.category) {
- case Boot::kFileCategoryPlayer:
+ case MTFT_PLAYER:
// Case handled below after cursor loading
break;
- case Boot::kFileCategoryExtension:
+ case MTFT_EXTENSION:
// Case handled below after cursor loading
break;
- case Boot::kFileCategoryProjectMainSegment:
+ case MTFT_MAIN:
mainSegmentFile = &macFile;
break;
- case Boot::kFileCategoryProjectAdditionalSegment: {
+ case MTFT_ADDITIONAL: {
int segmentID = Boot::resolveFileSegmentID(macFile.fileName);
if (segmentID < 2)
error("Unusual segment numbering scheme");
@@ -669,9 +660,9 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
segmentFiles.push_back(nullptr);
segmentFiles[segmentIndex] = &macFile;
} break;
- case Boot::kFileCategorySpecial:
+ case MTFT_SPECIAL:
break;
- case Boot::kFileCategoryUnknown:
+ case MTFT_AUTO:
break;
}
}
@@ -685,12 +676,12 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
Common::SharedPtr<CursorGraphicCollection> cursorGraphics(new CursorGraphicCollection());
for (Boot::FileIdentification &macFile : macFiles) {
- if (macFile.category == Boot::kFileCategoryPlayer)
+ if (macFile.category == MTFT_PLAYER)
Boot::loadCursorsMac(macFile, *cursorGraphics);
}
for (Boot::FileIdentification &macFile : macFiles) {
- if (macFile.category == Boot::kFileCategoryExtension)
+ if (macFile.category == MTFT_EXTENSION)
Boot::loadCursorsMac(macFile, *cursorGraphics);
}
@@ -733,7 +724,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
Boot::FileIdentification ident;
ident.fileName = fileName;
- ident.category = Boot::kFileCategoryUnknown;
+ ident.category = MTFT_AUTO;
ident.macType.value = 0;
ident.macCreator.value = 0;
winFiles.push_back(ident);
@@ -753,17 +744,17 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
// Identify unknown files
for (Boot::FileIdentification &winFile : winFiles) {
- if (winFile.category == Boot::kFileCategoryUnknown) {
+ if (winFile.category == MTFT_AUTO) {
switch (Boot::getWinFileEndingPseudoTag(winFile.fileName)) {
case MKTAG('.', 'm', 'p', 'l'):
- winFile.category = Boot::kFileCategoryProjectMainSegment;
+ winFile.category = MTFT_MAIN;
isWindows = true;
isMT1 = true;
if (isMT2)
error("Unexpected mix of file platforms");
break;
case MKTAG('.', 'm', 'p', 'x'):
- winFile.category = Boot::kFileCategoryProjectAdditionalSegment;
+ winFile.category = MTFT_ADDITIONAL;
isWindows = true;
isMT1 = true;
if (isMT2)
@@ -771,7 +762,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
break;
case MKTAG('.', 'm', 'f', 'w'):
- winFile.category = Boot::kFileCategoryProjectMainSegment;
+ winFile.category = MTFT_MAIN;
if (isMT1 || isCrossPlatform)
error("Unexpected mix of file platforms");
isWindows = true;
@@ -779,7 +770,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
break;
case MKTAG('.', 'm', 'x', 'w'):
- winFile.category = Boot::kFileCategoryProjectAdditionalSegment;
+ winFile.category = MTFT_ADDITIONAL;
if (isMT1 || isCrossPlatform)
error("Unexpected mix of file platforms");
isWindows = true;
@@ -787,7 +778,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
break;
case MKTAG('.', 'm', 'f', 'x'):
- winFile.category = Boot::kFileCategoryProjectMainSegment;
+ winFile.category = MTFT_MAIN;
if (isWindows)
error("Unexpected mix of file platforms");
isCrossPlatform = true;
@@ -795,7 +786,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
break;
case MKTAG('.', 'm', 'x', 'x'):
- winFile.category = Boot::kFileCategoryProjectAdditionalSegment;
+ winFile.category = MTFT_ADDITIONAL;
if (isWindows)
error("Unexpected mix of file platforms");
isCrossPlatform = true;
@@ -805,11 +796,11 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
case MKTAG('.', 'c', '9', '5'):
case MKTAG('.', 'e', '9', '5'):
case MKTAG('.', 'r', '9', '5'):
- winFile.category = Boot::kFileCategoryExtension;
+ winFile.category = MTFT_EXTENSION;
break;
case MKTAG('.', 'e', 'x', 'e'):
- winFile.category = Boot::kFileCategoryPlayer;
+ winFile.category = MTFT_PLAYER;
break;
default:
@@ -825,16 +816,16 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
// Bin segments
for (Boot::FileIdentification &macFile : winFiles) {
switch (macFile.category) {
- case Boot::kFileCategoryPlayer:
+ case MTFT_PLAYER:
// Case handled below after cursor loading
break;
- case Boot::kFileCategoryExtension:
+ case MTFT_EXTENSION:
// Case handled below after cursor loading
break;
- case Boot::kFileCategoryProjectMainSegment:
+ case MTFT_MAIN:
mainSegmentFile = &macFile;
break;
- case Boot::kFileCategoryProjectAdditionalSegment: {
+ case MTFT_ADDITIONAL: {
int segmentID = Boot::resolveFileSegmentID(macFile.fileName);
if (segmentID < 2)
error("Unusual segment numbering scheme");
@@ -844,9 +835,9 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
segmentFiles.push_back(nullptr);
segmentFiles[segmentIndex] = &macFile;
} break;
- case Boot::kFileCategorySpecial:
+ case MTFT_SPECIAL:
break;
- case Boot::kFileCategoryUnknown:
+ case MTFT_AUTO:
break;
}
}
@@ -860,12 +851,12 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
Common::SharedPtr<CursorGraphicCollection> cursorGraphics(new CursorGraphicCollection());
for (Boot::FileIdentification &winFile : winFiles) {
- if (winFile.category == Boot::kFileCategoryPlayer)
+ if (winFile.category == MTFT_PLAYER)
Boot::loadCursorsWin(winFile, *cursorGraphics);
}
for (Boot::FileIdentification &winFile : winFiles) {
- if (winFile.category == Boot::kFileCategoryExtension)
+ if (winFile.category == MTFT_EXTENSION)
Boot::loadCursorsWin(winFile, *cursorGraphics);
}
diff --git a/engines/mtropolis/detection.h b/engines/mtropolis/detection.h
index e72a7072fe0..1488eeadcf9 100644
--- a/engines/mtropolis/detection.h
+++ b/engines/mtropolis/detection.h
@@ -31,6 +31,15 @@ enum MTropolisGameID {
GID_LEARNING_MTROPOLIS = 1,
};
+enum MTropolisFileType {
+ MTFT_AUTO = 0, // Automatic, determine based on extension or file type
+ MTFT_PLAYER = 1, // mTropolis Player program
+ MTFT_EXTENSION = 2, // Extension (only use this if the extension contains cursors, otherwise use MTFT_SPECIAL if it has something else useful, or exclude it if not)
+ MTFT_MAIN = 3, // Main segment
+ MTFT_ADDITIONAL = 4, // Additional segment
+ MTFT_SPECIAL = 5, // Some other kind of file, or something that might be incorrectly detected as a different type of file (e.g. installers)
+};
+
struct MTropolisGameDescription {
ADGameDescription desc;
diff --git a/engines/mtropolis/detection_tables.h b/engines/mtropolis/detection_tables.h
index 4d4dbfab862..c01bfd4062c 100644
--- a/engines/mtropolis/detection_tables.h
+++ b/engines/mtropolis/detection_tables.h
@@ -37,7 +37,7 @@ namespace MTropolis {
static const MTropolisGameDescription gameDescriptions[] = {
- { // Obsidian Macintosh
+ { // Obsidian Macintosh, dumped
{
"obsidian",
"V1.0, 1/13/97, CD",
@@ -59,6 +59,28 @@ static const MTropolisGameDescription gameDescriptions[] = {
0,
0,
},
+ { // Obsidian Macintosh, data forks only
+ {
+ "obsidian",
+ "V1.0, 1/13/97, CD",
+ {
+ { "Obsidian Installer", MTFT_SPECIAL, "c8859ba831a202a112eaffc5aee3ddf5", 9138050 },
+ { "Obsidian Data 2", MTFT_ADDITIONAL, "a07c8ba79b9cb1de5496345dbe168527", 563284971 },
+ { "Obsidian Data 3", MTFT_ADDITIONAL, "7cd809daa365b478ed96acbd6434966b", 617410816 },
+ { "Obsidian Data 4", MTFT_ADDITIONAL, "ee67b2032f27133800f50c8b5cf08129", 599294667 },
+ { "Obsidian Data 5", MTFT_ADDITIONAL, "13a221b93471b7d551316735cec21e7f", 583578222 },
+ { "Obsidian Data 6", MTFT_ADDITIONAL, "5388ee329d1f5621333249f2f09cfb0c", 558312729 },
+ AD_LISTEND
+ },
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_UNSTABLE,
+ GUIO2(GAMEOPTION_WIDESCREEN_MOD, GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS)
+ },
+ GID_OBSIDIAN,
+ 0,
+ 0,
+ },
{ // Obsidian Windows, installed
{
More information about the Scummvm-git-logs
mailing list