aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-07-03 23:37:08 +0000
committerFilippos Karapetis2009-07-03 23:37:08 +0000
commitdf9570cb3265f4d81ac41d66d949355491e2df7e (patch)
tree66e0f740882acc879c7beaecf070a6e8f6673475 /engines/sci
parent9a96b20cd0c30dd8b1788637ae8b8b4bb4e5ca38 (diff)
downloadscummvm-rg350-df9570cb3265f4d81ac41d66d949355491e2df7e.tar.gz
scummvm-rg350-df9570cb3265f4d81ac41d66d949355491e2df7e.tar.bz2
scummvm-rg350-df9570cb3265f4d81ac41d66d949355491e2df7e.zip
SCI0 games using older graphics functions are automatically detected now, from the presence of the "TimesSin" and "SinMult" kernel functions. Removed the GF_SCI0_OLDGFXFUNCS game flag
svn-id: r42081
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/detection.cpp26
-rw-r--r--engines/sci/engine/game.cpp2
-rw-r--r--engines/sci/engine/kernel.cpp4
-rw-r--r--engines/sci/engine/kernel.h9
-rw-r--r--engines/sci/engine/kgraphics.cpp12
-rw-r--r--engines/sci/sci.cpp2
-rw-r--r--engines/sci/sci.h16
7 files changed, 36 insertions, 35 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index b8e8beb647..f04c390944 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -31,9 +31,7 @@
namespace Sci {
-// The 4 SCI0 engine generations (pre-395, pre-502, pre-629 and post-629)
-#define GF_FOR_SCI0_BEFORE_395 (GF_SCI0_OLD | GF_SCI0_OLDGFXFUNCS | GF_SCI0_OLDGETTIME)
-#define GF_FOR_SCI0_BEFORE_502 (GF_SCI0_OLDGFXFUNCS | GF_SCI0_OLDGETTIME)
+#define GF_FOR_SCI0_BEFORE_395 (GF_SCI0_OLD | GF_SCI0_OLDGETTIME)
#define GF_FOR_SCI0_BEFORE_629 GF_SCI0_OLDGETTIME
// SCI1
@@ -134,7 +132,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "f3d1be7752d30ba60614533d531e2e98", 474},
{"resource.001", 0, "6fd05926c2199af0af6f72f90d0d7260", 126895},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -1578,7 +1576,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "03dba704bb77da55a91ad27b5a3cac09", 528},
{"resource.001", 0, "9f5520f0297206928df0b0b36493cd33", 127532},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -1594,7 +1592,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "4a24443a25e2b1492462a52809605dc2", 277732},
{"resource.006", 0, "4a24443a25e2b1492462a52809605dc2", 345683},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2272,7 +2270,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8b77d0d4650c2052b356cece28294b58", 576},
{"resource.001", 0, "376ef6d6eaaeed66e1424bd219c4b9ab", 215398},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2288,7 +2286,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "77f02def3094af804fd2371db25b7100", 349899},
{"resource.006", 0, "77f02def3094af804fd2371db25b7100", 354991},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2301,7 +2299,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 546000},
{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 591851},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2314,7 +2312,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 542897},
{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 586857},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2914,7 +2912,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 746496},
{"resource.004", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 761984},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_0,
SCI_VERSION_0
},
@@ -2941,7 +2939,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ec66ac2b1ce58b2575ba00b65058de1a", 612},
{"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 180245},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2954,7 +2952,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720244},
{"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688367},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
@@ -2984,7 +2982,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "9107c2aa5398e28b5c5406df13491f85", 320643},
{"resource.007", 0, "9107c2aa5398e28b5c5406df13491f85", 344287},
{NULL, 0, NULL, 0}}, Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH},
- GF_FOR_SCI0_BEFORE_502,
+ GF_FOR_SCI0_BEFORE_629,
SCI_VERSION_AUTODETECT,
SCI_VERSION_0
},
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index bbb29ada3b..a1e2c24955 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -89,7 +89,7 @@ int _reset_graphics_input(EngineState *s) {
s->priority_first = 42; // Priority zone 0 ends here
- if (s->_flags & GF_SCI0_OLDGFXFUNCS)
+ if (s->_kernel->usesOldGfxFunctions())
s->priority_last = 200;
else
s->priority_last = 190;
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 8acce8dd6a..b03a073d8f 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -369,6 +369,10 @@ Kernel::Kernel(ResourceManager *resmgr, bool isOldSci0) : _resmgr(resmgr) {
// Map a few special selectors for later use
mapSelectors();
+
+ // SCI0 games using old graphics functions (before version 0.000.502) have the TimesSin
+ // kernel function, whereas newer games have the SinMult kernel function in its place
+ _oldGfxFunctions = !hasKernelFunction("SinMult");
}
Kernel::~Kernel() {
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 46913a5b39..e3ecddca26 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -83,6 +83,14 @@ public:
*/
bool hasKernelFunction(const char *functionName) const;
+ /* Applies to all versions before 0.000.502
+ ** Old SCI versions used to interpret the third DrawPic() parameter inversely,
+ ** with the opposite default value (obviously).
+ ** Also, they used 15 priority zones from 42 to 200 instead of 14 priority
+ ** zones from 42 to 190.
+ */
+ bool usesOldGfxFunctions() const { return _oldGfxFunctions; }
+
// Script dissection/dumping functions
void dissectScript(int scriptNumber, Vocabulary *vocab);
void dumpScriptObject(char *data, int seeker, int objsize);
@@ -126,6 +134,7 @@ private:
bool loadOpcodes();
ResourceManager *_resmgr;
+ bool _oldGfxFunctions;
// Kernel-related lists
/**
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index c2777d9b0e..6e737597d6 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -164,7 +164,7 @@ int _find_view_priority(EngineState *s, int y) {
return j;
return 14; // Maximum
} else {
- if (!(s->_flags & GF_SCI0_OLDGFXFUNCS))
+ if (!s->_kernel->usesOldGfxFunctions())
return SCI0_VIEW_PRIORITY_14_ZONES(y);
else
return SCI0_VIEW_PRIORITY(y) == 15 ? 14 : SCI0_VIEW_PRIORITY(y);
@@ -172,7 +172,7 @@ int _find_view_priority(EngineState *s, int y) {
}
int _find_priority_band(EngineState *s, int nr) {
- if (!(s->_flags & GF_SCI0_OLDGFXFUNCS) && (nr < 0 || nr > 14)) {
+ if (!s->_kernel->usesOldGfxFunctions() && (nr < 0 || nr > 14)) {
if (nr == 15)
return 0xffff;
else {
@@ -181,7 +181,7 @@ int _find_priority_band(EngineState *s, int nr) {
return 0;
}
- if ((s->_flags & GF_SCI0_OLDGFXFUNCS) && (nr < 0 || nr > 15)) {
+ if (s->_kernel->usesOldGfxFunctions() && (nr < 0 || nr > 15)) {
warning("Attempt to get priority band %d", nr);
return 0;
}
@@ -191,7 +191,7 @@ int _find_priority_band(EngineState *s, int nr) {
else {
int retval;
- if (!(s->_flags & GF_SCI0_OLDGFXFUNCS))
+ if (!s->_kernel->usesOldGfxFunctions())
retval = SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr);
else
retval = SCI0_PRIORITY_BAND_FIRST(nr);
@@ -998,7 +998,7 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
gfx_color_t transparent = s->wm_port->_bgcolor;
int picFlags = DRAWPIC01_FLAG_FILL_NORMALLY;
- if (s->_flags & GF_SCI0_OLDGFXFUNCS)
+ if (s->_kernel->usesOldGfxFunctions())
add_to_pic = (argc > 2) ? argv[2].toSint16() : false;
dp.nr = argv[0].toSint16();
@@ -1052,7 +1052,7 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->priority_first = 42;
- if (s->_flags & GF_SCI0_OLDGFXFUNCS)
+ if (s->_kernel->usesOldGfxFunctions())
s->priority_last = 200;
else
s->priority_last = 190;
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index aa9e2415f5..4e453e7af6 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -158,7 +158,6 @@ Common::Error SciEngine::run() {
// SCI1
if (flags & GF_SCI0_OLD ||
- flags & GF_SCI0_OLDGFXFUNCS ||
flags & GF_SCI0_OLDGETTIME) {
error("This game entry is erroneous. It's marked as SCI1, but it has SCI0 flags set");
}
@@ -170,7 +169,6 @@ Common::Error SciEngine::run() {
}
if (flags & GF_SCI0_OLD ||
- flags & GF_SCI0_OLDGFXFUNCS ||
flags & GF_SCI0_OLDGETTIME) {
error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI0 flags set");
}
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index b68301546d..ea50976df4 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -96,18 +96,10 @@ enum SciGameFlags {
*/
GF_SCI0_OLD = (1 << 0),
- /* Applies to all versions before 0.000.502
- ** Old SCI versions used to interpret the third DrawPic() parameter inversely,
- ** with the opposite default value (obviously).
- ** Also, they used 15 priority zones from 42 to 200 instead of 14 priority
- ** zones from 42 to 190.
- */
- GF_SCI0_OLDGFXFUNCS = (1 << 1),
-
/* Applies to all versions before 0.000.629
** Older SCI versions had simpler code for GetTime()
*/
- GF_SCI0_OLDGETTIME = (1 << 2),
+ GF_SCI0_OLDGETTIME = (1 << 1),
// ----------------------------------------------------------------------------
@@ -118,18 +110,18 @@ enum SciGameFlags {
/*
** Used to distinguish SCI1 EGA games
*/
- GF_SCI1_EGA = (1 << 3),
+ GF_SCI1_EGA = (1 << 2),
/* 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 << 4),
+ GF_SCI1_LOFSABSOLUTE = (1 << 3),
/* Applies to all versions from 1.000.510 onwards
** kDoSound() is different than in earlier SCI1 versions.
*/
- GF_SCI1_NEWDOSOUND = (1 << 5)
+ GF_SCI1_NEWDOSOUND = (1 << 4)
};
class SciEngine : public Engine {