[Scummvm-git-logs] scummvm master -> 4582ec64702e9406244622f1999865a628ab9fb2

sluicebox noreply at scummvm.org
Tue Jan 27 00:03:57 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
4582ec6470 SCI32: Fix GK1 butler inset lockup


Commit: 4582ec64702e9406244622f1999865a628ab9fb2
    https://github.com/scummvm/scummvm/commit/4582ec64702e9406244622f1999865a628ab9fb2
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-26T16:03:49-08:00

Commit Message:
SCI32: Fix GK1 butler inset lockup

Fixes bug #16463

Changed paths:
    engines/sci/engine/script_patches.cpp


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 5dda05919fb..8b9a7f78943 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -169,6 +169,7 @@ static const char *const selectorNameTable[] = {
 	"tWindow",      // Camelot
 #ifdef ENABLE_SCI32
 	"newWith",      // SCI2 array script
+	"inset",        // GK1
 	"posn",         // GK1, Phant2, QFG4
 	"printLang",    // GK2
 	"test",         // Torin
@@ -316,6 +317,7 @@ enum ScriptPatcherSelectors {
 #ifdef ENABLE_SCI32
 	,
 	SELECTOR_newWith,
+	SELECTOR_inset,
 	SELECTOR_posn,
 	SELECTOR_printLang,
 	SELECTOR_test,
@@ -4562,6 +4564,71 @@ static const uint16 gk1CastlePathfindingPatch[] = {
 	PATCH_END
 };
 
+// On day 2 at the Gedde mansion, the butler waits for 12 seconds before closing
+//  the door. If this timer expires while viewing an inset in inventory, such
+//  as the murder photo, then the game is stuck in handsOff mode. When an inset
+//  is displayed, the Inset class pauses global timers and the room does not
+//  handle events, but the room's Script object continues to run. shutTheDoor is
+//  a room script that calls handsOff after a delay, leaving the inset stuck.
+//
+// It seems like this should affect more scripts in the game, but several things
+//  need to happen for a Script object to be vulnerable. It must be the current
+//  room's script, as opposed to another object's script, and it must not wait
+//  on any animation or movement in between a delay and handsOff, since the room
+//  is frozen during an inset.
+//
+// We fix this by pausing the butler's script whenever an inset is displayed.
+//  We add an inset check to shutTheDoor:doit to prevent calling its superclass.
+//
+// Applies to: All versions
+// Responsible method: shutTheDoor:doit
+// Fixes bug: #16463
+static const uint16 gk1ButlerInsetSignature[] = {
+	// shutTheDoor:doit
+	SIG_MAGICDWORD,
+	0x39, SIG_SELECTOR8(doit),          // pushi doit
+	0x76,                               // push0
+	0x57, SIG_ADDTOOFFSET(+1),          // super 04 [ super doit: ]
+	      SIG_UINT16(0x0004),
+	0x39, SIG_SELECTOR8(state),         // pushi state
+	0x76,                               // push0
+	0x54, SIG_UINT16(0x0004),           // self 04 [ self state: ]
+	0x36,                               // push
+	0x35, 0x00,                         // ldi 00
+	0x1a,                               // eq?     [ self:state == 0 ]
+	0x31, 0x11,                         // bnt 11  [ ret ]
+	0x83, 0x0a,                         // lal 10  [ acc = 0 or 1 ]
+	0x31, 0x0d,                         // bnt 0d  [ ret ]
+	0x38, SIG_SELECTOR16(seconds),      // pushi seconds
+	0x78,                               // push1
+	0x76,                               // push0
+	SIG_ADDTOOFFSET(+5),
+	0x54, SIG_UINT16(0x000c),           // self 0c [ self seconds: 0 changeState: 1 ]
+	0x48,                               // ret
+	// shutTheDoor:changeState [ used to get the `state` property index ]
+	0x87, 0x01,                         // lap 01
+	0x65,                               // aTop state
+	SIG_END
+};
+
+static const uint16 gk1ButlerInsetPatch[] = {
+	0x38, PATCH_SELECTOR16(inset),      // pushi inset
+	0x76,                               // push0
+	0x81, 0x02,                         // lag 02
+	0x4a, PATCH_UINT16(0x0004),         // send 04 [ rm350 inset: ]
+	0x2f, 0x07,                         // bt 07   [ skip super:doit if inset ]
+	PATCH_GETORIGINALBYTES(0, 7),       // [ super doit: ]
+	0x67, PATCH_GETORIGINALBYTE(0x28),  // pTos state
+	0x83, 0x0a,                         // lal 10
+	0x2a,                               // ult?    [ state < local10 ]
+	0x31, 0x0b,                         // bnt 0b  [ ret ]
+	0x76,                               // push0
+	0x69, PATCH_GETORIGINALBYTEADJUST(0x28, +8), // sTop seconds [ seconds = 0 ]
+	PATCH_ADDTOOFFSET(+5),
+	0x54, PATCH_UINT16(0x0006),         // self 06 [ self changeState: 1 ]
+	PATCH_END
+};
+
 // GK1 Mac is missing view 56, which is the close-up of the talisman. Clicking
 //  Look on the talisman from inventory is supposed to display an inset with
 //  view 56 and say a message, but instead this would crash the Mac interpreter.
@@ -4697,6 +4764,7 @@ static const SciScriptPatcherEntry gk1Signatures[] = {
 	{  true,   260, "fix day 5 snake attack (1/2)",                1, gk1Day5SnakeAttackSignature1,     gk1Day5SnakeAttackPatch1 },
 	{  true,   260, "fix day 5 snake attack (2/2)",                1, gk1Day5SnakeAttackSignature2,     gk1Day5SnakeAttackPatch2 },
 	{  true,   280, "fix pathfinding in Madame Cazanoux's house",  1, gk1CazanouxPathfindingSignature,  gk1CazanouxPathfindingPatch },
+	{  true,   350, "fix day 2 butler inset lockup",               1, gk1ButlerInsetSignature,          gk1ButlerInsetPatch },
 	{  true,   380, "fix Gran's room obstacles and ego flicker",   1, gk1GranRoomInitSignature,         gk1GranRoomInitPatch },
 	{  true,   410, "fix day 2 binoculars lockup",                 1, gk1Day2BinocularsLockupSignature, gk1Day2BinocularsLockupPatch },
 	{  true,   420, "fix day 6 empty booth message",               6, gk1EmptyBoothMessageSignature,    gk1EmptyBoothMessagePatch },




More information about the Scummvm-git-logs mailing list