[Scummvm-git-logs] scummvm master -> 00adc4642f6e65d8a6324c03c64c23b3dafc3621

sluicebox noreply at scummvm.org
Thu Jun 27 01:52:54 UTC 2024


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

Summary:
7690377cad SCI: Remove invalid PQ2 workaround
00adc4642f SCI: Fix PEPPER unsolvable puzzle box


Commit: 7690377cad940bb1b2c162b01189dcad3143305a
    https://github.com/scummvm/scummvm/commit/7690377cad940bb1b2c162b01189dcad3143305a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-06-26T17:51:15-07:00

Commit Message:
SCI: Remove invalid PQ2 workaround

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


diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 66fc876c58c..209cd8cd08b 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -630,8 +630,7 @@ const SciWorkaroundEntry kDisplay_workarounds[] = {
 	{ GID_LONGBOW,       220,   220,  0,             "moveOn", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during second room "Outwit and outfight..."
 	{ GID_LONGBOW,       210,   210,  0,               "mama", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during third room "Fall under the spell..."
 	{ GID_LONGBOW,       320,   320,  0,              "flyin", "changeState",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: during fourth room "Conspiracies, love..."
-	{ GID_PQ2,            23,    23,  0,         "rm23Script", "elements",     sig_kDisplay_pq2_1,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of files in jail - 0x75 as id - bug #5223
-	{ GID_PQ2,            23,    23,  0,         "rm23Script", "handleEvent",  sig_kDisplay_pq2_1,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of file in jail - 0x75 as id - bug #9670
+	{ GID_PQ2,            23,    23,  0,         "rm23Script", "handleEvent",  sig_kDisplay_pq2_1,     0,     0, { WORKAROUND_IGNORE,    0 } }, // when looking at the 2nd page of files in jail - 0x75 as id - bugs #5223, #9670
 	{ GID_QFG1,           11,    11,  0,             "battle", "init",                    nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // DEMO: When entering battle, 0x75 as id
 	{ GID_SQ3,             1,     1,  0,              "rm001", "handleEvent",             nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // MAC: during intro when pressing enter - a parameter is an object
 	{ GID_SQ4,           397,     0,  0,                   "", "export 12",               nullptr,     0,     0, { WORKAROUND_IGNORE,    0 } }, // FLOPPY: when going into the computer store - bug #5227


Commit: 00adc4642f6e65d8a6324c03c64c23b3dafc3621
    https://github.com/scummvm/scummvm/commit/00adc4642f6e65d8a6324c03c64c23b3dafc3621
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-06-26T18:49:52-07:00

Commit Message:
SCI: Fix PEPPER unsolvable puzzle box

Congratulations to @eriktorbjorn for discovering what has to be one of
the funniest Sierra bugs yet: a truly unsolvable puzzle.

Thanks to @m-kiewitz for the initial patch and @eriktorbjorn for the
impressively thorough research.

Fixes bug #15225

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 afc213d4607..183f8eb9675 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -13279,8 +13279,42 @@ static const uint16 pepperPatchGlassJar[] = {
 	PATCH_END
 };
 
+// Ben Franklin's puzzle box cannot be solved. It is a sliding tile puzzle that
+//  is always initialized to the same state, but that state cannot reach the
+//  goal state. The puzzle can only be completed by pressing the Help button,
+//  because it "solves" the puzzle one tile at a time by swapping them instead
+//  of sliding. Swapping tiles can place the puzzle in a solvable state.
+//  
+// We have verified this with sliding tile puzzle solver programs. They reject
+//  the initial state as unsolvable. There is no indication that this was the
+//  the intention for the puzzle box.
+//
+// We fix this by swapping the initial positions of the last two tiles. This is
+//  all it takes for the initial state to be solvable.
+//
+// Applies to: All versions
+// Responsible method: rm116:init
+// Fixes bug: #15225
+static const uint16 pepperSignaturePuzzleBox[] = {
+	SIG_MAGICDWORD,
+	0x36,                            // push
+	0x72, SIG_UINT16(0x0284),        // lofsa t3
+	SIG_ADDTOOFFSET(+9),
+	0x72, SIG_UINT16(0x0594),        // lofsa t11
+	SIG_END
+};
+
+static const uint16 pepperPatchPuzzleBox[] = {
+	PATCH_ADDTOOFFSET(+1),
+	0x72, PATCH_GETORIGINALUINT16(+14),  // lofsa t11
+	PATCH_ADDTOOFFSET(+9),
+	0x72, PATCH_GETORIGINALUINT16(+2),   // lofsa t3
+	PATCH_END
+};
+
 //          script, description,                                         signature                            patch
 static const SciScriptPatcherEntry pepperSignatures[] = {
+	{  true,   116, "puzzle box fix",                                 1, pepperSignaturePuzzleBox,            pepperPatchPuzzleBox },
 	{  true,   894, "glass jar fix",                                  1, pepperSignatureGlassJar,             pepperPatchGlassJar },
 	{  true,   928, "Narrator lockup fix",                            1, sciNarratorLockupSignature,          sciNarratorLockupPatch },
 	SCI_SIGNATUREENTRY_TERMINATOR




More information about the Scummvm-git-logs mailing list