aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-20 11:45:06 +0000
committerMartin Kiewitz2010-07-20 11:45:06 +0000
commit0b3f816c8b13d1cbc2b121461bdcd8aa2068ddde (patch)
treec6402f0b7a89bf932ef660b97b0f305a16e8f707 /engines/sci/engine
parent3c97772d6e5aa05c7991d4114824fb0d7b5ff551 (diff)
downloadscummvm-rg350-0b3f816c8b13d1cbc2b121461bdcd8aa2068ddde.tar.gz
scummvm-rg350-0b3f816c8b13d1cbc2b121461bdcd8aa2068ddde.tar.bz2
scummvm-rg350-0b3f816c8b13d1cbc2b121461bdcd8aa2068ddde.zip
SCI: change the workaround-types
0 is now don't call 1 is do call 2 is don't call and fake acc makes more sense svn-id: r51060
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kernel.cpp28
-rw-r--r--engines/sci/engine/vm.cpp11
2 files changed, 23 insertions, 16 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 79b9d506c7..bab6276228 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -231,56 +231,56 @@ static const SciWorkaroundEntry kAbs_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kDisposeScript_workarounds[] = {
- { GID_QFG1, 64, 64, 0, "rm64", "dispose", -1, 0, { 1, 0 } }, // when leaving graveyard, parameter 0 is an object
+ { GID_QFG1, 64, 64, 0, "rm64", "dispose", -1, 0, { 0, 0 } }, // when leaving graveyard, parameter 0 is an object
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kDoSoundFade_workarounds[] = {
- { GID_KQ1, -1, 989, 0, "gameSound", "fade", -1, 0, { 1, 0 } }, // gets called in several scenes (e.g. graham cracker) with 0:0
- { GID_KQ6, 105, 989, 0, "globalSound", "fade", -1, 0, { 0, 0 } }, // floppy: during intro, parameter 4 is an object
+ { GID_KQ1, -1, 989, 0, "gameSound", "fade", -1, 0, { 0, 0 } }, // gets called in several scenes (e.g. graham cracker) with 0:0
+ { GID_KQ6, 105, 989, 0, "globalSound", "fade", -1, 0, { 1, 0 } }, // floppy: during intro, parameter 4 is an object
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kGraphRestoreBox_workarounds[] = {
- { GID_LSL6, -1, 85, 0, "rScroller", "hide", -1, 0, { 0, 0 } }, // happens when restoring (sometimes), same as the one below
- { GID_LSL6, -1, 85, 0, "lScroller", "hide", -1, 0, { 0, 0 } }, // happens when restoring (sometimes), same as the one below
- { GID_LSL6, -1, 86, 0, "LL6Inv", "show", -1, 0, { 0, 0 } }, // happens when restoring, is called with hunk segment, but hunk is not allocated at that time
+ { GID_LSL6, -1, 85, 0, "rScroller", "hide", -1, 0, { 1, 0 } }, // happens when restoring (sometimes), same as the one below
+ { GID_LSL6, -1, 85, 0, "lScroller", "hide", -1, 0, { 1, 0 } }, // happens when restoring (sometimes), same as the one below
+ { GID_LSL6, -1, 86, 0, "LL6Inv", "show", -1, 0, { 1, 0 } }, // happens when restoring, is called with hunk segment, but hunk is not allocated at that time
// ^^ TODO: check, if this is really a script error or an issue with our restore code
- { GID_LSL6, -1, 86, 0, "LL6Inv", "hide", -1, 0, { 0, 0 } }, // happens during the game, gets called with 1 extra parameter
+ { GID_LSL6, -1, 86, 0, "LL6Inv", "hide", -1, 0, { 1, 0 } }, // happens during the game, gets called with 1 extra parameter
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kGraphFillBoxForeground_workarounds[] = {
- { GID_LSL6, -1, 0, 0, "LSL6", "hideControls", -1, 0, { 0, 0 } }, // happens when giving the bungee key to merrily (room 240) and at least in room 650 too - gets called with additional 5th parameter
+ { GID_LSL6, -1, 0, 0, "LSL6", "hideControls", -1, 0, { 1, 0 } }, // happens when giving the bungee key to merrily (room 240) and at least in room 650 too - gets called with additional 5th parameter
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kGraphFillBoxAny_workarounds[] = {
- { GID_SQ4, -1, 818, 0, "iconTextSwitch", "show", -1, 0, { 0, 0 } }, // game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack
+ { GID_SQ4, -1, 818, 0, "iconTextSwitch", "show", -1, 0, { 1, 0 } }, // game menu "text/speech" display - parameter 5 is missing, but the right color number is on the stack
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kSetPort_workarounds[] = {
- { GID_LSL6, 740, 740, 0, "rm740", "drawPic", -1, 0, { 1, 0 } }, // ending scene, is called with additional 3 (!) parameters
+ { GID_LSL6, 740, 740, 0, "rm740", "drawPic", -1, 0, { 0, 0 } }, // ending scene, is called with additional 3 (!) parameters
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kUnLoad_workarounds[] = {
- { GID_LSL6, 130, 130, 0, "recruitLarryScr", "changeState", -1, 0, { 1, 0 } }, // during intro, a 3rd parameter is passed by accident
- { GID_LSL6, 740, 740, 0, "showCartoon", "changeState", -1, 0, { 1, 0 } }, // during ending, 4 additional parameters are passed by accident
- { GID_SQ1, 43, 303, 0, "slotGuy", "dispose", -1, 0, { 1, 0 } }, // when leaving ulence flats bar, parameter 1 is not passed - script error
+ { GID_LSL6, 130, 130, 0, "recruitLarryScr", "changeState", -1, 0, { 0, 0 } }, // during intro, a 3rd parameter is passed by accident
+ { GID_LSL6, 740, 740, 0, "showCartoon", "changeState", -1, 0, { 0, 0 } }, // during ending, 4 additional parameters are passed by accident
+ { GID_SQ1, 43, 303, 0, "slotGuy", "dispose", -1, 0, { 0, 0 } }, // when leaving ulence flats bar, parameter 1 is not passed - script error
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kStrCpy_workarounds[] = {
- { GID_ISLANDBRAIN, 260, 45, 0, "aWord", "addOn", -1, 0, { 0, 0 } }, // Hominy Homonym puzzle
+ { GID_ISLANDBRAIN, 260, 45, 0, "aWord", "addOn", -1, 0, { 1, 0 } }, // Hominy Homonym puzzle
SCI_WORKAROUNDENTRY_TERMINATOR
};
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index bd92b18d82..a56eab4ddf 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -882,10 +882,17 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) {
error("[VM] k%s[%x]: signature mismatch via method %s::%s (script %d, localCall %x)", kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, originReply.localCallOffset);
}
// FIXME: implement some real workaround type logic - ignore call, still do call etc.
- if (workaround.segment == 2)
+ switch (workaround.segment) {
+ case 0: // don't do kernel call, leave acc alone
+ return;
+ case 1: // call kernel anyway
+ break;
+ case 2: // don't do kernel call, fake acc
s->r_acc = make_reg(0, workaround.offset);
- if (workaround.segment)
return;
+ default:
+ error("unknown workaround type");
+ }
}