aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-09 18:42:21 +0000
committerFilippos Karapetis2010-06-09 18:42:21 +0000
commitc486b77bb7d96908d7df1e00b6a61b92fbd176ee (patch)
treecb06f541fad894588a9d27ef8329792f5299f7fb /engines/sci/engine
parentd191c9d0f935d280d7c1a7e71e3e13bbb76ee893 (diff)
downloadscummvm-rg350-c486b77bb7d96908d7df1e00b6a61b92fbd176ee.tar.gz
scummvm-rg350-c486b77bb7d96908d7df1e00b6a61b92fbd176ee.tar.bz2
scummvm-rg350-c486b77bb7d96908d7df1e00b6a61b92fbd176ee.zip
Fixed crash in SCI2.1 games
svn-id: r49546
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kernel.cpp5
-rw-r--r--engines/sci/engine/kernel.h6
-rw-r--r--engines/sci/engine/kernel32.cpp4
3 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 08aa65aa6d..2315dc384f 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -394,7 +394,6 @@ SciKernelFunction kfunct_mappers[] = {
Kernel::Kernel(ResourceManager *resMan, SegManager *segMan) : _resMan(resMan), _segMan(segMan) {
loadSelectorNames();
mapSelectors(); // Map a few special selectors for later use
- loadKernelNames(); // must be called after the selectors are set
}
Kernel::~Kernel() {
@@ -748,12 +747,12 @@ void Kernel::setDefaultKernelNames() {
}
}
-void Kernel::loadKernelNames() {
+void Kernel::loadKernelNames(GameFeatures *features) {
_kernelNames.clear();
#ifdef ENABLE_SCI32
if (getSciVersion() >= SCI_VERSION_2_1)
- setKernelNamesSci21();
+ setKernelNamesSci21(features);
else if (getSciVersion() == SCI_VERSION_2)
setKernelNamesSci2();
else
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index b79ba8caaa..990e2aff17 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -207,7 +207,6 @@ public:
*/
Common::String lookupText(reg_t address, int index);
-private:
/**
* Loads the kernel function names.
*
@@ -216,8 +215,9 @@ private:
* The resulting list has the same format regardless of the format of the
* name table of the resource (the format changed between version 0 and 1).
*/
- void loadKernelNames();
+ void loadKernelNames(GameFeatures *features);
+private:
/**
* Sets the default kernel function names, based on the SCI version used
*/
@@ -232,7 +232,7 @@ private:
/**
* Sets the default kernel function names to the SCI2.1 kernel functions
*/
- void setKernelNamesSci21();
+ void setKernelNamesSci21(GameFeatures *features);
#endif
/**
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp
index 0afdc3f2eb..f279d9a66f 100644
--- a/engines/sci/engine/kernel32.cpp
+++ b/engines/sci/engine/kernel32.cpp
@@ -378,7 +378,7 @@ void Kernel::setKernelNamesSci2() {
_kernelNames = Common::StringArray(sci2_default_knames, kKernelEntriesSci2);
}
-void Kernel::setKernelNamesSci21() {
+void Kernel::setKernelNamesSci21(GameFeatures *features) {
// Some SCI games use a modified SCI2 kernel table instead of the SCI2.1/SCI3 kernel table.
// The GK2 demo does this as well as at least one version of KQ7. We detect which version
// to use based on where kDoSound is called from Sound::play().
@@ -386,7 +386,7 @@ void Kernel::setKernelNamesSci21() {
// This is interesting because they all have the same interpreter version (2.100.002), yet
// they would not be compatible with other games of the same interpreter.
- if (g_sci->_features->detectSci21KernelType() == SCI_VERSION_2) {
+ if (features->detectSci21KernelType() == SCI_VERSION_2) {
_kernelNames = Common::StringArray(sci2_default_knames, kKernelEntriesGk2Demo);
// OnMe is IsOnMe here, but they should be compatible
_kernelNames[0x23] = "Robot"; // Graph in SCI2