[Scummvm-git-logs] scummvm master -> 7079f0104456a6886c7cb47a93540aeaaf15de57

sluicebox 22204938+sluicebox at users.noreply.github.com
Fri Jan 31 01:16:56 UTC 2020


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

Summary:
ef5885d14d SCI32: Add LSL7 Mac detection entry
c1fb6562ac SCI32: Add Save/Restore support for Mac games
7079f01044 SCI32: Stub out and document kPlatformMac32 subops


Commit: ef5885d14d0cd04441b07f288c27779a3c21927a
    https://github.com/scummvm/scummvm/commit/ef5885d14d0cd04441b07f288c27779a3c21927a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-01-30T16:50:28-08:00

Commit Message:
SCI32: Add LSL7 Mac detection entry

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index ce8b4d3..a1a2298 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2962,6 +2962,21 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		AD_LISTEND},
 		Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO_LSL7 },
 
+	// Larry 7 - English Macintosh CD
+	{"lsl7", "", {
+		{"Data1", 0, "824a48b794c334b4bcf37e80fcc5f82e", 913286},
+		{"Data2", 0, "be36c59a3a694e14ed6d86e6ccc180a4", 7549943},
+		{"Data3", 0, "8325c7d702ffa8dd2854135e0f42b0d0", 6815697},
+		{"Data4", 0, "4584f786e0b5a502938d3cd90e6fab56", 8169195},
+		{"Data5", 0, "94bd026d27ba526d1f8d86d8e783acdd", 7452479},
+		{"Data6", 0, "c6a60210244a8591ecf10a50975ab9db", 8119360},
+		{"Data7", 0, "0d52c9764e047169f3d50f76d0cb5ae5", 8164785},
+		{"Data8", 0, "6f4838585ceb8a9ac277d13291c81235", 7754883},
+		{"Data9", 0, "68c0b7bd4aebf57e215f0517247a11d1", 8079211},
+		{"Data10", 0, "3dbacbcf4bd6d1b25aa8baeb3e2c4dab", 6446948},
+		AD_LISTEND},
+		Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_LSL7 },
+
 #undef GUIO_LSL7_DEMO
 #undef GUIO_LSL7
 


Commit: c1fb6562aced6efd8d0b2379d92b65006dbe8c4c
    https://github.com/scummvm/scummvm/commit/c1fb6562aced6efd8d0b2379d92b65006dbe8c4c
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-01-30T16:56:01-08:00

Commit Message:
SCI32: Add Save/Restore support for Mac games

Changed paths:
    engines/sci/engine/guest_additions.h
    engines/sci/engine/kfile.cpp
    engines/sci/engine/workarounds.cpp
    engines/sci/sci.cpp
    engines/sci/sci.h


diff --git a/engines/sci/engine/guest_additions.h b/engines/sci/engine/guest_additions.h
index b889c49..cabcc4d 100644
--- a/engines/sci/engine/guest_additions.h
+++ b/engines/sci/engine/guest_additions.h
@@ -262,6 +262,7 @@ private:
 	 */
 	reg_t promptSaveRestoreHoyle5(EngineState *s, int argc, reg_t *argv) const;
 
+public:
 	/**
 	 * Prompts the user to save or load a game.
 	 *
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 7300242..53c3988 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -1333,11 +1333,23 @@ reg_t kGetSaveFiles(EngineState *s, int argc, reg_t *argv) {
 reg_t kSaveGame32(EngineState *s, int argc, reg_t *argv) {
 	const Common::String gameName = s->_segMan->getString(argv[0]);
 	int16 saveNo = argv[1].toSint16();
-	const Common::String saveDescription = argv[2].isNull() ? "" : s->_segMan->getString(argv[2]);
+	Common::String saveDescription = argv[2].isNull() ? "" : s->_segMan->getString(argv[2]);
 	const Common::String gameVersion = (argc <= 3 || argv[3].isNull()) ? "" : s->_segMan->getString(argv[3]);
 
 	debugC(kDebugLevelFile, "Game name %s save %d desc %s ver %s", gameName.c_str(), saveNo, saveDescription.c_str(), gameVersion.c_str());
 
+	// Display the save prompt for Mac games with native dialogs. Passing
+	//  zero for the save number would trigger these, but we can't act solely
+	//  on that since we shift save numbers around to accommodate autosave
+	//  slots, causing some games to pass zero that normally wouldn't.
+	if (g_sci->hasMacSaveRestoreDialogs() && saveNo == 0) {
+		saveNo = g_sci->_guestAdditions->runSaveRestore(true, argv[2]);
+		if (saveNo == -1) {
+			return NULL_REG;
+		}
+		saveDescription = s->_segMan->getString(argv[2]);
+	}
+
 	// Auto-save system used by Torin and LSL7
 	if (gameName == "Autosave" || gameName == "Autosv") {
 		if (saveNo == 0) {
@@ -1402,6 +1414,17 @@ reg_t kRestoreGame32(EngineState *s, int argc, reg_t *argv) {
 	int16 saveNo = argv[1].toSint16();
 	const Common::String gameVersion = argv[2].isNull() ? "" : s->_segMan->getString(argv[2]);
 
+	// Display the restore prompt for Mac games with native dialogs. Passing
+	//  zero for the save number would trigger these, but we can't act solely
+	//  on that since we shift save numbers around to accommodate autosave
+	//  slots, causing some games to pass zero that normally wouldn't.
+	if (g_sci->hasMacSaveRestoreDialogs() && saveNo == 0) {
+		saveNo = g_sci->_guestAdditions->runSaveRestore(false, NULL_REG, s->_delayedRestoreGameId);
+		if (saveNo == -1) {
+			return NULL_REG;
+		}
+	}
+
 	if (gameName == "Autosave" || gameName == "Autosv") {
 		if (saveNo == 0) {
 			// Autosave slot 0 is the autosave
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index fd055d9..a0dc305 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -368,6 +368,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_FREDDYPHARKAS, 540,   540,  0,          "WaverCode", "init",                            NULL,     0,     1, { WORKAROUND_FAKE,   0 } }, // Gun pratice mini-game, all temps - 0+1 - bug #5232
 	{ GID_GK1,            -1, 64950, -1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // sometimes when walk-clicking
 	{ GID_GK1,            -1, 64937, -1,         "GKControls", "dispatchEvent",                   NULL,     6,     6, { WORKAROUND_FAKE,   0 } }, // when using keyboard navigation (tab) in the game settings and hitting 'enter' when over a slider
+	{ GID_GK1,            -1, 64994, -1,               "Game", "save",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_GK1,            -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
 	{ GID_GK2,            -1,    11,  0,                   "", "export 10",                       NULL,    -1,    -1, { WORKAROUND_FAKE,   0 } }, // When game starts and throughout game. temp1 in Italian version, temp3 in others
 	{ GID_GK2,            -1, 64921, -1,              "Print", "addEdit",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
 	{ GID_HOYLE1,          4,   104,  0,   "GinRummyCardList", "calcRuns",                        NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // Gin Rummy / right when the game starts
@@ -468,6 +470,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_LSL6HIRES,     820,    82,  0,                   "", "export 0",                        NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // when touching the electric fence - bug #10361
 	{ GID_LSL6HIRES,      -1, 64950,  1,            "Feature", "handleEvent",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // at least when entering swimming pool area
 	{ GID_LSL6HIRES,      -1, 64964,  0,              "DPath", "init",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // during the game
+	{ GID_LSL6HIRES,      -1, 64994, -1,               "Game", "save",                            NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_LSL6HIRES,      -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
 	{ GID_LSL7,           -1, 64029,  0,          "oMessager", "nextMsg",                         NULL,     4,     4, { WORKAROUND_FAKE,   0 } }, // when running the game with subtitles only
 	{ GID_LSL7,           -1, 64017,  0,             "oFlags", "clear",                           NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // demo version, when it starts, and whenever the player chooses to go to the "Strip Liar's Dice" mini game
 	{ GID_LSL7,           -1, 64017,  0,        "oActorFlags", "clear",                           NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // after an NPC walks off the left side of the screen at the Clothing Optional Pool
@@ -552,6 +556,9 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_SQ6,           210,   210,  0,       "buttonSecret", "doVerb",                          NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // after winning the first round of stooge fighter 3
 	{ GID_SQ6,            -1, 64994, -1,               "Game", "restore",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to load an invalid save game from the launcher
 	{ GID_SQ6,            -1, 64921, -1,              "Print", "addEdit",                         NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // When trying to use the game debugger's flag setting command
+	{ GID_SQ6,           105,   105, -1,    "doRestoreScript", "changeState",                     NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring from main menu in Mac version
+	{ GID_SQ6,            -1, 64994, -1,               "Game", "save",                            NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when saving in Mac version
+	{ GID_SQ6,            -1, 64994, -1,               "Game", "restore",                         NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // when restoring in Mac version
 	{ GID_TORIN,          -1, 64017,  0,             "oFlags", "clear",                           NULL,     0,     0, { WORKAROUND_FAKE,   0 } }, // entering Torin's home in the French version
 	{ GID_TORIN,          -1, 64029,  0,          "oMessager", "nextMsg",                         NULL,     3,     3, { WORKAROUND_FAKE,   0 } }, // start of chapter one, or when running with subtitles only
 	{ GID_TORIN,          -1, 64892,  0,      "oEventHandler", "killAllEventHogs",                NULL,     1,     1, { WORKAROUND_FAKE,   0 } }, // when pressing the hint button when the game is about to transition to a new room (race condition) - Trac#9810
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 70e4129..2e5b967 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -785,6 +785,14 @@ bool SciEngine::hasMacIconBar() const {
 			(getGameId() == GID_KQ6 || getGameId() == GID_FREDDYPHARKAS);
 }
 
+bool SciEngine::hasMacSaveRestoreDialogs() const {
+    return _gameDescription->platform == Common::kPlatformMacintosh &&
+			(getSciVersion() <= SCI_VERSION_2_1_EARLY ||
+			 getGameId() == GID_GK2 ||
+			 getGameId() == GID_SQ6 ||
+			 getGameId() == GID_LIGHTHOUSE);
+}
+
 Common::String SciEngine::getSavegameName(int nr) const {
 	return _targetName + Common::String::format(".%03d", nr);
 }
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 0c680fb..94dfb1d 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -231,7 +231,7 @@ enum SciVersion {
 	SCI_VERSION_2, // GK1, PQ4 floppy, QFG4 floppy
 	SCI_VERSION_2_1_EARLY, // GK2 demo, KQ7 1.4/1.51, LSL6 hires, PQ4CD, QFG4CD
 	SCI_VERSION_2_1_MIDDLE, // GK2, Hoyle 5, KQ7 2.00b, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, Shivers 1, SQ6, Torin
-	SCI_VERSION_2_1_LATE, // demos of LSL7, Lighthouse, RAMA
+	SCI_VERSION_2_1_LATE, // demos and Mac versions of LSL7, Lighthouse, RAMA
 	SCI_VERSION_3 // LSL7, Lighthouse, RAMA, Phantasmagoria 2
 };
 
@@ -282,6 +282,7 @@ public:
 
 	bool hasParser() const;
 	bool hasMacIconBar() const;
+	bool hasMacSaveRestoreDialogs() const;
 
 	inline ResourceManager *getResMan() const { return _resMan; }
 	inline ScriptPatcher *getScriptPatcher() const { return _scriptPatcher; }


Commit: 7079f0104456a6886c7cb47a93540aeaaf15de57
    https://github.com/scummvm/scummvm/commit/7079f0104456a6886c7cb47a93540aeaaf15de57
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-01-30T17:14:06-08:00

Commit Message:
SCI32: Stub out and document kPlatformMac32 subops

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


diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 0b5756c..df600df 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -547,12 +547,6 @@ reg_t kMacPlatform(EngineState *s, int argc, reg_t *argv) {
 		// Subop 0 has changed a few times
 		// In SCI1, its usage is still unknown
 		// In SCI1.1, it's NOP
-		// In SCI32, it's used for remapping cursor ID's
-#ifdef ENABLE_SCI32
-		if (getSciVersion() >= SCI_VERSION_2_1_EARLY) // Set Mac cursor remap
-			g_sci->_gfxCursor32->setMacCursorRemapList(argc - 1, argv + 1);
-		else
-#endif
 		if (getSciVersion() != SCI_VERSION_1_1)
 			warning("Unknown SCI1 kMacPlatform(0) call");
 		break;
@@ -564,7 +558,7 @@ reg_t kMacPlatform(EngineState *s, int argc, reg_t *argv) {
 		break;	// removed warning, as it produces a lot of spam in the console
 	case 2: // Unknown, "UseNextWaitEvent" (Various)
 	case 3: // Unknown, "ProcessOpenDocuments" (Various)
-	case 5: // Unknown, plays a sound (KQ7)
+	case 5: // Unknown
 	case 6: // Unknown, menu-related (Unused?)
 		warning("Unhandled kMacPlatform(%d)", argv[0].toUint16());
 		break;
@@ -575,6 +569,58 @@ reg_t kMacPlatform(EngineState *s, int argc, reg_t *argv) {
 	return s->r_acc;
 }
 
+#ifdef ENABLE_SCI32
+reg_t kMacPlatform32(EngineState *s, int argc, reg_t *argv) {
+	switch (argv[0].toUint16()) {
+	case 0: // build cursor view map
+		g_sci->_gfxCursor32->setMacCursorRemapList(argc - 1, argv + 1);
+		break;
+
+	case 1: // compact/purge mac memory
+	case 2: // hands-off/hands-on for mac menus
+		break;
+
+	// TODO: Save game handling in KQ7, Shivers, and Lighthouse.
+	// - KQ7 uses all three with no parameters; the interpreter would
+	//   remember the current save file.
+	// - Shivers uses all three but passes parameters in a similar
+	//   manner as the normal kSave\kRestore calls.
+	// - Lighthouse goes insane and only uses subop 3 but adds sub-subops
+	//   which appear to do the three operations.
+	// Temporarily stubbing these out with success values so that KQ7 can start.
+	case 3: // initialize save game file
+		warning("Unimplemented kMacPlatform32(%d): Initialize save game file", argv[0].toUint16());
+		return TRUE_REG;
+	case 4: // save game
+		warning("Unimplemented kMacPlatform32(%d): Save game", argv[0].toUint16());
+		return TRUE_REG;
+	case 5: // restore game
+		warning("Unimplemented kMacPlatform32(%d): Restore game", argv[0].toUint16());
+		break;
+
+	// TODO: Mother Goose save game handling
+	case 6:
+	case 7:
+	case 8:
+	case 9:
+	case 10:
+	case 11:
+		error("Unimplemented kMacPlatform32(%d) save game operation", argv[0].toUint16());
+		break;
+
+	// TODO: Phantasmagoria music volume adjustment [ 0-15 ]
+	case 12:
+		warning("Unimplemented kMacPlatform32(%d): Set volume: %d", argv[0].toUint16(), argv[1].toUint16());
+		break;
+
+	default:
+		error("Unknown kMacPlatform32(%d)", argv[0].toUint16());
+	}
+
+	return s->r_acc;
+}
+#endif
+
 enum kSciPlatforms {
 	kSciPlatformMacintosh = 0,
 	kSciPlatformDOS = 1,
@@ -666,7 +712,7 @@ reg_t kPlatform32(EngineState *s, int argc, reg_t *argv) {
 		case Common::kPlatformMacintosh:
 			// For Mac versions, kPlatform(0) with other args has more functionality
 			if (argc > 1) {
-				return kMacPlatform(s, argc - 1, argv + 1);
+				return kMacPlatform32(s, argc - 1, argv + 1);
 			} else {
 				// SCI32 Mac claims to be DOS. GK1 depends on this in order to play its
 				//  view-based slideshow movies. It appears that Sierra opted to change




More information about the Scummvm-git-logs mailing list