diff options
| -rw-r--r-- | engines/sci/engine/kernel.cpp | 11 | ||||
| -rw-r--r-- | engines/sci/engine/kmath.cpp | 6 | ||||
| -rw-r--r-- | engines/sci/engine/vm.cpp | 4 | 
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;  		}  | 
