diff options
author | Filippos Karapetis | 2009-05-15 09:04:21 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-05-15 09:04:21 +0000 |
commit | 565cfa074d25fbfc2458a65fe8fc300d78a2afa8 (patch) | |
tree | aba4ba158ef3bd890652710a9d238e95d0915e7e /engines/sci/sci.cpp | |
parent | adaa0472c5e64d0ff6cae12368ffdfa61b24d2f7 (diff) | |
download | scummvm-rg350-565cfa074d25fbfc2458a65fe8fc300d78a2afa8.tar.gz scummvm-rg350-565cfa074d25fbfc2458a65fe8fc300d78a2afa8.tar.bz2 scummvm-rg350-565cfa074d25fbfc2458a65fe8fc300d78a2afa8.zip |
Simplified SCI versions to be SCI version generations, and fixed some game entries in the process. Also, added a sanity check for invalid game entries
svn-id: r40596
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r-- | engines/sci/sci.cpp | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 457ee738e7..48b8ea7beb 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -181,6 +181,42 @@ Common::Error SciEngine::run() { gamestate->gfx_state = NULL; gamestate->flags = getFlags(); + // Verify that we haven't got an invalid game detection entry + if (version < SCI_VERSION_1_EARLY) { + // SCI0/SCI01 + if (gamestate->flags & GF_SCI1_EGA || + gamestate->flags & GF_SCI1_LOFSABSOLUTE || + gamestate->flags & GF_SCI1_NEWDOSOUND || + gamestate->flags & GF_SCI1_NEWSETCURSOR) { + error("This game entry is erroneous. It's marked as SCI0/SCI01, but it has SCI1 flags set"); + } + } else if (version >= SCI_VERSION_1_EARLY && version <= SCI_VERSION_1_LATE) { + // SCI1 + + if (gamestate->flags & GF_SCI0_OLD || + gamestate->flags & GF_SCI0_OLDGFXFUNCS || + gamestate->flags & GF_SCI0_OLDGETTIME) { + error("This game entry is erroneous. It's marked as SCI1, but it has SCI0 flags set"); + } + } else if (version == SCI_VERSION_1_1 || version == SCI_VERSION_32) { + if (gamestate->flags & GF_SCI1_EGA || + gamestate->flags & GF_SCI1_LOFSABSOLUTE || + gamestate->flags & GF_SCI1_NEWDOSOUND || + gamestate->flags & GF_SCI1_NEWSETCURSOR) { + error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI1 flags set"); + } + + if (gamestate->flags & GF_SCI0_OLD || + gamestate->flags & GF_SCI0_OLDGFXFUNCS || + gamestate->flags & GF_SCI0_OLDGETTIME) { + error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI0 flags set"); + } + + // SCI1.1 / SCI32 + } else { + error ("Unknown SCI version in game entry"); + } + if (init_gamestate(gamestate, version)) return Common::kUnknownError; @@ -243,10 +279,7 @@ Common::Error SciEngine::run() { return Common::kUnknownError; } - printf("Emulating SCI version %d.%03d.%03d\n", - SCI_VERSION_MAJOR(version), - SCI_VERSION_MINOR(version), - SCI_VERSION_PATCHLEVEL(version)); + printf("Emulating SCI version %s\n", versionNames[version]); game_run(&gamestate); // Run the game |