aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-07-05 11:49:05 +0000
committerFilippos Karapetis2009-07-05 11:49:05 +0000
commitc31d1b3180903405058d274dd6a2cc984a64ed1e (patch)
tree64fe6e884c34d081629324d5b181696e0ce4debd /engines/sci
parent7e7c86a33747df93a4d88c6e6984e003a79726d1 (diff)
downloadscummvm-rg350-c31d1b3180903405058d274dd6a2cc984a64ed1e.tar.gz
scummvm-rg350-c31d1b3180903405058d274dd6a2cc984a64ed1e.tar.bz2
scummvm-rg350-c31d1b3180903405058d274dd6a2cc984a64ed1e.zip
- Fixed feature auto-detection for Conquests of Camelot
- Auto-detected features are now printed in the console (to ease debugging) svn-id: r42132
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kernel.cpp30
-rw-r--r--engines/sci/engine/kernel.h9
-rw-r--r--engines/sci/engine/ksound.cpp2
-rw-r--r--engines/sci/engine/script.cpp2
-rw-r--r--engines/sci/engine/vm.h2
5 files changed, 37 insertions, 8 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index eaa1cbcbc2..8ac629d87b 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -363,16 +363,40 @@ Kernel::Kernel(ResourceManager *resmgr, bool isOldSci0) : _resmgr(resmgr) {
mapFunctions(); // Map the kernel functions
// SCI0 games using old graphics functions (before version 0.000.502) did not have a
- // curAngle selector
- _oldGfxFunctions = (_selectorMap.curAngle == -1 && _resmgr->_sciVersion == SCI_VERSION_0);
+ // motionCue selector
+ _oldGfxFunctions = (_selectorMap.motionCue == -1 && _resmgr->_sciVersion == SCI_VERSION_0);
// SCI1 games which use absolute lofs have the egoMoveSpeed selector
_hasLofsAbsolute = (_selectorMap.egoMoveSpeed != -1 && _resmgr->_sciVersion < SCI_VERSION_1_1);
+
+ printAutoDetectedFeatures();
}
Kernel::~Kernel() {
}
+void Kernel::printAutoDetectedFeatures() {
+ if (_oldGfxFunctions)
+ printf("Kernel auto-detection: game found to be using old graphics functions\n");
+ else
+ printf("Kernel auto-detection: game found to be using newer graphics functions\n");
+
+ if (_hasLofsAbsolute)
+ printf("Kernel auto-detection: game found to be using absolute parameters for lofs\n");
+ else
+ printf("Kernel auto-detection: game found to be using relative parameters for lofs\n");
+
+ if (_selectorMap.setVol != -1)
+ printf("Kernel auto-detection: using SCI1 sound functions\n");
+ else if (_selectorMap.nodePtr != -1)
+ printf("Kernel auto-detection: using SCI01 sound functions\n");
+ else
+ printf("Kernel auto-detection: using SCI0 sound functions\n");
+
+ if (_resmgr->_sciVersion == SCI_VERSION_0 && _selectorMap.sightAngle != -1)
+ printf("Kernel auto-detection: found SCI0 game using a SCI1 kernel table\n");
+}
+
void Kernel::loadSelectorNames(bool isOldSci0) {
int count;
@@ -733,7 +757,7 @@ void Kernel::setDefaultKernelNames() {
// Check if we have a SCI01 game which uses a SCI1 kernel table (e.g. the KQ1 demo
// and full version). We do this by checking if the sightAngle selector exists, as no
// SCI0 game seems to have it
- if (_selectorMap.sightAngle != -1)
+ if (_selectorMap.sightAngle != -1 && isSci0)
isSci0 = false;
_kernelNames.resize(SCI_KNAMES_DEFAULT_ENTRIES_NR + (isSci0 ? 4 : 0));
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index da8ef04135..da3d255329 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -125,11 +125,16 @@ private:
void setDefaultKernelNames();
/**
- * Loads the kernel selector names.
- */
+ * Loads the kernel selector names.
+ */
void loadSelectorNames(bool isOldSci0);
/**
+ * Prints auto-detected features from selectors
+ */
+ void printAutoDetectedFeatures();
+
+ /**
* Maps special selectors
*/
void mapSelectors();
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 1dc597a80d..fa64ab4086 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -966,7 +966,7 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t kDoSound(EngineState *s, int funct_nr, int argc, reg_t *argv) {
if (s->_kernel->_selectorMap.setVol != -1)
return kDoSound_SCI1(s, funct_nr, argc, argv);
- else if (s->_version >= SCI_VERSION_01)
+ else if (s->_kernel->_selectorMap.nodePtr != -1)
return kDoSound_SCI01(s, funct_nr, argc, argv);
else
return kDoSound_SCI0(s, funct_nr, argc, argv);
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 0b89fbc093..d4bd094b4a 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -202,7 +202,7 @@ void Kernel::mapSelectors() {
FIND_SELECTOR(printLang);
FIND_SELECTOR(subtitleLang);
FIND_SELECTOR(parseLang);
- FIND_SELECTOR(curAngle);
+ FIND_SELECTOR(motionCue);
FIND_SELECTOR(sightAngle);
FIND_SELECTOR(setVol);
FIND_SELECTOR(egoMoveSpeed);
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index f20838bb4a..adaa064a6c 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -203,7 +203,7 @@ struct selector_map_t {
Selector printLang; /**< Used for i18n */
Selector subtitleLang;
Selector parseLang;
- Selector curAngle; // Used to detect newer graphics functions semantics.
+ Selector motionCue; // Used to detect newer graphics functions semantics.
Selector sightAngle; // Used to detect some SCI0/SCI01 games which need a SCI1 table
Selector setVol; // Used to detect newer sound semantics
Selector egoMoveSpeed; // Used to detect SCI1 games which use absolute values in lofs