[Scummvm-git-logs] scummvm master -> ac1fb79d7874323d698de7f08926092c646dc907

sluicebox 22204938+sluicebox at users.noreply.github.com
Sat Aug 8 14:12:28 UTC 2020


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

Summary:
ac1fb79d78 SCI: Fix SQ4 NRS "Stuff Removed" easter egg room


Commit: ac1fb79d7874323d698de7f08926092c646dc907
    https://github.com/scummvm/scummvm/commit/ac1fb79d7874323d698de7f08926092c646dc907
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-08-08T07:10:09-07:00

Commit Message:
SCI: Fix SQ4 NRS "Stuff Removed" easter egg room

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 74410be27f..05aec7e6b7 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -17966,7 +17966,8 @@ static const uint16 sq4CDPatchSewerLockup[] = {
 // This wouldn't be a problem except that the code is publicly known due to NRS'
 //  modified version of the game which includes a script 271 that recreates the
 //  room. The code appears in easter egg lists, and players who don't realize it
-//  only applies to a modified version attempt it and crash, so we disable it.
+//  only applies to a modified version attempt it and crash, so we disable it
+//  unless script 271 is present.
 //
 // Applies to: English PC CD
 // Responsible method: timeToTimeWarpS:changeState(1)
@@ -17983,6 +17984,39 @@ static const uint16 sq4CdPatchRemovedRoomTimepodCode[] = {
 	PATCH_END
 };
 
+// The NRS modified version of SQ4 contains an impressive script restoration of
+//  the Stuff Taken Out for Legal Reasons easter egg room, but clicking on most
+//  items underflows the stack. The doVerb methods in script 271 jump into the
+//  middle of pod:doVerb to display their messages, but pod:doVerb pushes its
+//  parameter on the stack at the start and tosses it at the end.
+//
+// We fix this by making pod:doVerb safe to jump into by removing the copy of
+//  the parameter that it stores on the stack.
+//
+// Applies to: SQ4 Update by NRS
+// Responsible method: pod:doVerb
+static const uint16 sq4NrsSignatureRemovedRoomItems[] = {
+	0x8f, SIG_MAGICDWORD, 0x01,         // lsp 01
+	0x3c,                               // dup
+	0x35, 0x01,                         // ldi 01
+	SIG_ADDTOOFFSET(+15),
+	0x3c,                               // dup
+	SIG_ADDTOOFFSET(+27),
+	0x3a,                               // toss
+	0x48,                               // ret
+	SIG_END
+};
+
+static const uint16 sq4NrsPatchRemovedRoomItems[] = {
+	0x86, PATCH_UINT16(0x0001),         // lap 0001
+	0x39, 0x01,                         // pushi 01
+	PATCH_ADDTOOFFSET(+15),
+	0x60,                               // pprev
+	PATCH_ADDTOOFFSET(+27),
+	0x48,                               // ret
+	PATCH_END
+};
+
 // Walking into Sock's dressing room (room 371) can cause ego to escape obstacle
 //  boundaries and get stuck behind the wall or counter. Similar problems occur
 //  in the original. The dressing room has no obstacle bounding the edge of the
@@ -18064,6 +18098,7 @@ static const SciScriptPatcherEntry sq4Signatures[] = {
 	{  true,    45, "CD: walk in from below for room 45 fix",         1, sq4CdSignatureWalkInFromBelowRoom45,           sq4CdPatchWalkInFromBelowRoom45 },
 	{  true,   105, "Floppy: sewer lockup fix",                       1, sq4FloppySignatureSewerLockup,                 sq4FloppyPatchSewerLockup },
 	{  true,   105, "CD: sewer lockup fix",                           1, sq4CDSignatureSewerLockup,                     sq4CDPatchSewerLockup },
+	{  true,   271, "NRS: removed room items fix",                    1, sq4NrsSignatureRemovedRoomItems,               sq4NrsPatchRemovedRoomItems },
 	{  true,   290, "CD: cedric easter egg fix",                      1, sq4CdSignatureCedricEasterEgg,                 sq4CdPatchCedricEasterEgg },
 	{  true,   290, "CD: cedric lockup fix (1/2)",                    1, sq4CdSignatureCedricLockup1,                   sq4CdPatchCedricLockup1 },
 	{  true,   290, "CD: cedric lockup fix (2/2)",                    1, sq4CdSignatureCedricLockup2,                   sq4CdPatchCedricLockup2 },




More information about the Scummvm-git-logs mailing list