diff options
-rw-r--r-- | engines/sci/engine/kernel.cpp | 17 | ||||
-rw-r--r-- | engines/sci/engine/kernel.h | 6 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 2 |
3 files changed, 15 insertions, 10 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index a35c518fdf..1a56c44c74 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -377,11 +377,11 @@ SciKernelFunction kfunct_mappers[] = { {NULL, NULL, NULL} // Terminator }; -Kernel::Kernel(ResourceManager *resMan) : _resMan(resMan) { +Kernel::Kernel(ResourceManager *resMan, Common::String gameName) : _resMan(resMan) { loadSelectorNames(); mapSelectors(); // Map a few special selectors for later use - loadKernelNames(); + loadKernelNames(gameName); mapFunctions(); // Map the kernel functions } @@ -713,7 +713,7 @@ void kernel_sleep(SciEvent *event, uint32 msecs ) { } } -void Kernel::setDefaultKernelNames() { +void Kernel::setDefaultKernelNames(Common::String gameName) { _kernelNames = Common::StringList(sci_default_knames, SCI_KNAMES_DEFAULT_ENTRIES_NR); // Some (later) SCI versions replaced CanBeHere by CantBeHere @@ -745,7 +745,12 @@ void Kernel::setDefaultKernelNames() { break; case SCI_VERSION_1_1: - _kernelNames[0x26] = "Portrait"; + // In SCI1.1, this kernel function is empty, apart from KQ6CD, + // where it has been replaced with kPortrait + if (gameName == "kq6") + _kernelNames[0x26] = "Portrait"; + else + _kernelNames[0x26] = "Dummy"; _kernelNames[0x71] = "PalVary"; _kernelNames[0x7c] = "Message"; break; @@ -756,7 +761,7 @@ void Kernel::setDefaultKernelNames() { } } -bool Kernel::loadKernelNames() { +bool Kernel::loadKernelNames(Common::String gameName) { _kernelNames.clear(); #ifdef ENABLE_SCI32 @@ -766,7 +771,7 @@ bool Kernel::loadKernelNames() { setKernelNamesSci2(); else #endif - setDefaultKernelNames(); + setDefaultKernelNames(gameName); return true; } diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index da66e8a5a4..fbfadf444a 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -61,7 +61,7 @@ public: /** * Initializes the SCI kernel */ - Kernel(ResourceManager *resMan); + Kernel(ResourceManager *resMan, Common::String gameName); ~Kernel(); uint getSelectorNamesSize() const; @@ -95,12 +95,12 @@ private: * name table of the resource (the format changed between version 0 and 1). * @return true on success, false on failure */ - bool loadKernelNames(); + bool loadKernelNames(Common::String gameName); /** * Sets the default kernel function names, based on the SCI version used */ - void setDefaultKernelNames(); + void setDefaultKernelNames(Common::String gameName); #ifdef ENABLE_SCI32 /** diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 04400df969..baf2be0edd 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -135,7 +135,7 @@ Common::Error SciEngine::run() { // Create debugger console. It requires GFX to be initialized _console = new Console(this); - _kernel = new Kernel(_resMan); + _kernel = new Kernel(_resMan, getGameID()); _vocabulary = new Vocabulary(_resMan); _audio = new AudioPlayer(_resMan); |