From 50e493f3ef368847b95d443bee13f6918bbab34e Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 28 Jul 2010 03:54:14 +0000 Subject: SCI: Fix bug #3035720 - SQ1SCI demo: Menu crash kCelWide and kCelHigh are called with the second two parameters as objects instead of integers. We fake return the real width/height of the view in question to allow the quit menu to work. Values found by examining the view passed as the first parameter. svn-id: r51401 --- engines/sci/engine/kernel_tables.h | 4 ++-- engines/sci/engine/workarounds.cpp | 12 ++++++++++++ engines/sci/engine/workarounds.h | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 8e245d6b4c..de791c7c51 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -309,8 +309,8 @@ static SciKernelMapEntry s_kernelMap[] = { { "CantBeHere", kCantBeHere32, SIG_SCI32, SIGFOR_ALL, "ol", NULL, NULL }, #endif { MAP_CALL(CantBeHere), SIG_EVERYWHERE, "o(l)", NULL, NULL }, - { MAP_CALL(CelHigh), SIG_EVERYWHERE, "ii(i)", NULL, NULL }, - { MAP_CALL(CelWide), SIG_EVERYWHERE, "ii(i)", NULL, NULL }, + { MAP_CALL(CelHigh), SIG_EVERYWHERE, "ii(i)", NULL, kCelHigh_workarounds }, + { MAP_CALL(CelWide), SIG_EVERYWHERE, "ii(i)", NULL, kCelWide_workarounds }, { MAP_CALL(CheckFreeSpace), SIG_SCI32, SIGFOR_ALL, "r.*", NULL, NULL }, { MAP_CALL(CheckFreeSpace), SIG_SCI11, SIGFOR_ALL, "r(i)", NULL, NULL }, { MAP_CALL(CheckFreeSpace), SIG_EVERYWHERE, "r", NULL, NULL }, diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 0a44707644..244066a6e6 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -122,6 +122,18 @@ const SciWorkaroundEntry kAbs_workarounds[] = { SCI_WORKAROUNDENTRY_TERMINATOR }; +// gameID, room,script,lvl, object-name, method-name, call,index, workaround +const SciWorkaroundEntry kCelHigh_workarounds[] = { + { GID_SQ1, 1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_FAKE, 66 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu + SCI_WORKAROUNDENTRY_TERMINATOR +}; + +// gameID, room,script,lvl, object-name, method-name, call,index, workaround +const SciWorkaroundEntry kCelWide_workarounds[] = { + { GID_SQ1, 1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_FAKE, 78 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu + SCI_WORKAROUNDENTRY_TERMINATOR +}; + // gameID, room,script,lvl, object-name, method-name, call,index, workaround const SciWorkaroundEntry kDisplay_workarounds[] = { { GID_ISLANDBRAIN, 300, 300, 0, "geneDude", "show", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the gene explanation chart - a parameter is an object diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h index 01c7676247..d509d300d7 100644 --- a/engines/sci/engine/workarounds.h +++ b/engines/sci/engine/workarounds.h @@ -73,6 +73,8 @@ extern const SciWorkaroundEntry opcodeOrWorkarounds[]; extern const SciWorkaroundEntry opcodeDptoaWorkarounds[]; extern const SciWorkaroundEntry uninitializedReadWorkarounds[]; extern const SciWorkaroundEntry kAbs_workarounds[]; +extern const SciWorkaroundEntry kCelHigh_workarounds[]; +extern const SciWorkaroundEntry kCelWide_workarounds[]; extern const SciWorkaroundEntry kDisplay_workarounds[]; extern const SciWorkaroundEntry kDisposeScript_workarounds[]; extern const SciWorkaroundEntry kDoSoundFade_workarounds[]; -- cgit v1.2.3