From 205ee4d0d00a8aab333e4c743c27fc86d0af5b2e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 6 Sep 2018 22:01:17 +0300 Subject: SCI32: Allow malformed calls to kLock in PQ:SWAT, after the training videos Fixes bug #10699 --- engines/sci/engine/kernel_tables.h | 2 +- engines/sci/engine/workarounds.cpp | 7 +++++++ engines/sci/engine/workarounds.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 74c50cd5cf..547c5c3683 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -745,7 +745,7 @@ static SciKernelMapEntry s_kernelMap[] = { #ifdef ENABLE_SCI32 { "LocalToGlobal", kLocalToGlobal32, SIG_SCI32, SIGFOR_ALL, "oo", NULL, NULL }, #endif - { MAP_CALL(Lock), SIG_EVERYWHERE, "ii(i)", NULL, NULL }, + { MAP_CALL(Lock), SIG_EVERYWHERE, "ii(i)", NULL, kLock_workarounds }, { MAP_CALL(MapKeyToDir), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(Memory), SIG_EVERYWHERE, "i(.*)", NULL, kMemory_workarounds }, // subop { MAP_CALL(MemoryInfo), SIG_EVERYWHERE, "i", NULL, NULL }, diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 8f1714c393..05a6742ebc 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -853,6 +853,13 @@ const SciWorkaroundEntry kListAt_workarounds[] = { SCI_WORKAROUNDENTRY_TERMINATOR }; +// gameID, room,script,lvl, object-name, method-name, local-call-signature, index-range, workaround +const SciWorkaroundEntry kLock_workarounds[] = { + { GID_PQSWAT, 6400, 6400, 0, "rookerTrains3", "changeState", NULL, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // After completing Small Arms Training, at the end of the Tactics Training + { GID_PQSWAT, 6400, 6400, 0, "rookerTrains5", "changeState", NULL, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // After completing Small Arms Training, at the end of the Tactics Training + SCI_WORKAROUNDENTRY_TERMINATOR +}; + // gameID, room,script,lvl, object-name, method-name, local-call-signature, index-range, workaround const SciWorkaroundEntry kMemory_workarounds[] = { { GID_LAURABOW2, -1, 999, 0, "", "export 6", NULL, 0, 0, { WORKAROUND_FAKE, 0 } }, // during the intro, when exiting the train (room 160), talking to Mr. Augustini, etc. - bug #4944 diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h index ff1f5c6a87..284936b4a5 100644 --- a/engines/sci/engine/workarounds.h +++ b/engines/sci/engine/workarounds.h @@ -87,6 +87,7 @@ extern const SciWorkaroundEntry kGraphFillBoxAny_workarounds[]; extern const SciWorkaroundEntry kGraphRedrawBox_workarounds[]; extern const SciWorkaroundEntry kIsObject_workarounds[]; extern const SciWorkaroundEntry kListAt_workarounds[]; +extern const SciWorkaroundEntry kLock_workarounds[]; extern const SciWorkaroundEntry kMemory_workarounds[]; extern const SciWorkaroundEntry kMoveCursor_workarounds[]; extern const SciWorkaroundEntry kNewWindow_workarounds[]; -- cgit v1.2.3