aboutsummaryrefslogtreecommitdiff
path: root/scumm/scumm.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2005-05-19 22:14:49 +0000
committerEugene Sandulenko2005-05-19 22:14:49 +0000
commitd5f4a56e1132739297f95e75a98bad6ae9f3ae6d (patch)
tree984e70d6f1c86017a55e1e35aff3d27e044b8521 /scumm/scumm.cpp
parent81453854ee693aa31bbbd733043c114653265feb (diff)
downloadscummvm-rg350-d5f4a56e1132739297f95e75a98bad6ae9f3ae6d.tar.gz
scummvm-rg350-d5f4a56e1132739297f95e75a98bad6ae9f3ae6d.tar.bz2
scummvm-rg350-d5f4a56e1132739297f95e75a98bad6ae9f3ae6d.zip
Improve MM NES & C64 games autodetection.
Fixes bug #1190565 "MM NES: autodetect not working" svn-id: r18186
Diffstat (limited to 'scumm/scumm.cpp')
-rw-r--r--scumm/scumm.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 65aaeeacb1..db653b4c32 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -2564,12 +2564,13 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
const char *name = file->displayName().c_str();
if (0 == scumm_stricmp(detectName, name)) {
+ byte buf[6];
+
if (g->version <= 4) {
// We take a look at the file now, to narrow
// down the list of possible candidates a bit further.
// E.g. it's trivial to distinguish V1 from V3 games.
File tmp;
- byte buf[6];
if (!tmp.open(file->path().c_str()))
break;
tmp.read(buf, 6);
@@ -2675,6 +2676,23 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
_numScripts 199
_numSounds 199
*/
+ } else if (buf[0] == 0xa0 && buf[1] == 0x07 && buf[2] == 0xa5 &&
+ buf[3] == 0xbc) {
+ // MM NES .prg
+ if (g->id != GID_MANIAC)
+ break;
+ } else if (buf[0] == 0xbc && buf[1] == 0xb9) {
+ // MM NES 00.LFL
+ if (g->id != GID_MANIAC)
+ break;
+ } else if (buf[0] == 0x31 && buf[1] == 0x0a) {
+ // C64 MM & Zak disk1
+ if (g->version != 2)
+ break;
+ } else if (buf[0] == 0xcd && buf[1] == 0xfe) {
+ // C64 MM & Zak 00.LFL
+ if (g->version != 2)
+ break;
} else {
// This is not a V1-V4 game
break;
@@ -2689,6 +2707,17 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
Common::UNK_LANG,
Common::kPlatformMacintosh));
fileSet[file->path()] = true;
+ } else if (substLastIndex == 0 && g->id == GID_MANIAC &&
+ (buf[0] == 0xbc || buf[0] == 0xa0)) {
+ detectedGames.push_back(DetectedGame(g->toGameSettings(),
+ Common::UNK_LANG,
+ Common::kPlatformNES));
+ } else if ((g->id == GID_MANIAC || g->id == GID_ZAK) &&
+ ((buf[0] == 0x31 && buf[1] == 0x0a) ||
+ (buf[0] == 0xcd && buf[1] == 0xfe))) {
+ detectedGames.push_back(DetectedGame(g->toGameSettings(),
+ Common::UNK_LANG,
+ Common::kPlatformC64));
} else {
detectedGames.push_back(g->toGameSettings());
fileSet[file->path()] = false;