[Scummvm-cvs-logs] SF.net SVN: scummvm:[38774] scummvm/trunk/engines/sci
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Sun Feb 22 02:11:07 CET 2009
Revision: 38774
http://scummvm.svn.sourceforge.net/scummvm/?rev=38774&view=rev
Author: mthreepwood
Date: 2009-02-22 01:11:06 +0000 (Sun, 22 Feb 2009)
Log Message:
-----------
Add remapping of Amiga version strings and re-enable detection of kq5 amiga.
Modified Paths:
--------------
scummvm/trunk/engines/sci/detection.cpp
scummvm/trunk/engines/sci/exereader.cpp
scummvm/trunk/engines/sci/exereader.h
Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp 2009-02-22 01:01:40 UTC (rev 38773)
+++ scummvm/trunk/engines/sci/detection.cpp 2009-02-22 01:11:06 UTC (rev 38774)
@@ -556,7 +556,6 @@
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 @@
{"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 @@
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 @@
// 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 @@
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),
Modified: scummvm/trunk/engines/sci/exereader.cpp
===================================================================
--- scummvm/trunk/engines/sci/exereader.cpp 2009-02-22 01:01:40 UTC (rev 38773)
+++ scummvm/trunk/engines/sci/exereader.cpp 2009-02-22 01:11:06 UTC (rev 38774)
@@ -172,7 +172,7 @@
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 @@
// 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 @@
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;
Modified: scummvm/trunk/engines/sci/exereader.h
===================================================================
--- scummvm/trunk/engines/sci/exereader.h 2009-02-22 01:01:40 UTC (rev 38773)
+++ scummvm/trunk/engines/sci/exereader.h 2009-02-22 01:11:06 UTC (rev 38774)
@@ -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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list