[Scummvm-git-logs] scummvm master -> 1db2211de32dfd9edadb831a63cfa8cb00e7af04

sluicebox 22204938+sluicebox at users.noreply.github.com
Sat Oct 16 02:57:07 UTC 2021


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:
3ad5a82760 SCI: Apply workarounds to Mac games without object names
1db2211de3 SCI: Add LAURABOW2 workaround for uninit read in museum


Commit: 3ad5a82760d2fbf4301978b41a69558cf7b60448
    https://github.com/scummvm/scummvm/commit/3ad5a82760d2fbf4301978b41a69558cf7b60448
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-10-15T21:34:21-05:00

Commit Message:
SCI: Apply workarounds to Mac games without object names

Restore object names in QFG1VGA workarounds that were removed to
accommodate the Mac version. Instead, don't match object names
on games that are known to not have them, since there are several.

Fixes workarounds not being applied to HOYLE4 Mac and LSL6 Mac.

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


diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index 910bbbb715..5279d2bb94 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -838,4 +838,16 @@ bool GameFeatures::useEarlyGetLongestTextCalculations() const {
 	}
 }
 
+bool GameFeatures::hasScriptObjectNames() const {
+	switch (g_sci->getGameId()) {
+	case GID_HOYLE4:
+	case GID_LSL6:
+	case GID_QFG1VGA:
+		return (g_sci->getPlatform() != Common::kPlatformMacintosh);
+	
+	default:
+		return true;
+	}
+}
+
 } // End of namespace Sci
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index 3c0893fd6a..73ab28e55f 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -268,6 +268,14 @@ public:
 
 	bool useEarlyGetLongestTextCalculations() const;
 
+	/**
+	 * Several SCI1.1 Macintosh games have empty strings for almost all of the
+	 * object names in the script resources.
+	 *
+	 * @return true if the game's object names aren't empty strings.
+	 */
+	bool hasScriptObjectNames() const;
+
 private:
 	reg_t getDetectionAddr(const Common::String &objName, Selector slc, int methodNum = -1);
 
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 566dbac815..8bef0ee72a 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "sci/engine/features.h"
 #include "sci/engine/kernel.h"
 #include "sci/engine/object.h"
 #include "sci/engine/state.h"
@@ -86,7 +87,7 @@ const SciWorkaroundEntry arithmeticWorkarounds[] = {
 	{ GID_MOTHERGOOSE256,  -1,    4,  0,              "rm004", "doit",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_or: when going north and reaching the castle (rooms 4 and 37) - bug #5101
 	{ GID_MOTHERGOOSEHIRES,90,   90,  0,      "newGameButton", "select",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_ge: MUMG Deluxe, when selecting "New Game" in the main menu. It tries to compare an integer with a list. Needs to return false for the game to continue.
 	{ GID_PHANTASMAGORIA, 902,    0,  0,                   "", "export 7",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_shr: when starting a chapter in Phantasmagoria
-	{ GID_QFG1VGA,        301,  928,  0,                 NULL, "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_div: when entering the inn, Blink:init called with 1 parameter, but 2nd parameter is used for div which happens to be an object. NULL object name as Mac version has none.
+	{ GID_QFG1VGA,        301,  928,  0,              "Blink", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_div: when entering the inn, Blink:init called with 1 parameter, but 2nd parameter is used for div which happens to be an object.
 	{ GID_QFG2,           200,  200,  0,              "astro", "messages",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_lsi: when getting asked for your name by the astrologer - bug #5152
 	{ GID_QFG3,           780,  999,  0,                   "", "export 6",                        NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // op_add: trying to talk to yourself at the top of the giant tree - bug #6692
 	{ GID_TORIN,        51400,64928,  0,              "Blink", "init",                            NULL,     0,     0, { WORKAROUND_FAKE,   1 } }, // op_div: when Lycentia knocks Torin out after he removes her collar
@@ -515,8 +516,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_PQSWAT,       2990,  2990,  0,    "talkToSchienbly", "changeState",                     NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When the video of Schienbly talking for the first time ends
 	{ GID_QFG1,           -1,   210,  0,          "Encounter", "init",           sig_uninitread_qfg1_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1/hq1: going to the brigands hideout
 	{ GID_QFG1VGA,        -1,   210,  0,          "Encounter", "init",        sig_uninitread_qfg1vga_1,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga: going to the brigands hideout - bug #5515
-	{ GID_QFG1VGA,        -1,   210,  0,                 NULL, "init",        sig_uninitread_qfg1vga_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: going to the brigands hideout - bug #5515. object is "Encounter" but Mac version has blank names
-	{ GID_QFG1VGA,        58,    58,  0,                 NULL, "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,  18 } }, // qfg1vga: casting "detect magic" at giant's cave, temp 0 used instead of spell number. object is "rm58" but Mac version has blank names
+	{ GID_QFG1VGA,        -1,   210,  0,          "Encounter", "init",        sig_uninitread_qfg1vga_2,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: going to the brigands hideout - bug #5515
+	{ GID_QFG1VGA,        58,    58,  0,               "rm58", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,  18 } }, // qfg1vga: casting "detect magic" at giant's cave, temp 0 used instead of spell number
 	{ GID_QFG1VGA,        96,    96,  0,                 NULL, "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: when yorick throws an object
 	{ GID_QFG1VGA,       320,   320,  0,                 NULL, "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // qfg1vga mac: first time entering room 320 when centaur offers fruits and vegetables
 	{ GID_QFG2,           -1,    71,  0,        "theInvSheet", "doit",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // accessing the inventory
@@ -1187,7 +1188,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 						&& ((workaround->scriptNr == -1) || (workaround->scriptNr == curScriptNr))
 						&& ((workaround->roomNr == -1) || (workaround->roomNr == curRoomNumber))
 						&& ((workaround->inheritanceLevel == -1) || (workaround->inheritanceLevel == inheritanceLevel))
-						&& objectNameMatches
+						&& (objectNameMatches || !g_sci->_features->hasScriptObjectNames())
 						&& workaround->methodName == g_sci->getSciLanguageString(curMethodName, K_LANG_ENGLISH)
 						&& ((workaround->fromIndex == -1) || ((workaround->fromIndex <= index) && (workaround->toIndex >= index)))) {
 					// Workaround found


Commit: 1db2211de32dfd9edadb831a63cfa8cb00e7af04
    https://github.com/scummvm/scummvm/commit/1db2211de32dfd9edadb831a63cfa8cb00e7af04
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-10-15T21:34:21-05:00

Commit Message:
SCI: Add LAURABOW2 workaround for uninit read in museum

Prevents a warning that frequently occurs during most of the game
as actors walk around the museum.

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


diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 8bef0ee72a..b6937fa107 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -352,6 +352,7 @@ const SciWorkaroundEntry uninitializedReadForParamWorkarounds[] = {
 	{ GID_HOYLE5,         -1,    15, -1,               "Hand", "add",                             NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When the game adds cards to your hand in any mini-game
 	{ GID_HOYLE5,        700,   730,  0,                 NULL, "runningSuit",                     NULL,     2,     2,{ WORKAROUND_FAKE,   0 } }, // when an opponent is playing in Bridge
 	{ GID_HOYLE5,       1100,    22, -1,           "HandPile", "show",                            NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // when showing money piles in Poker
+	{ GID_LAURABOW2,      -1,    90,  0,          "MuseumRgn", "crowdInRoom",                     NULL,     3,     4,{ WORKAROUND_FAKE,   0 } }, // When actors walk around the museum. Out-of-bounds parameters are read but not used. Doesn't matter, but generates a lot of warnings.
 	{ GID_PHANTASMAGORIA2,-1, 63019,  0,     "WynDocTextView", "cue",                             NULL,     2,     2,{ WORKAROUND_FAKE,   0 } }, // When dragging the slider next to an e-mail message
 	{ GID_SHIVERS,        -1, 64918,  0,                "Str", "strip",                           NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When starting a new game and entering a name
 	{ GID_SQ4,            35,   928,  0,           "Narrator", "say",                             NULL,     1,     1,{ WORKAROUND_FAKE,  11 } }, // Clicking smell on sidewalk, fixes message due to missing say parameter in sidewalk1:doVerb(6) - bug #10917




More information about the Scummvm-git-logs mailing list