[Scummvm-git-logs] scummvm branch-2-7 -> d31ef39bcb024194f8d83304e3d481762abf490e

sluicebox noreply at scummvm.org
Thu Jun 29 18:40:33 UTC 2023


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

Summary:
3bc2d1823f SCI: Update Freddy Pharkas detection entries
7ebb728b82 SCI: Update KQ5 Amiga detection entries
9b102d1366 SCI: Fix KQ5 sinking boat position
8e64119bc5 SCI: Fix LONGBOW crash during pub party
b2de310cb5 SCI32: Add entries for TORIN Italian and Portuguese
6c442f3ec9 WIN32: Fix CoInitialize / CoUninitialize imbalance
7ec97c47d7 SCI: Fix LONGBOW emerald lockup
123b6f00b4 SCI: Fix crash in script debugger
18a64a3bca SCI: Fix LSL5 Hollywood sign
4a40ac92ea SCI: Fix LSL5 warnings when printing messages
e5d307dc41 SCI32: Show all PHANT1 saves on delete screen
f87f0cb462 SCI: Add detection and workaround for SQ1 Demo variant
6cba5e3580 SCI: Add detection for KQ5 and LSL1 EGA Spanish
fdf556e86b SCI32: Fix PHANT1 basement fast-forward lockup
f5d3371935 SCI: Add detection for KQ4 1.003.006 360k disks
7d3a90e8d7 SCI: Fix LB2 dinosaur bone verb handler
b14fa3dd85 SCI: Fix LB2 debugger dialog
e86a6dae47 SCI: Fix QFG2 visa crash
d018c7863f SCI: Update LSL1 elevator polygon patch
06ee299409 SCI: Use kMoveCursor in ECO1 Demo
69fcf6bf2b SCI: Add `locals` console debugger command
d31ef39bcb SCI32: Add compatibility with GK1 CD Italian fan translation


Commit: 3bc2d1823f5cb006e1d3fbe6a89b7c61e3790955
    https://github.com/scummvm/scummvm/commit/3bc2d1823f5cb006e1d3fbe6a89b7c61e3790955
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:18-07:00

Commit Message:
SCI: Update Freddy Pharkas detection entries

- Add missing RESOURCE.MSG file sizes.

- Remove invalid "Spanish CD" entry. This just contained the install
  files for the Spanish version distributed on CD. We require the
  installer to assemble RESOURCE.000 from these files, and we already
  have the correct Spanish entry.

- Set correct RESOURCE.000 hash on the French entry. All floppy versions
  use the same RESOURCE.000. This incorrect hash was produced by
  manually concatenating each disk's RESOURCE.000 together or by running
  the installer without installing digital audio. This game requires the
  installer to update RESOURCE.000 with the correct audio map during
  RESOURCE.AUD decompression.

- Remove invalid "Windows" entry. This is another entry with the same
  audio-less RESOURCE.000 hash. It is unrelated to the platform.

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 5381a68b78e..eae04923eb5 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -750,51 +750,29 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 	{"freddypharkas", "Floppy", {
 		{"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
 		{"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
-		{"resource.msg", 0, "554f65315d851184f6e38211489fdd8f", -1},
+		{"resource.msg", 0, "554f65315d851184f6e38211489fdd8f", 331706},
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16	},
 
-	// Freddy Pharkas - French DOS Floppy (supplied by misterhands in bug report #6190)
+	// Freddy Pharkas - French DOS Floppy
 	// Executable scanning reports "1.cfs.081"
 	{"freddypharkas", "Floppy", {
 		{"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
-		{"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 5233230},
+		{"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
 		{"resource.msg", 0, "4dc478f5c73b57e5d690bdfffdcf1c44", 816518},
 		AD_LISTEND},
 		Common::FR_FRA, Common::kPlatformDOS, 0, GUIO_STD16	},
 
-	// Freddy Pharkas - Windows (supplied by abevi in bug report #4176)
-	// Executable scanning reports "1.cfs.081"
-	// SCI interpreter version 1.001.132 (just a guess)
-	{"freddypharkas", "Floppy", {
-		{"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
-		{"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 5233230},
-		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_STD16	},
-
 	// Freddy Pharkas - German DOS Floppy (from Tobis87, updated information from markcoolio in bug reports #4266 and #4286)
 	// Executable scanning reports "1.cfs.081"
 	// SCI interpreter version 1.001.132 (just a guess)
 	{"freddypharkas", "", {
 		{"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
 		{"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
-		{"resource.msg", 0, "304b5a5781800affd2235152a5794fa8", -1},
+		{"resource.msg", 0, "304b5a5781800affd2235152a5794fa8", 911164},
 		AD_LISTEND},
 		Common::DE_DEU, Common::kPlatformDOS, 0, GUIO_STD16	},
 
-	// Freddy Pharkas - Spanish DOS (from jvprat)
-	// Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
-	// SCI interpreter version 1.001.132 (just a guess)
-	{"freddypharkas", "CD", {
-		{"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
-		{"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 1456640},
-		{"resource.001", 0, "15298fac241b5360763bfb68add1db07", 1456640},
-		{"resource.002", 0, "419dbd5366f702b4123dedbbb0cffaae", 1456640},
-		{"resource.003", 0, "05acdc256c742e79c50b9fe7ec2cc898", 863310},
-		{"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
-		AD_LISTEND},
-		Common::ES_ESP, Common::kPlatformDOS, ADGF_CD, GUIO_STD16_SPEECH	},
-
 	// Freddy Pharkas - Spanish DOS (from jvprat)
 	// Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
 	// SCI interpreter version 1.001.132 (just a guess)


Commit: 7ebb728b8266c5a5cfc256e548b429001edaa7e1
    https://github.com/scummvm/scummvm/commit/7ebb728b8266c5a5cfc256e548b429001edaa7e1
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:18-07:00

Commit Message:
SCI: Update KQ5 Amiga detection entries

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index eae04923eb5..e85d6c12dc9 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1751,6 +1751,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 								  GAMEOPTION_WINDOWS_CURSORS)
 
 	// King's Quest 5 - English Amiga (from www.back2roots.org)
+	// Game version 1.000.000
 	// Executable scanning reports "1.004.018"
 	// SCI interpreter version 1.000.060
 	{"kq5", "", {
@@ -1767,6 +1768,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16	},
 
 	// King's Quest 5 - German Amiga (also includes english language)
+	// Game version 1.000.009
 	// Executable scanning reports "1.004.024"
 	// SCI interpreter version 1.000.060
 	{"kq5", "", {
@@ -1784,6 +1786,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO_STD16	},
 
 	// King's Quest 5 - Italian Amiga (also includes english language)
+	// Game version 1.000.003
 	// Executable scanning reports "1.004.024"
 	// SCI interpreter version 1.000.060
 	{"kq5", "", {
@@ -1796,6 +1799,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.005", 0, "de3c5c09e350fded36ca354998c2194d", 754784},
 		{"resource.006", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 672527},
 		{"resource.007", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 794259},
+		{"resource.008", 0, "64a63bdbeb01139b524af8ae6abb6c4d", 715226},
 		AD_LISTEND},
 		Common::IT_ITA, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO_STD16	},
 


Commit: 9b102d1366077baf93fc7ab75139bbc94997a86f
    https://github.com/scummvm/scummvm/commit/9b102d1366077baf93fc7ab75139bbc94997a86f
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:18-07:00

Commit Message:
SCI: Fix KQ5 sinking boat position

Fixes bug #14218

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 27a575db4ab..b02c456b878 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -120,6 +120,7 @@ static const char *const selectorNameTable[] = {
 	"solvePuzzle",  // Quest For Glory 3
 	"curIcon",      // Quest For Glory 3, QFG4
 	"curInvIcon",   // Quest For Glory 3, QFG4
+	"edgeHit",      // King's Quest 5
 	"startText",    // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
 	"startAudio",   // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
 	"modNum",       // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
@@ -261,6 +262,7 @@ enum ScriptPatcherSelectors {
 	SELECTOR_solvePuzzle,
 	SELECTOR_curIcon,
 	SELECTOR_curInvIcon,
+	SELECTOR_edgeHit,
 	SELECTOR_startText,
 	SELECTOR_startAudio,
 	SELECTOR_modNum,
@@ -5346,10 +5348,51 @@ static const uint16 kq5PatchPc98CampfireMessages[] = {
 	PATCH_END
 };
 
+// When the boat sinks while game speed is set to fast, the boat jumps from its
+//  initial position to the left edge of the screen. This is because at fast
+//  speeds, ego reaches the right edge when leaving the previous screen.
+//  The sinking script doesn't expect ego:edgeHit to be set, and when it is,
+//  Rm:init moves ego back to the opposite edge.
+//
+// We fix this by clearing ego:edgeHit when initializing the sinking boat.
+//
+// Applies to: All versions
+// Responsible method: rm047:init
+// Fixes bug: #14218
+static const uint16 kq5SignatureSinkingBoatPosition[] = {
+	0x30, SIG_UINT16(0x0078),        // bnt 0078
+	SIG_ADDTOOFFSET(+9),
+	0x81, 0x00,                      // lag 00
+	0x4a, 0x08,                      // send 08 [ ego ... ]
+	SIG_ADDTOOFFSET(+24),
+	SIG_MAGICDWORD,
+	0x39, SIG_SELECTOR8(loop),       // pushi loop
+	0x78,                            // push1
+	0x76,                            // push0 [ redundant, loop is already 0 ]
+	SIG_ADDTOOFFSET(+8),
+	0x4a, 0x24,                      // send 24 [ sailBoat ... loop: 0 ... ]
+	SIG_END
+};
+
+static const uint16 kq5PatchSinkingBoatPosition[] = {
+	0x31, 0x79,                      // bnt 79
+	PATCH_GETORIGINALBYTES(3, 9),
+	0x38, PATCH_SELECTOR16(edgeHit), // pushi edgeHit
+	0x78,                            // push1
+	0x76,                            // push0
+	0x81, 0x00,                      // lag 00
+	0x4a, 0x0e,                      // send 0e [ ego ... edgeHit: 0 ]
+	PATCH_GETORIGINALBYTES(16, 24),
+	PATCH_ADDTOOFFSET(+8),
+	0x4a, 0x1e,                      // send 1e [ sailBoat ... ]
+	PATCH_END
+};
+
 //          script, description,                                      signature                  patch
 static const SciScriptPatcherEntry kq5Signatures[] = {
 	{  true,     0, "CD: harpy volume change",                     1, kq5SignatureCdHarpyVolume,            kq5PatchCdHarpyVolume },
 	{  true,     0, "timer rollover",                              1, sciSignatureTimerRollover,            sciPatchTimerRollover },
+	{  true,    47, "sinking boat position",                       1, kq5SignatureSinkingBoatPosition,      kq5PatchSinkingBoatPosition },
 	{  true,    99, "disable speed test",                          1, sci01SpeedTestLocalSignature,         sci01SpeedTestLocalPatch },
 	{  true,    99, "disable speed test",                          1, sci11SpeedTestSignature,              sci11SpeedTestPatch },
 	{ false,   109, "Crispin intro signal",                        1, kq5SignatureCrispinIntroSignal,       kq5PatchCrispinIntroSignal },


Commit: 8e64119bc573a382699159984c26841e88f48cfa
    https://github.com/scummvm/scummvm/commit/8e64119bc573a382699159984c26841e88f48cfa
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:19-07:00

Commit Message:
SCI: Fix LONGBOW crash during pub party

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 b02c456b878..07d99152465 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -7958,6 +7958,27 @@ static const uint16 longbowPatchAmigaPubFix[] = {
 	PATCH_END
 };
 
+// During the party in the pub, one of the sheriff's men has a broken doVerb
+//  method that attempts to load an invalid class when clicking an item on him.
+//  This fails silently in the original. We patch out the broken instruction.
+//
+// Applies to: All versions
+// Responsible method: man2:doVerb
+static const uint16 longbowSignaturePubPartyFix[] = {
+	0x50, SIG_ADDTOOFFSET(+2),      // class ????
+	0x1a,                           // eq?
+	0x30, SIG_UINT16(0x0004),       // bnt 0004
+	SIG_MAGICDWORD,
+	0x63, 0x00,                     // pToa species
+	0x87, 0x01,                     // lap 01
+	SIG_END
+};
+
+static const uint16 longbowPatchPubPartyFix[] = {
+	0x34, PATCH_UINT16(0xffff),     // ldi ffff
+	PATCH_END
+};
+
 // WORKAROUND: Script needed, because of differences in our pathfinding
 // algorithm
 // When the guards kick Robin out of archery room 320 the game locks up due to
@@ -8368,6 +8389,7 @@ static const SciScriptPatcherEntry longbowSignatures[] = {
 	{  true,   450, "abbey map fix",                               1, longbowSignatureAbbeyMapFix,             longbowPatchAbbeyMapFix },
 	{  true,   490, "hedge maze music",                            1, longbowSignatureHedgeMazeMusic,          longbowPatchHedgeMazeMusic },
 	{  true,   530, "amiga pub fix",                               1, longbowSignatureAmigaPubFix,             longbowPatchAmigaPubFix },
+	{  true,   532, "pub party fix",                               1, longbowSignaturePubPartyFix,             longbowPatchPubPartyFix },
 	{  true,   600, "amiga fulk rescue fix",                       1, longbowSignatureAmigaFulkRescue,         longbowPatchAmigaFulkRescue },
 	{  true,   803, "amiga speed test",                            1, longbowSignatureAmigaSpeedTest,          longbowPatchAmigaSpeedTest },
 	{  true,   803, "disable speed test",                          1, sci01SpeedTestLocalSignature,            sci01SpeedTestLocalPatch },


Commit: b2de310cb5b8702a34410fb5679ca82732acd4f7
    https://github.com/scummvm/scummvm/commit/b2de310cb5b8702a34410fb5679ca82732acd4f7
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:19-07:00

Commit Message:
SCI32: Add entries for TORIN Italian and Portuguese

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index e85d6c12dc9..07b483fb8b7 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -6059,13 +6059,19 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		Common::ES_ESP, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_TORIN },
 
 	// from glorifindel
-	// TODO: Need to get ahold of italian/msg/0.msg from an Italian release
-//	{"torin", "", {
-//		{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
-//		{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
-//		// {"italian/msg/0.msg", 0, ?, ?},
-//		AD_LISTEND},
-//		Common::IT_ITA, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_TORIN },
+	{"torin", "", {
+		{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+		{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+		{"patches/0.msg", 0, "ef23a06ff97415e58fbbe25624738789", 6025},
+		AD_LISTEND},
+		Common::IT_ITA, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_TORIN },
+
+	{"torin", "", {
+		{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
+		{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
+		{"patches/0.msg", 0, "44f57dd333e77484002a90733005c2ae", 5690},
+		AD_LISTEND},
+		Common::PT_BRA, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_TORIN },
 
 	// fan made Hebrew translation, by "Hebrew Adventure" https://www.facebook.com/groups/200491360554968/
 	// distributed as zip package to be extracted over GOG.com version


Commit: 6c442f3ec9f290720b0fcacd27ab9a6720796089
    https://github.com/scummvm/scummvm/commit/6c442f3ec9f290720b0fcacd27ab9a6720796089
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:19-07:00

Commit Message:
WIN32: Fix CoInitialize / CoUninitialize imbalance

On Vista and earlier, Win32TaskbarManager called
CoUninitialize without calling CoInitialize

Changed paths:
    backends/taskbar/win32/win32-taskbar.cpp


diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp
index ad2f1891bdf..1d147343179 100644
--- a/backends/taskbar/win32/win32-taskbar.cpp
+++ b/backends/taskbar/win32/win32-taskbar.cpp
@@ -74,12 +74,12 @@
 const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 };
 
 Win32TaskbarManager::Win32TaskbarManager(SdlWindow_Win32 *window) : _window(window), _taskbar(nullptr), _count(0), _icon(nullptr) {
+	CoInitialize(nullptr);
+
 	// Do nothing if not running on Windows 7 or later
 	if (!Win32::confirmWindowsVersion(6, 1))
 		return;
 
-	CoInitialize(nullptr);
-
 	// Try creating instance (on fail, _taskbar will contain NULL)
 	HRESULT hr = CoCreateInstance(CLSID_TaskbarList,
 	                              nullptr,


Commit: 7ec97c47d7522c4eec35f01af500baf7177326e3
    https://github.com/scummvm/scummvm/commit/7ec97c47d7522c4eec35f01af500baf7177326e3
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:20-07:00

Commit Message:
SCI: Fix LONGBOW emerald lockup

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 07d99152465..df0472d964a 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8370,6 +8370,33 @@ static const uint16 longbowPatchMapPaletteSpeed[] = {
 	PATCH_END
 };
 
+// After rescuing Marian from the fire, closing message boxes too quickly causes
+//  the game to lockup when using the emerald in the next scene. This is a bug
+//  in room 179, the synopsis room that displays messages and awards points.
+//  synop:dispose calls kDisposeScript(806), but script 806 contains the sound
+//  object for the points sound effect. If a sound object is playing while its
+//  script is disposed then the global sounds collection enters an invalid state
+//  and sound cues no longer work.
+//
+// We fix this by patching out the call to kDisposeScript(806) in synop:dispose.
+//  This call is unnecessary because script 806 already unloads itself in every
+//  procedure, and also whenever specialSound:check finishes playing.
+//
+// Applies to: All versions
+// Responsible method: synop:dispose
+static const uint16 longbowSignatureEmeraldLockup[] = {
+	SIG_MAGICDWORD,
+	0x78,                           // push1
+	0x38, SIG_UINT16(0x0326),       // pushi 0326
+	0x43, 0x03, 0x02,               // callk DisposeScript [ DisposeScript 806 ]
+	SIG_END
+};
+
+static const uint16 longbowPatchEmeraldLockup[] = {
+	0x33, 0x05,                     // jmp 05 [ skip DisposeScript ]
+	PATCH_END
+};
+
 //          script, description,                                      signature                                patch
 static const SciScriptPatcherEntry longbowSignatures[] = {
 	{  true,    29, "amiga day 1 peasant woman",                   1, longbowSignatureAmigaPeasantWoman,       longbowPatchAmigaPeasantWoman},
@@ -8377,6 +8404,7 @@ static const SciScriptPatcherEntry longbowSignatures[] = {
 	{  true,   140, "green man riddles and forest sweep fix",      1, longbowSignatureGreenManForestSweepFix,  longbowPatchGreenManForestSweepFix },
 	{  true,   150, "day 5/6 camp sunset fix",                     2, longbowSignatureCampSunsetFix,           longbowPatchCampSunsetFix },
 	{  true,   150, "day 7 tuck net fix",                          1, longbowSignatureTuckNetFix,              longbowPatchTuckNetFix },
+	{  true,   179, "emerald lockup",                              1, longbowSignatureEmeraldLockup,           longbowPatchEmeraldLockup },
 	{  true,   210, "hand code crash",                             5, longbowSignatureShowHandCode,            longbowPatchShowHandCode },
 	{  true,   225, "arithmetic berry bush fix",                   1, longbowSignatureBerryBushFix,            longbowPatchBerryBushFix },
 	{  true,   250, "day 5/6 rescue flag fix",                     1, longbowSignatureRescueFlagFix,           longbowPatchRescueFlagFix },


Commit: 123b6f00b477b8fce3f732690f80afb370c2949f
    https://github.com/scummvm/scummvm/commit/123b6f00b477b8fce3f732690f80afb370c2949f
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:20-07:00

Commit Message:
SCI: Fix crash in script debugger

Stepping through an instruction that accesses an invalid property caused
an error. This code is only used by the disassembler when debugging, and
the disassembler already displays when a property is invalid.

Changed paths:
    engines/sci/engine/object.cpp
    engines/sci/engine/scriptdebug.cpp


diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index 2fdbb9118f0..9dac479ba95 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -222,8 +222,7 @@ int Object::propertyOffsetToId(SegManager *segMan, int propertyOffset) const {
 	int selectors = getVarCount();
 
 	if (propertyOffset < 0 || (propertyOffset >> 1) >= selectors) {
-		error("Applied propertyOffsetToId to invalid property offset %x (property #%d not in [0..%d])",
-		          propertyOffset, propertyOffset >> 1, selectors - 1);
+		// Scripts contain instructions with invalid properties
 		return -1;
 	}
 
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 16d1edb7cc7..e4ec0a88c23 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -316,8 +316,12 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
 			} else {
 				if (getSciVersion() == SCI_VERSION_3)
 					debugN("\t(%s)", g_sci->getKernel()->getSelectorName(param_value).c_str());
-				else
-					debugN("\t(%s)", g_sci->getKernel()->getSelectorName(obj->propertyOffsetToId(s->_segMan, param_value)).c_str());
+				else {
+					int propertySelector = obj->propertyOffsetToId(s->_segMan, param_value);
+					if (propertySelector != -1) {
+						debugN("\t(%s)", g_sci->getKernel()->getSelectorName(propertySelector).c_str());
+					}
+				}
 			}
 		}
 	}


Commit: 18a64a3bcaecaffcb8c6176c28cd0e4951f2f6f2
    https://github.com/scummvm/scummvm/commit/18a64a3bcaecaffcb8c6176c28cd0e4951f2f6f2
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:20-07:00

Commit Message:
SCI: Fix LSL5 Hollywood sign

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 df0472d964a..5f70e1870fb 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8832,9 +8832,39 @@ static const uint16 larry5PatchGermanEndingPattiTalker[] = {
 	PATCH_END
 };
 
+// The Hollywood sign in room 190 doesn't respond to clicks or display its
+//  messages. This is a script typo. The author attempted to initialize the
+//  `HollywoodSign` object, but typed the word `sign` instead. The compiler
+//  accepted this because `sign` is the name of a procedure in script 999.
+//  The `init` selector was interpreted as a non-existent property.
+//
+// We fix this by calling HollywoodSign:init instead of sign.
+//
+// Applies to: All versions
+// Responsible method: rm190:init
+static const uint16 larry5SignatureHollywoodSign[] = {
+	0x78,                               // push1
+	0x66, SIG_ADDTOOFFSET(+2),          // pTos ????
+	SIG_MAGICDWORD,
+	0x46, SIG_UINT16(0x03e7),           // calle proc999_0 [ sign(????) ]
+	      SIG_UINT16(0x0000), 0x02,
+	SIG_ADDTOOFFSET(+3),
+	0x72,                               // lofsa tree [ 0x40 bytes before HollywoodSign ]
+	SIG_END
+};
+
+static const uint16 larry5PatchHollywoodSign[] = {
+	0x38, PATCH_SELECTOR16(init),       // pushi init
+	0x39, 0x00,                         // pushi 00
+	0x72, PATCH_GETORIGINALUINT16ADJUST(+14, +0x40), // lofsa HollywoodSign
+	0x4a, 0x04,                         // send 04 [ HollywoodSign init: ]
+	PATCH_END
+};
+
 //          script, description,                                      signature                               patch
 static const SciScriptPatcherEntry larry5Signatures[] = {
 	{  true,     0, "update stopGroop client",                     1, larry5SignatureUpdateStopGroopClient,   larry5PatchUpdateStopGroopClient },
+	{  true,   190, "hollywood sign",                              1, larry5SignatureHollywoodSign,           larry5PatchHollywoodSign },
 	{  true,   280, "English-only: fix green card limo bug",       1, larry5SignatureGreenCardLimoBug,        larry5PatchGreenCardLimoBug },
 	{  true,   380, "German-only: Enlarge Patti Textbox",          1, larry5SignatureGermanEndingPattiTalker, larry5PatchGermanEndingPattiTalker },
 	SCI_SIGNATUREENTRY_TERMINATOR


Commit: 4a40ac92ea3d7d6efe76583b91b2769463c8f8db
    https://github.com/scummvm/scummvm/commit/4a40ac92ea3d7d6efe76583b91b2769463c8f8db
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:20-07:00

Commit Message:
SCI: Fix LSL5 warnings when printing messages

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 5f70e1870fb..bfecb538997 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8861,9 +8861,37 @@ static const uint16 larry5PatchHollywoodSign[] = {
 	PATCH_END
 };
 
+// LSL5's TPrint procedure causes an uninitialized parameter read when printing
+//  messages. This generates many warnings throughout the game. Ideally, we
+//  could suppress these with the workarounds table, but it would take several
+//  entries and bytecode signatures due to all of the callers and versions.
+//  Instead, it can be fixed in all versions with one small script patch.
+//
+// We fix this by removing the uninitialized parameter from TPrint's Print call
+//  and increasing the size of the &rest parameter. TPrint's second parameter is
+//  now only passed to Print when it exists.
+//
+// Applies to: All versions
+// Responsible method: Export 14 in script 0 (TPrint)
+static const uint16 larry5SignatureHTPrintUninitParameter[] = {
+	SIG_MAGICDWORD,
+	0x8f, 0x02,                         // lsp 02 [ often non-existent ]
+	0x59, 0x03,                         // &rest 03
+	0x47, 0xff, 0x00, 0x08,             // calle proc255_0 [ Print ... param2 &rest ]
+	SIG_END
+};
+
+static const uint16 larry5PatchTPrintUninitParameter[] = {
+	0x33, 0x00,                         // jmp 00
+	0x59, 0x02,                         // &rest 02
+	0x47, 0xff, 0x00, 0x06,             // calle proc225_0 [ Print ... &rest ]
+	PATCH_END
+};
+
 //          script, description,                                      signature                               patch
 static const SciScriptPatcherEntry larry5Signatures[] = {
 	{  true,     0, "update stopGroop client",                     1, larry5SignatureUpdateStopGroopClient,   larry5PatchUpdateStopGroopClient },
+	{  true,     0, "TPrint uninit parameter",                     1, larry5SignatureHTPrintUninitParameter,  larry5PatchTPrintUninitParameter },
 	{  true,   190, "hollywood sign",                              1, larry5SignatureHollywoodSign,           larry5PatchHollywoodSign },
 	{  true,   280, "English-only: fix green card limo bug",       1, larry5SignatureGreenCardLimoBug,        larry5PatchGreenCardLimoBug },
 	{  true,   380, "German-only: Enlarge Patti Textbox",          1, larry5SignatureGermanEndingPattiTalker, larry5PatchGermanEndingPattiTalker },


Commit: e5d307dc41576a15bf7be73261608f491aa6d0e3
    https://github.com/scummvm/scummvm/commit/e5d307dc41576a15bf7be73261608f491aa6d0e3
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:21-07:00

Commit Message:
SCI32: Show all PHANT1 saves on delete screen

Fixes a script bug that crashes when all 10 saves are in
the chapter 7 chase, and makes saves easier to manage.

Fixes bug #14361

Thanks to @darkshoxx for reporting this!

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 bfecb538997..60f66b0e49d 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -11908,6 +11908,52 @@ static const uint16 phant1CopyChaseFilePatch[] = {
 	PATCH_END
 };
 
+// Clicking "Start New Game" when all 10 saves are in the chapter 7 chase
+//  crashes the game. Room 901 is supposed to prompt the player to delete one of
+//  their saves first, but in delete mode this room only shows regular saves,
+//  not chase saves. If all of the saves are chase saves then the screen is
+//  unexpectedly empty, and it crashes when trying to select a default icon.
+//
+// We fix this by showing all saves when in delete mode. This fixes the obscure
+//  bug and makes it easier to manage saves. Room 91 sets flag 152 when there
+//  are 10 saves to put room 901 in delete mode. Now that flag is tested before
+//  the save type to determine if a save should be displayed.
+//
+// Applies to: All versions
+// Responsible method: selectGameRoom:init
+// Fixes bug: #14361
+static const uint16 phant1DeleteSaveSignature[] = {
+	SIG_MAGICDWORD,
+	0x31, 0x06,                     // bnt 06
+	0x35, 0x00,                     // ldi 00
+	0xa5, 0x02,                     // sat 02 [ temp2 = 0, redundant ]
+	0x33, SIG_ADDTOOFFSET(+1),      // jmp    [ exit cond ]
+	SIG_ADDTOOFFSET(+7),
+	0x31, 0x17,                     // bnt 17
+	SIG_ADDTOOFFSET(+11),
+	0x36,                           // push
+	0x35, 0x02,                     // ldi 02
+	0x12,                           // and
+	0x31, 0x06,                     // bnt 06
+	0x35, 0x01,                     // ldi 01
+	SIG_END
+};
+
+static const uint16 phant1DeleteSavePatch[] = {
+	0x2f, PATCH_GETORIGINALBYTEADJUST(7, +6), // bt [ exit cond ]
+	0x78,                                     // push1
+	0x38, PATCH_UINT16(0x0098),               // pushi 0098
+	0x45, 0x03, PATCH_UINT16(0x0002),         // callb proc0_3 [ is flag 152 set? ]
+	0xa5, 0x02,                               // sat 02 [ show save in delete mode ]
+	PATCH_GETORIGINALBYTES(8, 7),
+	0x31, 0x1d,                               // bnt 1d
+	PATCH_GETORIGINALBYTES(17, 11),
+	0x7a,                                     // push2
+	0x12,                                     // and
+	0x31, 0x04,                               // bnt 04
+	PATCH_END
+};
+
 // During the chase, the west exit in room 46980 has incorrect logic which kills
 //  the player if they went to the crypt with the crucifix, among other bugs.
 //
@@ -12079,6 +12125,7 @@ static const SciScriptPatcherEntry phantasmagoriaSignatures[] = {
 	{  true,    26, "fix video 2020 censorship",                   1, phant1Video2020CensorSignature,  phant1Video2020CensorPatch },
 	{  true,    33, "disable video benchmarking",                  1, sci2BenchmarkSignature,          sci2BenchmarkPatch },
 	{  true,   901, "fix invalid array construction",              1, sci21IntArraySignature,          sci21IntArrayPatch },
+	{  true,   901, "fix delete save",                             1, phant1DeleteSaveSignature,       phant1DeleteSavePatch },
 	{  true,  1111, "ignore audio settings from save game",        1, phant1SavedVolumeSignature,      phant1SavedVolumePatch },
 	{  true, 20200, "fix broken rat init in sEnterFromAlcove",     1, phant1RatSignature,              phant1RatPatch },
 	{  true, 20200, "fix chapter 5 wine cask hotspot",             1, phant1WineCaskHotspotSignature,  phant1WineCaskHotspotPatch },


Commit: f87f0cb4626ee1becd903f3939a000c85d8a1f24
    https://github.com/scummvm/scummvm/commit/f87f0cb4626ee1becd903f3939a000c85d8a1f24
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:21-07:00

Commit Message:
SCI: Add detection and workaround for SQ1 Demo variant

Thanks to @einstein95 for finding this

Changed paths:
    engines/sci/detection_tables.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/workarounds.cpp
    engines/sci/engine/workarounds.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 07b483fb8b7..adcb322cc59 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -5314,6 +5314,15 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO_STD16_MAC_HIRESFONTS },
 
+	// Space Quest 1 VGA Remake - English Non-Interactive Demo
+	// Earlier version of demo, doesn't include view patch files for musicians
+	// SCI interpreter version 1.000.181
+	{"sq1sci", "SCI/Demo", {
+		{"resource.map", 0, "3ff264347ca7b3335144bddc1f3a76ac", 642},
+		{"resource.001", 0, "fd99ea43f57576ded7c86036996346cf", 549177},
+		AD_LISTEND},
+		Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO_STD16	},
+
 	// Space Quest 1 VGA Remake - English Non-Interactive Demo (from FRG)
 	// SCI interpreter version 1.000.181
 	{"sq1sci", "SCI/Demo", {
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index d1279af53cc..0119ea4a496 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -855,7 +855,7 @@ static SciKernelMapEntry s_kernelMap[] = {
 	{ MAP_CALL(UnLoad),            SIG_EVERYWHERE,           "i[ir!]",                NULL,            kUnLoad_workarounds },
 	// ^ We allow invalid references here (e.g. bug #6600), since they will be invalidated anyway by the call itself
 	{ MAP_CALL(ValidPath),         SIG_EVERYWHERE,           "r",                     NULL,            NULL },
-	{ MAP_CALL(Wait),              SIG_SCI16, SIGFOR_ALL,    "i",                     NULL,            NULL },
+	{ MAP_CALL(Wait),              SIG_SCI16, SIGFOR_ALL,    "i",                     NULL,            kWait_workarounds },
 
 	// Unimplemented SCI0-SCI1.1 unused functions, always mapped to kDummy
 	{ MAP_DUMMY(InspectObj),      SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 47c1087edf0..442fbaae9db 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -1138,6 +1138,12 @@ const SciWorkaroundEntry kUnLoad_workarounds[] = {
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
+//    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
+const SciWorkaroundEntry kWait_workarounds[] = {
+	{ GID_SQ1,             1,     1,  0,              "demo1", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE, 0 } }, // DEMO: calls kWait with no parameters
+	SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
 //    gameID,           room,script,lvl,          object-name, method-name,  local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kScrollWindowAdd_workarounds[] = {
 	{ GID_PHANTASMAGORIA, 45, 64907,  0,   "ScrollableWindow", "addString",               nullptr,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // ScrollWindow interface passes the last two parameters twice
diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h
index 8951d2c15a8..5821051a756 100644
--- a/engines/sci/engine/workarounds.h
+++ b/engines/sci/engine/workarounds.h
@@ -109,6 +109,7 @@ extern const SciWorkaroundEntry kStrAt_workarounds[];
 extern const SciWorkaroundEntry kStrCpy_workarounds[];
 extern const SciWorkaroundEntry kStrLen_workarounds[];
 extern const SciWorkaroundEntry kUnLoad_workarounds[];
+extern const SciWorkaroundEntry kWait_workarounds[];
 extern const SciWorkaroundEntry kStringNew_workarounds[];
 extern const SciWorkaroundEntry kScrollWindowAdd_workarounds[];
 


Commit: 6cba5e358000f26a8f643979bd638d33d4ff5351
    https://github.com/scummvm/scummvm/commit/6cba5e358000f26a8f643979bd638d33d4ff5351
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:21-07:00

Commit Message:
SCI: Add detection for KQ5 and LSL1 EGA Spanish

Thanks to @einstein95 for finding these

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index adcb322cc59..e24dfcc39a6 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1962,6 +1962,23 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16	},
 
+	// King's Quest 5 DOS Spanish Floppy EGA
+	// Game version 0.000.133 from about box, 1.000 from VERSION file
+	// SCI interpreter version 1.000.575
+	{"kq5", "EGA", {
+		{"resource.map", 0, "0dedf9d810ef864cbcc2370edaf19448", 8040},
+		{"resource.000", 0, "9091979bbdbe9e40b4ff952677bf4d4b", 451270},
+		{"resource.001", 0, "dd692513f878279fbf07d715dd6ddad6", 571171},
+		{"resource.002", 0, "79347fba1de905023dc1549e9676e53b", 618015},
+		{"resource.003", 0, "027f96c38d52276906e67304d9aaf92e", 495375},
+		{"resource.004", 0, "23af8904376aa72ec45b9936be2d8280", 632343},
+		{"resource.005", 0, "4a713d8aa31b74529515ea1edd3466ad", 679888},
+		{"resource.006", 0, "2b54e0487820b79fcc62b72756344555", 677261},
+		{"resource.007", 0, "3cedf14dff9514409508f394ddbc35e8", 552191},
+		{"resource.008", 0, "bae4e3022fd09c5cd751e0945f083983", 609429},
+		AD_LISTEND},
+		Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16	},
+
 	// King's Quest 5 DOS Spanish Floppy VGA (3.5" disks)
 	// Game version 0.000.162 from about box, 1.000 from VERSION file
 	// SCI interpreter version 1.000.784
@@ -2874,6 +2891,17 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND},
 		Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16	},
 
+	// Larry 1 EGA Remake - Spanish DOS
+	// Executable scanning reports "1.SQ4.056", VERSION file reports "1.000"
+	{"lsl1sci", "SCI/EGA", {
+		{"resource.map", 0, "c07cf88e6c69a432f1d11f660faa996a", 3333},
+		{"resource.000", 0, "5e501a9bf8c753bf4c96158042422f00", 502971},
+		{"resource.001", 0, "112648995dbc194037f1e4ed2e195910", 610960},
+		{"resource.002", 0, "3fe2a3aec0ed53c7d6db1845a67e3aa2", 518218},
+		{"resource.003", 0, "2b21fab32a5f49ff871b3ff696d51214", 578780},
+		AD_LISTEND},
+		Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16	},
+
 	// Larry 1 VGA Remake - Russian DOS (also includes english language?!)
 	// Executable scanning reports "1.000.510", VERSION file reports "2.0"
 	// SCI interpreter version 1.000.510


Commit: fdf556e86bb945e40c1cc7503ea2c9a54f1261f5
    https://github.com/scummvm/scummvm/commit/fdf556e86bb945e40c1cc7503ea2c9a54f1261f5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:21-07:00

Commit Message:
SCI32: Fix PHANT1 basement fast-forward lockup

Fixes bug #14368

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 60f66b0e49d..9f72f56b7c9 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -11723,6 +11723,51 @@ static const uint16 phant1RatPatch[] = {
 	PATCH_END
 };
 
+// In the basement there is a moment where clicking the fast-forward button
+//  locks up the game. Fast-forward changes the current room script to state
+//  zero and sets global 115. Most scripts' changeState methods start by testing
+//  this global to implement fast-forward behavior. They then reset the global
+//  when disposing before calling handsOn. scaryHandsOnCode:doit enables input,
+//  empties the event queue, and then polls and processes one final event.
+//  This creates a window where handsOn can process a fast-forward click and
+//  re-enter the room script while it's in the middle of disposing itself.
+//
+// Most room scripts have a structure that survives this re-entrancy, but room
+//  20100's sEnterFrom20200 is unusual. It doesn't test the fast-forward global
+//  in state zero. Instead, it unconditionally calls handsOff, causing the
+//  original handsOn call to undo its work before it returns.
+//
+// We fix this by swapping two function calls in sEnterFrom20200:dispose:
+//  handsOn and super:dispose. Now the script is fully disposed before handsOn.
+//  If a fast-forward click occurs it will no longer have any effect, because
+//  the room no longer has a script. If other scripts are discovered with this
+//  same problem, this patch will probably apply.
+//
+// Applies to: All versions
+// Responsible method: sEnterFrom20200:dispose
+// Fixes bug: #14368
+static const uint16 phant1BasementFastForwardSignature[] = {
+	0x35, 0x00,                     // ldi 00
+	0xa1, SIG_MAGICDWORD, 0x73,     // lag 73 [ fast-forward = 0 ]
+	0x38, SIG_SELECTOR16(handsOn),  // pushi handsOn
+	0x76,                           // push0
+	0x81, 0x01,                     // lag 01
+	0x4a, SIG_UINT16(0x0004),       // send 04 [ Scary handsOn: ]
+	0x38, SIG_SELECTOR16(dispose),  // pushi dispose
+	0x76,                           // push0
+	0x59, 0x01,                     // &rest 01
+	0x57, SIG_ADDTOOFFSET(+1),      // super 04 [ super dispose: &rest ]
+	      SIG_UINT16(0x0004),
+	SIG_END
+};
+
+static const uint16 phant1BasementFastForwardPatch[] = {
+	PATCH_ADDTOOFFSET(+4),          // [ fast-forward = 0 ]
+	PATCH_GETORIGINALBYTES(13, 10), // [ super dispose: &rest ]
+	PATCH_GETORIGINALBYTES(4, 9),   // [ Scary handsOn: ]
+	PATCH_END
+};
+
 // In Phantasmagoria the cursor's hover state will not trigger on any of the
 // buttons in the main menu after returning to the main menu from a game, or
 // when choosing "Quit" on the main menu and then cancelling the quit in the
@@ -12127,6 +12172,7 @@ static const SciScriptPatcherEntry phantasmagoriaSignatures[] = {
 	{  true,   901, "fix invalid array construction",              1, sci21IntArraySignature,          sci21IntArrayPatch },
 	{  true,   901, "fix delete save",                             1, phant1DeleteSaveSignature,       phant1DeleteSavePatch },
 	{  true,  1111, "ignore audio settings from save game",        1, phant1SavedVolumeSignature,      phant1SavedVolumePatch },
+	{  true, 20100, "fix basement fast-forward",                   1, phant1BasementFastForwardSignature, phant1BasementFastForwardPatch },
 	{  true, 20200, "fix broken rat init in sEnterFromAlcove",     1, phant1RatSignature,              phant1RatPatch },
 	{  true, 20200, "fix chapter 5 wine cask hotspot",             1, phant1WineCaskHotspotSignature,  phant1WineCaskHotspotPatch },
 	{  true, 45950, "fix chase file deletion",                     1, phant1DeleteChaseFileSignature,  phant1DeleteChaseFilePatch },


Commit: f5d337193523adf3831a62c20b4820f4114bf709
    https://github.com/scummvm/scummvm/commit/f5d337193523adf3831a62c20b4820f4114bf709
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:22-07:00

Commit Message:
SCI: Add detection for KQ4 1.003.006 360k disks

Thanks to @digitoxin1

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index e24dfcc39a6..1be219213fb 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1658,6 +1658,23 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND },
 		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
 
+	// King's Quest 4 - English DOS (5 1/4" disks)
+	// Game version 1.003.006
+	// SCI interpreter version 0.000.409
+	// Released: January 24, 1989 (Information from QAFILE file)
+	{"kq4sci", "SCI", {
+		{"resource.map", 0, "5051546e5f87aa6103289c8001a94234", 9240},
+		{"resource.001", 0, "91a2aebafb234c486744bd69b145ac43", 184255},
+		{"resource.002", 0, "91a2aebafb234c486744bd69b145ac43", 338296},
+		{"resource.003", 0, "91a2aebafb234c486744bd69b145ac43", 334522},
+		{"resource.004", 0, "91a2aebafb234c486744bd69b145ac43", 310026},
+		{"resource.005", 0, "91a2aebafb234c486744bd69b145ac43", 282391},
+		{"resource.006", 0, "91a2aebafb234c486744bd69b145ac43", 323541},
+		{"resource.007", 0, "91a2aebafb234c486744bd69b145ac43", 333089},
+		{"resource.008", 0, "91a2aebafb234c486744bd69b145ac43", 272995},
+		AD_LISTEND},
+		Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER	},
+
 	// King's Quest 4 - English DOS (3 1/2" disks)
 	// Game version 1.003.006
 	// SCI interpreter version 0.000.409


Commit: 7d3a90e8d7262039e5194e2ba5e15f0c48ca35ee
    https://github.com/scummvm/scummvm/commit/7d3a90e8d7262039e5194e2ba5e15f0c48ca35ee
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:22-07:00

Commit Message:
SCI: Fix LB2 dinosaur bone verb handler

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 9f72f56b7c9..2ff6f5f6074 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -11006,6 +11006,28 @@ static const uint16 laurabow2CDPatchFixBugsWithMeat[] = {
 	PATCH_END
 };
 
+// The dinosaur bone in room 480 has a broken verb handler. Clicking on the bone
+//  itself doesn't work, instead the player has to click on the surrounding area
+//  to look at it or pick it up. bone:doVerb calls dinoBones:doVerb but doesn't
+//  pass the verb parameter. We fix this by increasing the &rest parameter.
+//  
+// Applies to: All versions
+// Responsible method: bone:doVerb
+static const uint16 laurabow2SignatureFixDinosaurBone[] = {
+	SIG_MAGICDWORD,
+	0x76,                               // push0
+	0x59, 0x02,                         // &rest 02 [ excludes verb parameter ]
+	0x72, SIG_ADDTOOFFSET(+2),          // lofsa dinoBones
+	0x4a, 0x04,                         // send 04 [ dinoBones doVerb: &rest ]
+	SIG_END
+};
+
+static const uint16 laurabow2PatchFixDinosaurBone[] = {
+	0x76,                               // push0
+	0x59, 0x01,                         // &rest 01 [ includes verb parameter ]
+	PATCH_END
+};
+
 // LB2 CD ends act 5 in the middle of the finale music instead of waiting for
 //  it to complete. This is a script bug and occurs in Sierra's interpreter.
 //
@@ -11342,6 +11364,7 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
 	{  true,   454, "CD/Floppy: fix coffin lockup 2/2",               1, laurabow2SignatureMummyCoffinLid2,              laurabow2PatchMummyCoffinLid2 },
 	{  true,   454, "CD: fix coffin closing cel",                     1, laurabow2CDSignatureMummyCoffinClosingCel,      laurabow2CDPatchMummyCoffinClosingCel },
 	{  true,   460, "CD/Floppy: fix crate room east door lockup",     1, laurabow2SignatureFixCrateRoomEastDoorLockup,   laurabow2PatchFixCrateRoomEastDoorLockup },
+	{  true,   480, "CD/Floppy: fix dinosaur bone",                   1, laurabow2SignatureFixDinosaurBone,              laurabow2PatchFixDinosaurBone },
 	{ false,   500, "CD: fix museum actor loops",                     3, laurabow2CDSignatureFixMuseumActorLoops1,       laurabow2CDPatchFixMuseumActorLoops1 },
 	{  true,  2660, "CD/Floppy: fix elevator lockup",                 1, laurabow2SignatureFixElevatorLockup,            laurabow2PatchFixElevatorLockup },
 	{  true,   520, "CD/Floppy: act 5 trigger",                       1, laurabow2SignatureAct5Trigger,                  laurabow2PatchAct5Trigger },


Commit: b14fa3dd856d7e3be359001c4be4a9f9cc046c77
    https://github.com/scummvm/scummvm/commit/b14fa3dd856d7e3be359001c4be4a9f9cc046c77
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:22-07:00

Commit Message:
SCI: Fix LB2 debugger dialog

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


diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 442fbaae9db..2918e2f4dc7 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -1341,6 +1341,8 @@ static const SciMessageWorkaroundEntry messageWorkarounds[] = {
 	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_GERMAN,   -1, 1892,   1,   6,   3,  1, { MSG_WORKAROUND_EXTRACT, 1892,   1,   6,   3,  1, 25,   0, 249, nullptr } },
 	// Asking Ramses about snake oil in German version. Same as above: excessive trailing newlines.
 	{ GID_LAURABOW2,     SCI_MEDIA_FLOPPY, K_LANG_GERMAN,   -1, 1891,   1,   6,  41,  1, { MSG_WORKAROUND_EXTRACT, 1891,   1,   6,  41,  1, 27,   0, 146, nullptr } },
+	// Using the game's debugger and clicking "Museum", wrong resource number for "T. Rex Room"
+	{ GID_LAURABOW2,     SCI_MEDIA_ALL,    K_LANG_NONE,     29,    0,   2,   0,   0, 16, { MSG_WORKAROUND_REMAP,     10,   2,   0,   0, 16, 97,   0,   0, nullptr } },
 	// Using the hand icon on Keith in the Blue Room (missing message) - bug #6253
 	{ GID_PQ1,           SCI_MEDIA_ALL,    K_LANG_NONE,     -1,   38,  10,   4,   8,  1, { MSG_WORKAROUND_REMAP,     38,  10,   4,   9,  1,  0,   0,   0, nullptr } },
 	// Using the eye icon on Keith in the Blue Room (no message and wrong talker) - bug #6253


Commit: e86a6dae47e35faf5a3cce2d8476d95086f99773
    https://github.com/scummvm/scummvm/commit/e86a6dae47e35faf5a3cce2d8476d95086f99773
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:23-07:00

Commit Message:
SCI: Fix QFG2 visa crash

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 2ff6f5f6074..54fa40071fe 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -14992,9 +14992,39 @@ static const uint16 qfg2PatchImportCharType[] = {
 	PATCH_END
 };
 
+// On day 27, approaching the Emir's palace at night without a visa crashes with
+//  a missing text error. The script is missing the first boolean parameter to
+//  the game-over procedure, causing the other parameters to be misinterpreted
+//  as text resource numbers.
+//
+// We fix this by adding the missing parameter, just like script 380's version.
+//
+// Applies to: All versions
+// Responsible method: backToInn:changeState(6)
+static const uint16 qfg2SignatureVisaCrash[] = {
+	0x39, SIG_MAGICDWORD, 0x04,        // pushi 04
+	0x38, SIG_UINT16(0x0191),          // pushi 0191
+	0x39, 0x12,                        // pushi 12
+	0x39, SIG_ADDTOOFFSET(+1),         // pushi title
+	0x72, SIG_ADDTOOFFSET(+2),         // lofsa "...Get a visa"
+	0x36,                              // push
+	0x47, 0x01, 0x18, 0x08,            // calle proc1_24 [ game-over, missing first parameter ]
+	SIG_END
+};
+
+static const uint16 qfg2PatchVisaCrash[] = {
+	0x39, 0x05,                        // pushi 05
+	0x78,                              // push1
+	PATCH_GETORIGINALBYTES(2, 7),
+	0x74, PATCH_GETORIGINALUINT16ADJUST(10, -1), // lofss "...Get a visa"
+	0x47, 0x01, 0x18, 0x0a,            // calle proc1_24 [ game-over ]
+	PATCH_END
+};
+
 //          script, description,                                      signature                       patch
 static const SciScriptPatcherEntry qfg2Signatures[] = {
 	{  true,    98, "disable speed test",                          1, sci01SpeedTestGlobalSignature,  sci01SpeedTestGlobalPatch },
+	{  true,   401, "visa crash",                                  1, qfg2SignatureVisaCrash,         qfg2PatchVisaCrash },
 	{  true,   665, "getting back on saurus freeze fix",           1, qfg2SignatureSaurusFreeze,      qfg2PatchSaurusFreeze },
 	{  true,   695, "Oops Jackalmen fix",                          1, qfg2SignatureOopsJackalMen,     qfg2PatchOopsJackalMen },
 	{  true,   805, "import character type fix",                   1, qfg2SignatureImportCharType,    qfg2PatchImportCharType },


Commit: d018c7863fdb117edbdd52ce3cd056b0e89008ee
    https://github.com/scummvm/scummvm/commit/d018c7863fdb117edbdd52ce3cd056b0e89008ee
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:23-07:00

Commit Message:
SCI: Update LSL1 elevator polygon patch

The patch is now only applied to versions with the script bug

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 54fa40071fe..ef022e9b902 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -8429,13 +8429,14 @@ static const SciScriptPatcherEntry longbowSignatures[] = {
 
 // Pushing the penthouse elevator button in room 350 causes a broken polygon to
 //  be used for pathfinding. openObstacle:points is set to a local array of 17
-//  points but its size property is incorrectly set to 19. We fix the size so
-//  that the interpreter doesn't use the wrong values for pathfinding.
+//  points but its size property is incorrectly set to 19. In the first version
+//  of the game this was correct, but the array was changed without updating the
+//  size value. We fix the size so that the interpreter doesn't use the wrong
+//  values for pathfinding.
 //
-// Applies to: All versions
+// Applies to: All versions except 2.0 VGA
 // Responsible method: rm350:init
 static const uint16 larry1SignatureElevatorPolygon[] = {
-	SIG_MAGICDWORD,
 	0x5b, 0x02, 0x1f,                // lea 02 1f
 	0x36,                            // push
 	0x39, SIG_SELECTOR8(size),       // pushi size
@@ -8443,6 +8444,10 @@ static const uint16 larry1SignatureElevatorPolygon[] = {
 	0x39, 0x13,                      // pushi 13 [ incorrect size ]
 	0x72, SIG_ADDTOOFFSET(+2),       // lofsa openObstacle
 	0x4a, 0x0c,                      // send 0c [ openObstacle points: @local31 size: 19 ]
+	SIG_ADDTOOFFSET(+2),
+	SIG_MAGICDWORD,
+	0x78,                            // push1
+	0x5b, 0x02, 0x41,                // lea 02 41 [ 41 in broken versions, otherwise 45 ]
 	SIG_END
 };
 


Commit: 06ee2994099539b394360c116a143eedd78b1cca
    https://github.com/scummvm/scummvm/commit/06ee2994099539b394360c116a143eedd78b1cca
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:23-07:00

Commit Message:
SCI: Use kMoveCursor in ECO1 Demo

Fixes crash when pressing tab or arrow keys on demo dialog

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


diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 073447e5aa8..e25b0bc8bfc 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -783,12 +783,15 @@ void Kernel::loadKernelNames(GameFeatures *features) {
 			_kernelNames[0x89] = "KawaHacks";
 		}
 
-		_kernelNames[0x71] = "PalVary";
-
-		// At least EcoQuest 1 demo uses kGetMessage instead of kMessage.
-		// Detect which function to use.
-		if (features->detectMessageFunctionType() == SCI_VERSION_1_1)
+		// EcoQuest 1 demo uses kGetMessage and kMoveCursor (SCI_VERSION_1_LATE)
+		// instead of kMessage and kPalVary (SCI_VERSION_1_1).
+		// Detect which functions to use from message resource version.
+		if (features->detectMessageFunctionType() == SCI_VERSION_1_1) {
+			_kernelNames[0x71] = "PalVary";
 			_kernelNames[0x7c] = "Message";
+		} else {
+			_kernelNames[0x71] = "MoveCursor";
+		}
 		break;
 
 #ifdef ENABLE_SCI32


Commit: 69fcf6bf2b478e0e82b0cda4ee0097a2be59a7f4
    https://github.com/scummvm/scummvm/commit/69fcf6bf2b478e0e82b0cda4ee0097a2be59a7f4
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:23-07:00

Commit Message:
SCI: Add `locals` console debugger command

Allows viewing and editing local variables in any loaded script.

This is different from `vm_vars` because vm_vars only operates
on variables in the current execution context.

Changed paths:
    engines/sci/console.cpp
    engines/sci/console.h


diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index f18525f2b23..e277debeca3 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -245,6 +245,8 @@ Console::Console(SciEngine *engine) : GUI::Debugger(),
 	registerCmd("vm_vars",			WRAP_METHOD(Console, cmdVMVars));
 	registerCmd("vmvars",				WRAP_METHOD(Console, cmdVMVars));					// alias
 	registerCmd("vv",					WRAP_METHOD(Console, cmdVMVars));					// alias
+	registerCmd("locals",				WRAP_METHOD(Console, cmdLocalVars));
+	registerCmd("l",					WRAP_METHOD(Console, cmdLocalVars));				// alias
 	registerCmd("stack",				WRAP_METHOD(Console, cmdStack));
 	registerCmd("st",					WRAP_METHOD(Console, cmdStack));					// alias
 	registerCmd("value_type",			WRAP_METHOD(Console, cmdValueType));
@@ -452,6 +454,7 @@ bool Console::cmdHelp(int argc, const char **argv) {
 	debugPrintf(" script_said - Shows all said - strings inside a specified script\n");
 	debugPrintf(" vm_varlist / vmvarlist / vl - Shows the addresses of variables in the VM\n");
 	debugPrintf(" vm_vars / vmvars / vv - Displays or changes variables in the VM\n");
+	debugPrintf(" locals / l - Displays or changes local variables in the VM\n");
 	debugPrintf(" stack / st - Lists the specified number of stack elements\n");
 	debugPrintf(" value_type - Determines the type of a value\n");
 	debugPrintf(" view_listnode - Examines the list node at the given address\n");
@@ -2979,6 +2982,71 @@ bool Console::cmdVMVars(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdLocalVars(int argc, const char **argv) {
+	if (!(2 <= argc && argc <= 4)) {
+		debugPrintf("Displays or changes local variables in the VM\n");
+		debugPrintf("Usage: %s <script> <varnum> [<value>]\n", argv[0]);
+		return true;
+	}
+
+	int scriptNumber;
+	if (!parseInteger(argv[1], scriptNumber) || scriptNumber < 0) {
+		debugPrintf("Invalid script: %s\n", argv[1]);
+		return true;
+	}
+
+	// search segment table for script locals
+	Common::Array<reg_t> *locals = nullptr;
+	for (uint i = 0; i < _engine->_gamestate->_segMan->_heap.size(); i++) {
+		SegmentObj *segmentObj = _engine->_gamestate->_segMan->_heap[i];
+		if (segmentObj != nullptr && segmentObj->getType() == SEG_TYPE_LOCALS) {
+			LocalVariables *localVariables = (LocalVariables *)segmentObj;
+			if (localVariables->script_id == scriptNumber) {
+				locals = &localVariables->_locals;
+				break;
+			}
+		}
+	}
+	if (locals == nullptr) {
+		debugPrintf("No locals for script: %d\n", scriptNumber);
+		return true;
+	}
+
+	int varIndex = -1;
+	if (argc >= 3) {
+		if (!parseInteger(argv[2], varIndex) || varIndex < 0) {
+			debugPrintf("Variable number may not be negative\n");
+			return true;
+		}
+		if (varIndex >= (int)locals->size()) {
+			debugPrintf("Maximum variable number for this type is %d (0x%x)\n", locals->size(), locals->size());
+			return true;
+		}
+	}
+
+	if (argc <= 3) {
+		// print script local(s)
+		for (uint i = 0; i < locals->size(); i++) {
+			if (varIndex == -1 || varIndex == (int)i) {
+				reg_t value = (*locals)[i];
+				debugPrintf("local var %d == %04x:%04x", i, PRINT_REG(value));
+				printBasicVarInfo(value);
+				debugPrintf("\n");
+			}
+		}
+	} else {
+		// change script local
+		reg_t *value = &(*locals)[varIndex];
+		if (parse_reg_t(_engine->_gamestate, argv[3], value)) {
+			debugPrintf("Invalid value/address passed.\n");
+			debugPrintf("Check the \"addresses\" command on how to use addresses\n");
+			debugPrintf("Or pass a decimal or hexadecimal value directly (e.g. 12, 1Ah)\n");
+		}
+	}
+
+	return true;
+}
+
 bool Console::cmdStack(int argc, const char **argv) {
 	if (argc != 2) {
 		debugPrintf("Lists the specified number of stack elements.\n");
diff --git a/engines/sci/console.h b/engines/sci/console.h
index 918be2799a5..72585badf9e 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -167,6 +167,7 @@ private:
 	bool cmdScriptSaid(int argc, const char **argv);
 	bool cmdVMVarlist(int argc, const char **argv);
 	bool cmdVMVars(int argc, const char **argv);
+	bool cmdLocalVars(int argc, const char **argv);
 	bool cmdStack(int argc, const char **argv);
 	bool cmdValueType(int argc, const char **argv);
 	bool cmdViewListNode(int argc, const char **argv);


Commit: d31ef39bcb024194f8d83304e3d481762abf490e
    https://github.com/scummvm/scummvm/commit/d31ef39bcb024194f8d83304e3d481762abf490e
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-06-29T11:31:24-07:00

Commit Message:
SCI32: Add compatibility with GK1 CD Italian fan translation

Fixes errors when displaying text and using the Walkman.

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


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index ef022e9b902..1fa3084f724 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4079,6 +4079,34 @@ static const uint16 gk1EndGameFontPatch[] = {
 	PATCH_END
 };
 
+// The Italian fan translation by Enrico Rolfi replaced GK1CD's SCI2 interpreter
+//  with an SCI2.1 version from a different game. This changed the kernel table.
+//  The GK1 scripts were altered to match. ScummVM provides GK1 with the SCI2
+//  table it expects, so these scripts are incompatible. Fortunately, only one
+//  kernel function is affected. kDisposeTextBitmap only appears in SCI2, so its
+//  calls were replaced with the equivalent kBitmap(Destroy) for SCI2.1.
+//
+// We fix this incompatibility by patching all ten kBitmap(Destroy) calls back
+//  to kDisposeTextBitmap. By patching just the callk instructions, the Destroy
+//  subop (1) on the stack becomes the new parameter count. The old parameter
+//  count (2) remains on the stack until the next ret instruction. This allows
+//  one patch to work on all calls.
+//
+// Applies to: Italian fan translation, PC CD version
+// Responsible methods: DEdit:hilite, DText:dispose, DText:draw, DSelector:dispose, 
+//                      SRDialog:update, BookButton:hilite, TapeButton:doit
+//                      TellerButton:hilite, TopicButton:hilite
+static const uint16 gk1ItalianTranslationSignature[] = {
+	SIG_MAGICDWORD,
+	0x43, 0x91, SIG_UINT16(0x0004),     // callk 91 0004 [ SCI2: invalid, SCI2.1: kBitmap ]
+	SIG_END
+};
+
+static const uint16 gk1ItalianTranslationPatch[] = {
+	0x43, 0x2e, PATCH_UINT16(0x0002),   // callk 2e 0002 [ kDisposeTextBitmap ]
+	PATCH_END
+};
+
 // Narrator lockup fix for GK1 CD / Mac, see sciNarratorLockupSignature.
 //  The custom code in these versions overlaps with the generic patch signature
 //  so we enable the correct one based on game version and platform.
@@ -4163,6 +4191,13 @@ static const SciScriptPatcherEntry gk1Signatures[] = {
 	{  true,   710, "fix day 9 mummy animation (floppy)",          1, gk1MummyAnimateFloppySignature,   gk1MummyAnimateFloppyPatch },
 	{  true,   710, "fix day 9 mummy animation (cd)",              1, gk1MummyAnimateCDSignature,       gk1MummyAnimateCDPatch },
 	{  true,   800, "fix day 10 honfour unlock door lockup",       1, gk1HonfourUnlockDoorSignature,    gk1HonfourUnlockDoorPatch },
+	{  true,    91, "italian translation compatibility",           3, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
+	{  true,   815, "italian translation compatibility",           1, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
+	{  true,   920, "italian translation compatibility",           1, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
+	{  true, 64913, "italian translation compatibility",           1, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
+	{  true, 64914, "italian translation compatibility",           1, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
+	{  true, 64915, "italian translation compatibility",           2, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
+	{  true, 64990, "italian translation compatibility",           1, gk1ItalianTranslationSignature,   gk1ItalianTranslationPatch },
 	{ false, 64928, "floppy: Narrator lockup fix",                 1, sciNarratorLockupSignature,       sciNarratorLockupPatch },
 	{ false, 64928, "cd/mac: Narrator lockup fix",                 1, gk1NarratorLockupSignature,       gk1NarratorLockupPatch },
 	{  true, 64990, "increase number of save games (1/2)",         1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 2918e2f4dc7..d4260f4f1d1 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -80,6 +80,7 @@ const SciWorkaroundEntry arithmeticWorkarounds[] = {
 	{ GID_FANMADE,        516,  983,  0,             "Wander", "setTarget",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #5124
 	{ GID_FANMADE,         -1,  935,  0,             "Scaler", "init",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_mul: Zork: The Great Underground Empire (fan made): called with object as second parameter when changing rooms
 	{ GID_GK1,            800,64992,  0,                "Fwd", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_gt: when Mosely finds Gabriel and Grace near the end of the game, compares the Grooper object with 7
+	{ GID_GK1,             -1,   91,  0,            "Walkman", "showTapes",                    nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_bnot: Italian fan translation when exiting Walkman. bnot is just an extra 00 byte from the fan patch; the result isn't used.
 	{ GID_HOYLE4,         700,   -1,  1,               "Code", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_add: while bidding in Bridge, an object ("Bid") is added to an object in another segment ("hand3")
 	{ GID_ICEMAN,         199,  977,  0,            "Grooper", "doit",                         nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_add: While dancing with the girl
 	{ GID_MOTHERGOOSE256,  -1,  999,  0,              "Event", "new",                          nullptr,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_and: constantly during the game (SCI1 version)




More information about the Scummvm-git-logs mailing list