aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/detection.cpp10
-rw-r--r--engines/sci/exereader.cpp20
-rw-r--r--engines/sci/exereader.h4
3 files changed, 22 insertions, 12 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 8fe4fe1654..02f08f8315 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -556,7 +556,6 @@ static const struct SciGameDescription SciGameDescriptions[] = {
SCI_VERSION(0, 000, 274)
},
-#if 0
// King's Quest 5 - English Amiga (from www.back2roots.org)
{{"kq5", "", {
{"resource.map", 0, "fcbcca058e1157221ffc27251cd59bc3", 8040},
@@ -570,9 +569,8 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.007", 0, "b914b5901e786327213e779725d30dd1", 778772},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0},
{},
- SCI_VERSION(1, 000, 60)
+ SCI_VERSION(1, 000, 784)
},
-#endif
// King's Quest 5 - English DOS
{{"kq5", "", {
@@ -1818,7 +1816,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
filename.contains("prog")) {
// We already found a valid exe, no need to check this one.
- if (exeVersionString.size())
+ if (!exeVersionString.empty())
continue;
// Is it really an executable file?
@@ -1827,7 +1825,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
// It's a valid exe, read the interpreter version string
if (exePlatform != Common::kPlatformUnknown)
- exeVersionString = readSciVersionFromExe(fileStream);
+ exeVersionString = readSciVersionFromExe(fileStream, exePlatform);
delete fileStream;
}
@@ -1853,7 +1851,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
printf("version number, from the game's executable:\n");
// Try to parse the executable version
- if (getSciVersionFromString(exeVersionString, &g_fallbackDesc.version)) {
+ if (getSciVersionFromString(exeVersionString, &g_fallbackDesc.version, g_fallbackDesc.desc.platform)) {
printf("Interpreter version: %d.%03d.%03d (got %s by executable scan)\n",
SCI_VERSION_MAJOR(g_fallbackDesc.version),
SCI_VERSION_MINOR(g_fallbackDesc.version),
diff --git a/engines/sci/exereader.cpp b/engines/sci/exereader.cpp
index 260d5704b1..61f0e556dc 100644
--- a/engines/sci/exereader.cpp
+++ b/engines/sci/exereader.cpp
@@ -172,7 +172,7 @@ uint getBit(Common::SeekableReadStream *input) {
return bit;
}
-Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream) {
+Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream, Common::Platform platform) {
int len = exeStream->size();
unsigned char *buffer = NULL;
@@ -277,7 +277,7 @@ Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream) {
// Return the current string if it's parseable
int version;
- if (getSciVersionFromString(currentString, &version)) {
+ if (getSciVersionFromString(currentString, &version, platform)) {
delete[] buffer;
return currentString;
}
@@ -296,10 +296,22 @@ Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream) {
return resultString;
}
-bool getSciVersionFromString(Common::String versionString, int *version) {
+bool getSciVersionFromString(Common::String versionString, int *version, Common::Platform platform) {
// Map non-numeric versions to their numeric counterparts
Common::String mappedVersion = versionString;
- if (versionString.hasPrefix("S.old.")) {
+ if (platform == Common::kPlatformAmiga) {
+ if (versionString.hasPrefix("1.002.")) {
+ mappedVersion = "0.000.685";
+ } else if (versionString.hasPrefix("1.003.")) {
+ mappedVersion = "0.001.010";
+ } else if (versionString.hasPrefix("1.004.")) {
+ mappedVersion = "1.000.784";
+ } else if (versionString.hasPrefix("1.005.")) {
+ mappedVersion = "1.000.510";
+ } else if (versionString == "x.yyy.zzz") {
+ // How to map it?
+ }
+ } else if (versionString.hasPrefix("S.old.")) {
// SCI 01
mappedVersion = "0.001.";
mappedVersion += versionString.c_str() + 6;
diff --git a/engines/sci/exereader.h b/engines/sci/exereader.h
index 1100dc7244..4b724ba057 100644
--- a/engines/sci/exereader.h
+++ b/engines/sci/exereader.h
@@ -32,8 +32,8 @@
namespace Sci {
Common::Platform getGameExePlatform(Common::SeekableReadStream *exeStream);
-Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream);
-bool getSciVersionFromString(Common::String versionString, int *version);
+Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream, Common::Platform platform);
+bool getSciVersionFromString(Common::String versionString, int *version, Common::Platform platform);
} // End of namespace Sci