aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp14
-rw-r--r--engines/sci/engine/kernel.h2
-rw-r--r--engines/sci/engine/vm.cpp4
3 files changed, 16 insertions, 4 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index bab6276228..27ece063ad 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -744,9 +744,17 @@ uint Kernel::getSelectorNamesSize() const {
return _selectorNames.size();
}
-const Common::String &Kernel::getSelectorName(uint selector) const {
- if (selector >= _selectorNames.size())
- return _invalid;
+const Common::String &Kernel::getSelectorName(uint selector) {
+ if (selector >= _selectorNames.size()) {
+ // This should only occur in games w/o a selector-table
+ // We need this for proper workaround tables
+ // TODO: maybe check, if there is a fixed selector-table and error() out in that case
+ for (uint loopSelector = _selectorNames.size(); loopSelector <= selector; loopSelector++) {
+ Common::String newSelectorName;
+ newSelectorName = newSelectorName.printf("<noname %d>", loopSelector);
+ _selectorNames.push_back(newSelectorName);
+ }
+ }
return _selectorNames[selector];
}
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 53b0dcb68e..baae5d7cd8 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -160,7 +160,7 @@ public:
~Kernel();
uint getSelectorNamesSize() const;
- const Common::String &getSelectorName(uint selector) const;
+ const Common::String &getSelectorName(uint selector);
uint getKernelNamesSize() const;
const Common::String &getKernelName(uint number) const;
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 9ec8842ab3..7effc13462 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -378,6 +378,10 @@ static reg_t arithmetic_lookForWorkaround(const byte opcode, const SciWorkaround
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
+ { GID_CNICK_KQ, 200, 0, 1, "Character", "<noname 446>", -1, 504, { 0, 0 } }, // checkers, like in hoyle 3
+ { GID_CNICK_KQ, 200, 0, 1, "Character", "<noname 446>", -1, 505, { 0, 0 } }, // checkers, like in hoyle 3
+ { GID_CNICK_KQ, -1, 700, 0, "gcWindow", "<noname 183>", -1, -1, { 0, 0 } }, // when entering control menu, like in hoyle 3
+ { GID_CNICK_LONGBOW, 0, 0, 0, "RH Budget", "<noname 110>", -1, 1, { 0, 0 } }, // when starting the game
{ GID_FREDDYPHARKAS, -1, 24, 0, "gcWin", "open", -1, 5, { 0, 0xf } }, // is used as priority for game menu
{ GID_FREDDYPHARKAS, -1, 31, 0, "quitWin", "open", -1, 5, { 0, 0xf } }, // is used as priority for game menu
{ GID_GK1, -1, 64950, 1, "Feature", "handleEvent", -1, 0, { 0, 0 } }, // sometimes when walk-clicking