[Scummvm-git-logs] scummvm master -> 3cdf843d6c20acf64297b8ebf07be1f54ef55a4e
phcoder
noreply at scummvm.org
Wed May 10 11:20:31 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
577a3ca3a8 SKY: Show only available language in language selection
3cdf843d6c SKY: Add detection for Russian version
Commit: 577a3ca3a886c03a5b14ea76e709f5ef160890a6
https://github.com/scummvm/scummvm/commit/577a3ca3a886c03a5b14ea76e709f5ef160890a6
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-05-10T13:20:27+02:00
Commit Message:
SKY: Show only available language in language selection
Changed paths:
engines/sky/detection.cpp
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index fa161d24fd0..55ed7bbcd9f 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -98,6 +98,20 @@ DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist,
bool hasSkyDnr = false;
int dinnerTableEntries = -1;
int dataDiskSize = -1;
+ int exeSize = -1;
+ const Common::Language langs[] = {
+ Common::EN_GRB,
+ Common::DE_DEU,
+ Common::FR_FRA,
+ Common::EN_USA,
+ Common::SE_SWE,
+ Common::IT_ITA,
+ Common::PT_BRA,
+ Common::ES_ESP,
+ };
+ bool langTable[ARRAYSIZE(langs)];
+
+ memset(langTable, 0, sizeof(langTable));
// Iterate over all files in the given directory
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
@@ -115,6 +129,19 @@ DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist,
if (dinner.open(*file)) {
hasSkyDnr = true;
dinnerTableEntries = dinner.readUint32LE();
+ for (int i = 0; i < dinnerTableEntries; i++) {
+ uint16 entry = dinner.readUint16LE();
+ dinner.readUint16LE();
+ if (entry >= 60600 && entry < 60600 + 8 * ARRAYSIZE(langs) && (entry % 8) == 0)
+ langTable[(entry - 60600) / 8] = true;
+ }
+ }
+ }
+
+ if (0 == scumm_stricmp("sky.exe", file->getName().c_str())) {
+ Common::File skyExe;
+ if (skyExe.open(*file)) {
+ exeSize = skyExe.size();
}
}
}
@@ -133,16 +160,26 @@ DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist,
++sv;
}
+ DetectedGame game;
+
if (sv->dinnerTableEntries) {
Common::String extra = Common::String::format("v0.0%d %s", sv->version, sv->extraDesc);
- DetectedGame game = DetectedGame(getName(), skySetting.gameId, skySetting.description, Common::UNK_LANG, Common::kPlatformDOS, extra);
+ game = DetectedGame(getName(), skySetting.gameId, skySetting.description, Common::UNK_LANG, Common::kPlatformDOS, extra);
game.setGUIOptions(sv->guioptions);
-
- detectedGames.push_back(game);
} else {
- detectedGames.push_back(DetectedGame(getName(), skySetting.gameId, skySetting.description));
+ game = DetectedGame(getName(), skySetting.gameId, skySetting.description);
}
+
+ for (uint i = 0; i < ARRAYSIZE(langs); i++) {
+ if (langTable[i])
+ game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(langs[i]));
+ }
+
+ if (exeSize == 575538)
+ game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::ZH_TWN));
+
+ detectedGames.push_back(game);
}
return detectedGames;
Commit: 3cdf843d6c20acf64297b8ebf07be1f54ef55a4e
https://github.com/scummvm/scummvm/commit/3cdf843d6c20acf64297b8ebf07be1f54ef55a4e
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-05-10T13:20:27+02:00
Commit Message:
SKY: Add detection for Russian version
Changed paths:
engines/sky/detection.cpp
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index 55ed7bbcd9f..09a5a67d088 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -22,6 +22,7 @@
#include "base/plugins.h"
#include "common/config-manager.h"
+#include "common/md5.h"
#include "engines/advancedDetector.h"
#include "engines/metaengine.h"
#include "common/system.h"
@@ -51,6 +52,7 @@ static const SkyVersion skyVersions[] = {
{ 1711, 26623798, "CD Demo", 365, GUIO0() },
{ 5099, 72429382, "CD", 368, GUIO0() },
{ 5097, 72395713, "CD", 372, GUIO0() },
+ { 5097, 73123264, "CD", 372, GUIO0() },
{ 0, 0, 0, 0, 0 }
};
@@ -98,6 +100,7 @@ DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist,
bool hasSkyDnr = false;
int dinnerTableEntries = -1;
int dataDiskSize = -1;
+ Common::String dataDiskHeadMD5 = "";
int exeSize = -1;
const Common::Language langs[] = {
Common::EN_GRB,
@@ -121,6 +124,8 @@ DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist,
if (dataDisk.open(*file)) {
hasSkyDsk = true;
dataDiskSize = dataDisk.size();
+ if (dataDiskSize == 73123264)
+ dataDiskHeadMD5 = Common::computeStreamMD5AsString(dataDisk, 5000);
}
}
@@ -161,23 +166,29 @@ DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist,
}
DetectedGame game;
+ Common::Language lang = Common::Language::UNK_LANG;
+ if (dataDiskSize == 73123264 && dataDiskHeadMD5 == "886d6faecd97488be09b73f4f87b92d9")
+ lang = Common::Language::RU_RUS;
if (sv->dinnerTableEntries) {
Common::String extra = Common::String::format("v0.0%d %s", sv->version, sv->extraDesc);
- game = DetectedGame(getName(), skySetting.gameId, skySetting.description, Common::UNK_LANG, Common::kPlatformDOS, extra);
+ game = DetectedGame(getName(), skySetting.gameId, skySetting.description, lang, Common::kPlatformDOS, extra);
game.setGUIOptions(sv->guioptions);
} else {
game = DetectedGame(getName(), skySetting.gameId, skySetting.description);
}
- for (uint i = 0; i < ARRAYSIZE(langs); i++) {
- if (langTable[i])
- game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(langs[i]));
- }
+ if (lang == Common::Language::UNK_LANG) {
+ for (uint i = 0; i < ARRAYSIZE(langs); i++) {
+ if (langTable[i])
+ game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(langs[i]));
+ }
- if (exeSize == 575538)
- game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::ZH_TWN));
+ if (exeSize == 575538)
+ game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::ZH_TWN));
+ } else
+ game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(lang));
detectedGames.push_back(game);
}
More information about the Scummvm-git-logs
mailing list