aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-10 19:58:25 +0000
committerMartin Kiewitz2010-07-10 19:58:25 +0000
commit5c2489f1533067dcfe303496055e63e8c8d7c189 (patch)
tree943fbb3aa9627b6b39d8657b3fbd5044d5ab3a5e /engines
parent8b112704b2e840c6b0f789d527c6bc79fcc9c7e9 (diff)
downloadscummvm-rg350-5c2489f1533067dcfe303496055e63e8c8d7c189.tar.gz
scummvm-rg350-5c2489f1533067dcfe303496055e63e8c8d7c189.tar.bz2
scummvm-rg350-5c2489f1533067dcfe303496055e63e8c8d7c189.zip
SCI: removing hoyle workaround from kAbs & signature and adding it into workaround table
svn-id: r50790
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp11
-rw-r--r--engines/sci/engine/kmath.cpp6
-rw-r--r--engines/sci/engine/vm.cpp4
3 files changed, 13 insertions, 8 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 4d5ee4aafe..74b0502af4 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -242,6 +242,14 @@ reg_t kDummy(EngineState *s, int argc, reg_t *argv) {
// .* -> any parameters afterwards (or none)
// gameID, scriptNr,lvl, object-name, method-name, call, index, replace
+static const SciWorkaroundEntry kAbs_workarounds[] = {
+ { GID_HOYLE1, 1, 0, "room1", "doit", -1, 0, { 2, 0x3e9 } }, // crazy eights - called with objects instead of integers
+ { GID_HOYLE1, 2, 0, "room2", "doit", -1, 0, { 2, 0x3e9 } }, // old maid - called with objects instead of integers
+ { GID_HOYLE1, 3, 0, "room3", "doit", -1, 0, { 2, 0x3e9 } }, // hearts - called with objects instead of integers
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+// gameID, scriptNr,lvl, object-name, method-name, call, index, replace
static const SciWorkaroundEntry kDisposeScript_workarounds[] = {
{ GID_QFG1, 64, 0, "rm64", "dispose", -1, 0, { 1, 0 } }, // parameter 0 is an object when leaving graveyard
SCI_WORKAROUNDENTRY_TERMINATOR
@@ -412,8 +420,7 @@ struct SciKernelMapEntry {
// name, version/platform, signature, sub-signatures, workarounds
static SciKernelMapEntry s_kernelMap[] = {
- { MAP_CALL(Abs), SIG_EVERYWHERE, "[io]", NULL, NULL },
- // ^^ FIXME hoyle
+ { MAP_CALL(Abs), SIG_EVERYWHERE, "i", NULL, kAbs_workarounds },
{ MAP_CALL(AddAfter), SIG_EVERYWHERE, "lnn", NULL, NULL },
{ MAP_CALL(AddMenu), SIG_EVERYWHERE, "rr", NULL, NULL },
{ MAP_CALL(AddToEnd), SIG_EVERYWHERE, "ln", NULL, NULL },
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp
index a7baf72b65..eab964d624 100644
--- a/engines/sci/engine/kmath.cpp
+++ b/engines/sci/engine/kmath.cpp
@@ -36,12 +36,6 @@ reg_t kRandom(EngineState *s, int argc, reg_t *argv) {
}
reg_t kAbs(EngineState *s, int argc, reg_t *argv) {
- if (g_sci->getGameId() == GID_HOYLE1) {
- // This is a hack, but so is the code in Hoyle1 that needs it.
- // FIXME: where is this exactly needed?
- if (argv[0].segment)
- return make_reg(0, 0x3e9); // Yes people, this is an object
- }
return make_reg(0, abs(argv[0].toSint16()));
}
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index cbfaf5575f..4755db3922 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -796,6 +796,8 @@ 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)
+ s->r_acc = make_reg(0, workaround.offset);
if (workaround.segment)
return;
}
@@ -838,6 +840,8 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) {
error("[VM] k%s: signature mismatch via method %s::%s (script %d, localCall %x)", kernelSubCall.name, 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)
+ s->r_acc = make_reg(0, workaround.offset);
if (workaround.segment)
return;
}