diff options
author | Filippos Karapetis | 2009-05-14 17:50:09 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-05-14 17:50:09 +0000 |
commit | d5e1ca4630d0f8694f059a06ab06155108a7e435 (patch) | |
tree | f0c6f7afddce73747fa50a9791afb3d0a16b09dc | |
parent | 3ab81fa502408d453ce3788f163c0553316583e1 (diff) | |
download | scummvm-rg350-d5e1ca4630d0f8694f059a06ab06155108a7e435.tar.gz scummvm-rg350-d5e1ca4630d0f8694f059a06ab06155108a7e435.tar.bz2 scummvm-rg350-d5e1ca4630d0f8694f059a06ab06155108a7e435.zip |
- Added a new game flag to distinguish SCI1 EGA versions
- Fixed the wrong detected versions of Laura Bow 2
- Changed some code regarding the resource loader of Jones in the Fast Lane (which is still non-functional)
svn-id: r40564
-rw-r--r-- | engines/sci/detection.cpp | 9 | ||||
-rw-r--r-- | engines/sci/engine/game.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 14 | ||||
-rw-r--r-- | engines/sci/sci.h | 11 | ||||
-rw-r--r-- | engines/sci/scicore/resource.cpp | 4 |
5 files changed, 24 insertions, 16 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 59d57b4d8b..342a50f14f 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -812,7 +812,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { {"resource.002", 0, "b86daa3ba2784d1502da881eedb80d9b", 719747}, {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0}, 0, - SCI_VERSION_AUTODETECT, + SCI_VERSION_01_VGA_ODD, SCI_VERSION(1, 000, 172) }, #endif @@ -1239,13 +1239,14 @@ static const struct SciGameDescription SciGameDescriptions[] = { }, // Laura Bow 2 - English DOS Floppy + // Executable scanning reports "2.000.274" {{"laurabow2", "", { {"resource.map", 0, "610bfd9a852004222f0faaf5fc9e630a", 6489}, {"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5035964}, {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0}, 0, SCI_VERSION_AUTODETECT, - SCI_VERSION(2, 000, 274) + SCI_VERSION(1, 001, 69) // this is just a guess }, // Laura Bow 2 - English DOS CD (from "The Roberta Williams Antology"/1996) @@ -1268,7 +1269,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { {NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0}, 0, SCI_VERSION_AUTODETECT, - SCI_VERSION(2, 000, 274) + SCI_VERSION(1, 001, 69) // this is just a guess }, #endif @@ -1293,7 +1294,7 @@ static const struct SciGameDescription SciGameDescriptions[] = { {"resource.002", 0, "24c958bc922b07f91e25e8c93aa01fcf", 491230}, {"resource.003", 0, "685cd6c1e05a695ab1e0db826337ee2a", 553279}, {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0}, - GF_FOR_SCI0_BEFORE_629, + GF_FOR_SCI0_BEFORE_629 | GF_SCI1_EGA, SCI_VERSION_AUTODETECT, SCI_VERSION(0, 000, 510) // FIXME: some versions are v. 0.000.577 }, diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 985f9745c7..cb70395ac7 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -43,7 +43,7 @@ static int _init_vocabulary(EngineState *s) { // initialize vocabulary and relat sciprintf("Initializing vocabulary\n"); - if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA) && vocab_get_words(s->resmgr, s->_parserWords)) { + if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) && vocab_get_words(s->resmgr, s->_parserWords)) { vocab_get_suffixes(s->resmgr, s->_parserSuffixes); if (vocab_get_branches(s->resmgr, s->_parserBranches)) // Now build a GNF grammar out of this diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index e6ec13b0e2..1da0c48f7f 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -261,7 +261,7 @@ void graph_restore_box(EngineState *s, reg_t handle) { } PaletteEntry get_pic_color(EngineState *s, int color) { - if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA) + if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) return s->ega_colors[color].visual; if (color == -1 || color == 255) // -1 occurs in Eco Quest 1. Not sure if this is the best approach, but it seems to work @@ -278,7 +278,7 @@ PaletteEntry get_pic_color(EngineState *s, int color) { static gfx_color_t graph_map_color(EngineState *s, int color, int priority, int control) { gfx_color_t retval; - if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA) { + if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) { retval = s->ega_colors[(color >=0 && color < 16)? color : 0]; gfxop_set_color(s->gfx_state, &retval, (color < 0) ? -1 : retval.visual.r, retval.visual.g, retval.visual.b, (color == -1) ? 255 : 0, priority, control); @@ -482,7 +482,7 @@ reg_t kGraph(EngineState *s, int funct_nr, int argc, reg_t *argv) { case K_GRAPH_GET_COLORS_NR: - return make_reg(0, (s->resmgr->_sciVersion < SCI_VERSION_01_VGA) ? 0x10 : 0x100); + return make_reg(0, (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) ? 0x10 : 0x100); break; case K_GRAPH_DRAW_LINE: { @@ -2484,7 +2484,7 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { bgcolor.mask = 0; if (SKPV_OR_ALT(8 + argextra, 255) >= 0) { - if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA) + if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) bgcolor.visual = get_pic_color(s, SKPV_OR_ALT(8 + argextra, 15)); else bgcolor.visual = get_pic_color(s, SKPV_OR_ALT(8 + argextra, 255)); @@ -2509,7 +2509,7 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) { black.alpha = 0; black.control = -1; black.priority = -1; - lWhite.visual = get_pic_color(s, s->resmgr->_sciVersion < SCI_VERSION_01_VGA ? 15 : 255); + lWhite.visual = get_pic_color(s, (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) ? 15 : 255); lWhite.mask = GFX_MASK_VISUAL; lWhite.alpha = 0; lWhite.priority = -1; @@ -3178,7 +3178,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { temp = KP_SINT(argv[argpt++]); SCIkdebug(SCIkGRAPHICS, "Display: set_color(%d)\n", temp); - if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA) && temp >= 0 && temp <= 15) + if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) && temp >= 0 && temp <= 15) color0 = (s->ega_colors[temp]); else if ((s->resmgr->_sciVersion >= SCI_VERSION_01_VGA) && temp >= 0 && temp < 256) { @@ -3195,7 +3195,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { temp = KP_SINT(argv[argpt++]); SCIkdebug(SCIkGRAPHICS, "Display: set_bg_color(%d)\n", temp); - if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA) && temp >= 0 && temp <= 15) + if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) && temp >= 0 && temp <= 15) bg_color = s->ega_colors[temp]; else if ((s->resmgr->_sciVersion >= SCI_VERSION_01_VGA) && temp >= 0 && temp <= 256) { diff --git a/engines/sci/sci.h b/engines/sci/sci.h index a70ab8a8e3..5c6366bfac 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -118,22 +118,27 @@ enum SciGameFlags { ** SCI1 flags */ + /* + ** Used to distinguish SCI1 EGA games + */ + GF_SCI1_EGA = (1 << 3), + /* Applies to all SCI1 versions after 1.000.200 ** In late SCI1 versions, the argument of lofs[as] instructions ** is absolute rather than relative. */ - GF_SCI1_LOFSABSOLUTE = (1 << 3), + GF_SCI1_LOFSABSOLUTE = (1 << 4), /* Applies to all versions from 1.000.510 onwards ** kDoSound() is different than in earlier SCI1 versions. */ - GF_SCI1_NEWDOSOUND = (1 << 4), + GF_SCI1_NEWDOSOUND = (1 << 5), /* ** Newer SCI1 games (like KQ5 CD and EcoQuest 1) use ** different semantics in kSetCursor(), like SCI1.1 games */ - GF_SCI1_NEWSETCURSOR = (1 << 5) + GF_SCI1_NEWSETCURSOR = (1 << 6) }; class SciEngine : public Engine { diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp index 0610316b32..c946463057 100644 --- a/engines/sci/scicore/resource.cpp +++ b/engines/sci/scicore/resource.cpp @@ -936,7 +936,9 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) { file.seek(0, SEEK_SET); - byte bMask = _mapVersion == SCI_VERSION_01_VGA_ODD ? 0xF0 : 0xFC; + byte bMask = 0xFC; + // FIXME: The code above seems to give correct results for Jones + //byte bMask = _mapVersion == SCI_VERSION_01_VGA_ODD ? 0xF0 : 0xFC; byte bShift = _mapVersion == SCI_VERSION_01_VGA_ODD ? 28 : 26; do { |