[Scummvm-git-logs] scummvm master -> 752b276a119dab93af03b8e81a9c0f173a7b2b7d

elasota noreply at scummvm.org
Mon Oct 31 01:44:52 UTC 2022


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

Summary:
a39a6e0032 MTROPOLIS: Patch up some support statuses, implement set modifier.
285eb67b31 MTROPOLIS: Add detection and boot stub for SPQR: The Empire's Darkest Hour Windows Retail
c2a89b2513 MTROPOLIS: Add hack for MTI animations using the wrong rate flag.
752b276a11 MTROPOLIS: Add detection for SPQR: The Empire's Darkest Hour Macintosh Retail.


Commit: a39a6e00328ec0bf0c0623eb3f9a09d10d16d306
    https://github.com/scummvm/scummvm/commit/a39a6e00328ec0bf0c0623eb3f9a09d10d16d306
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-30T21:44:09-04:00

Commit Message:
MTROPOLIS: Patch up some support statuses, implement set modifier.

Changed paths:
    engines/mtropolis/modifiers.cpp
    engines/mtropolis/modifiers.h


diff --git a/engines/mtropolis/modifiers.cpp b/engines/mtropolis/modifiers.cpp
index be15549f51d..384f972c9da 100644
--- a/engines/mtropolis/modifiers.cpp
+++ b/engines/mtropolis/modifiers.cpp
@@ -506,16 +506,52 @@ bool SetModifier::respondsToEvent(const Event &evt) const {
 
 VThreadState SetModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
 	if (_executeWhen.respondsTo(msg->getEvent())) {
+		if (_target.getSourceType() != DynamicValueSourceTypes::kVariableReference) {
 #ifdef MTROPOLIS_DEBUG_ENABLE
-		if (Debugger *debugger = runtime->debugGetDebugger())
-			debugger->notifyFmt(kDebugSeverityError, "Set modifier is not yet implemented");
+			if (Debugger *debugger = runtime->debugGetDebugger())
+				debugger->notifyFmt(kDebugSeverityError, "Set modifier target isn't a variable reference");
 #endif
-		warning("Set modifier is not yet implemented!");
-		return kVThreadReturn;
+			return kVThreadError;
+		} else {
+			Common::SharedPtr<Modifier> targetModifier = _target.getVarReference().resolution.lock();
+			if (!targetModifier) {
+#ifdef MTROPOLIS_DEBUG_ENABLE
+				if (Debugger *debugger = runtime->debugGetDebugger())
+					debugger->notifyFmt(kDebugSeverityError, "Set modifier target was invalid");
+#endif
+				return kVThreadError;
+			} else if (!targetModifier->isVariable()) {
+#ifdef MTROPOLIS_DEBUG_ENABLE
+				if (Debugger *debugger = runtime->debugGetDebugger())
+					debugger->notifyFmt(kDebugSeverityError, "Set modifier target was invalid");
+#endif
+				return kVThreadError;
+			} else {
+				DynamicValue srcValue = _source.produceValue(msg->getValue());
+				VariableModifier *targetVar = static_cast<VariableModifier *>(targetModifier.get());
+				if (!targetVar->varSetValue(nullptr, srcValue)) {
+#ifdef MTROPOLIS_DEBUG_ENABLE
+					if (Debugger *debugger = runtime->debugGetDebugger())
+						debugger->notifyFmt(kDebugSeverityError, "Set modifier failed to set target value");
+#endif
+					return kVThreadError;
+				}
+			}
+		}
 	}
 	return kVThreadReturn;
 }
 
+void SetModifier::linkInternalReferences(ObjectLinkingScope *outerScope) {
+	_source.linkInternalReferences(outerScope);
+	_target.linkInternalReferences(outerScope);
+}
+
+void SetModifier::visitInternalReferences(IStructuralReferenceVisitor *visitor) {
+	_source.visitInternalReferences(visitor);
+	_target.visitInternalReferences(visitor);
+}
+
 Common::SharedPtr<Modifier> SetModifier::shallowClone() const {
 	return Common::SharedPtr<Modifier>(new SetModifier(*this));
 }
diff --git a/engines/mtropolis/modifiers.h b/engines/mtropolis/modifiers.h
index 3a70bea1819..6ad7416287a 100644
--- a/engines/mtropolis/modifiers.h
+++ b/engines/mtropolis/modifiers.h
@@ -140,7 +140,7 @@ public:
 
 #ifdef MTROPOLIS_DEBUG_ENABLE
 	const char *debugGetTypeName() const override { return "Color Table Modifier"; }
-	SupportStatus debugGetSupportStatus() const override { return kSupportStatusNone; }
+	SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
 #endif
 
 private:
@@ -240,8 +240,12 @@ public:
 
 	void disable(Runtime *runtime) override {}
 
+	void linkInternalReferences(ObjectLinkingScope *outerScope) override;
+	void visitInternalReferences(IStructuralReferenceVisitor *visitor) override;
+
 #ifdef MTROPOLIS_DEBUG_ENABLE
 	const char *debugGetTypeName() const override { return "Set Modifier"; }
+	SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
 #endif
 
 private:
@@ -459,6 +463,7 @@ public:
 
 #ifdef MTROPOLIS_DEBUG_ENABLE
 	const char *debugGetTypeName() const override { return "Scene Transition Modifier"; }
+	SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
 #endif
 
 private:


Commit: 285eb67b31d2d1c23a9b0e5fec35ff46c96d2055
    https://github.com/scummvm/scummvm/commit/285eb67b31d2d1c23a9b0e5fec35ff46c96d2055
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-30T21:44:10-04:00

Commit Message:
MTROPOLIS: Add detection and boot stub for SPQR: The Empire's Darkest Hour Windows Retail

Changed paths:
    engines/mtropolis/boot.cpp
    engines/mtropolis/detection.cpp
    engines/mtropolis/detection.h
    engines/mtropolis/detection_tables.h
    engines/mtropolis/mtropolis.cpp


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index 74380a9dd35..56ab3d9b53b 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -779,6 +779,19 @@ const char *mtiRetailWinDirectories[] = {
 	nullptr
 };
 
+const ManifestFile spqrRetailWinEnFiles[] = {
+	{"SPQR32.EXE", MTFT_PLAYER},
+	{"MCURSORS.C95", MTFT_EXTENSION},
+	{"SPQR.MPL", MTFT_MAIN},
+	{"S_6842.MPX", MTFT_ADDITIONAL},
+	{nullptr, MTFT_AUTO}
+};
+
+const char *spqrRetailWinDirectories[] = {
+	"RESOURCE",
+	nullptr
+};
+
 const Game games[] = {
 	// Obsidian - Retail - Macintosh - English
 	{
@@ -892,6 +905,14 @@ const Game games[] = {
 		nullptr,
 		GameDataHandlerFactory<MTIGameDataHandler>::create
 	},
+	// SPQR: The Empire's Darkest Hour - Retail - Windows
+	{
+		MTBOOT_SPQR_RETAIL_WIN,
+		spqrRetailWinEnFiles,
+		spqrRetailWinDirectories,
+		nullptr,
+		GameDataHandlerFactory<GameDataHandler>::create
+	},
 };
 
 } // End of namespace Games
@@ -1212,9 +1233,11 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 		Boot::FileIdentification *mainSegmentFile = nullptr;
 		Common::Array<Boot::FileIdentification *> segmentFiles;
 
+		int addlSegments = 0;
+
 		// Bin segments
-		for (Boot::FileIdentification &macFile : winFiles) {
-			switch (macFile.category) {
+		for (Boot::FileIdentification &winFile : winFiles) {
+			switch (winFile.category) {
 			case Boot::MTFT_PLAYER:
 				// Case handled below after cursor loading
 				break;
@@ -1222,17 +1245,16 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 				// Case handled below after cursor loading
 				break;
 			case Boot::MTFT_MAIN:
-				mainSegmentFile = &macFile;
+				mainSegmentFile = &winFile;
 				break;
 			case Boot::MTFT_ADDITIONAL: {
-				int segmentID = Boot::resolveFileSegmentID(macFile.fileName);
-				if (segmentID < 2)
-					error("Unusual segment numbering scheme");
+				addlSegments++;
+				int segmentID = addlSegments + 1;
 
 				size_t segmentIndex = static_cast<size_t>(segmentID - 1);
 				while (segmentFiles.size() <= segmentIndex)
 					segmentFiles.push_back(nullptr);
-				segmentFiles[segmentIndex] = &macFile;
+				segmentFiles[segmentIndex] = &winFile;
 			} break;
 			case Boot::MTFT_VIDEO:
 				break;
diff --git a/engines/mtropolis/detection.cpp b/engines/mtropolis/detection.cpp
index e96217624db..525167955d4 100644
--- a/engines/mtropolis/detection.cpp
+++ b/engines/mtropolis/detection.cpp
@@ -30,6 +30,7 @@
 static const PlainGameDescriptor mTropolisGames[] = {
 	{"obsidian", "Obsidian"},
 	{"mti", "Muppet Treasure Island"},
+	{"spqr", "SPQR: The Empire's Darkest Hour"},
 	{nullptr, nullptr}
 };
 
diff --git a/engines/mtropolis/detection.h b/engines/mtropolis/detection.h
index 6b63a2e838d..9d7b3f3c8b2 100644
--- a/engines/mtropolis/detection.h
+++ b/engines/mtropolis/detection.h
@@ -30,6 +30,7 @@ enum MTropolisGameID {
 	GID_OBSIDIAN			= 0,
 	GID_LEARNING_MTROPOLIS	= 1,
 	GID_MTI    				= 2,
+	GID_SPQR                = 3,
 };
 
 // Boot IDs - These can be shared across different variants if the file list and other properties are identical.
@@ -53,6 +54,8 @@ enum MTropolisGameBootID {
 	MTBOOT_MTI_RETAIL_MAC,
 	MTBOOT_MTI_RETAIL_WIN,
 	MTBOOT_MTI_DEMO_WIN,
+
+	MTBOOT_SPQR_RETAIL_WIN,
 };
 
 struct MTropolisGameDescription {
diff --git a/engines/mtropolis/detection_tables.h b/engines/mtropolis/detection_tables.h
index ee648c9f65b..95d373a074a 100644
--- a/engines/mtropolis/detection_tables.h
+++ b/engines/mtropolis/detection_tables.h
@@ -449,6 +449,26 @@ static const MTropolisGameDescription gameDescriptions[] = {
 		MTBOOT_MTI_DEMO_WIN,
 	},
 
+	{ // SPQR: The Empire's Darkest Hour Windows CD-ROM
+		{
+			"spqr",
+			"",
+			{
+				{ "SPQR.MPL", 0, "da778ae00dd3e7596ba970a4dccd0a44", 3292503 },
+				{ "S_6842.MPX", 0, "506c04751bee9482f76333b0cf3c0e52", 577095784 },
+				{ "SPQR32.EXE", 0, "af2a7889779243c0d25392598e893137", 759296 },
+				AD_LISTEND
+			},
+			Common::EN_ANY,
+			Common::kPlatformWindows,
+			ADGF_UNSTABLE,
+			GUIO0()
+		},
+		GID_SPQR,
+		0,
+		MTBOOT_SPQR_RETAIL_WIN,
+	},
+
 	{ AD_TABLE_END_MARKER, 0, 0, MTBOOT_INVALID }
 };
 
diff --git a/engines/mtropolis/mtropolis.cpp b/engines/mtropolis/mtropolis.cpp
index 4e3be417fd8..a89480236fb 100644
--- a/engines/mtropolis/mtropolis.cpp
+++ b/engines/mtropolis/mtropolis.cpp
@@ -145,6 +145,13 @@ Common::Error MTropolisEngine::run() {
 		enhancedColorDepthMode = kColorDepthMode32Bit;
 	}
 
+	if (_gameDescription->gameID == GID_SPQR) {
+		preferredWidth = 640;
+		preferredHeight = 480;
+		preferredColorDepthMode = kColorDepthMode8Bit;
+		enhancedColorDepthMode = kColorDepthMode32Bit;
+	}
+
 	if (ConfMan.getBool("mtropolis_mod_minimum_transition_duration"))
 		_runtime->getHacks().minTransitionDuration = 75;
 


Commit: c2a89b25137d7128d3bbd604517c7fb32f173ac4
    https://github.com/scummvm/scummvm/commit/c2a89b25137d7128d3bbd604517c7fb32f173ac4
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-30T21:44:10-04:00

Commit Message:
MTROPOLIS: Add hack for MTI animations using the wrong rate flag.

Changed paths:
    engines/mtropolis/elements.cpp
    engines/mtropolis/hacks.cpp
    engines/mtropolis/hacks.h
    engines/mtropolis/mtropolis.cpp


diff --git a/engines/mtropolis/elements.cpp b/engines/mtropolis/elements.cpp
index e2862dd6bb9..20adaba13c1 100644
--- a/engines/mtropolis/elements.cpp
+++ b/engines/mtropolis/elements.cpp
@@ -1479,7 +1479,7 @@ void MToonElement::playMedia(Runtime *runtime, Project *project) {
 			runtime->queueMessage(dispatch);
 		}
 
-		if (_maintainRate)
+		if (_maintainRate && !runtime->getHacks().ignoreMToonMaintainRateFlag)
 			_celStartTimeMSec = playTime;
 		else
 			_celStartTimeMSec += (static_cast<uint64>(100000000) * framesAdvanced) / absRateTimes100000;
diff --git a/engines/mtropolis/hacks.cpp b/engines/mtropolis/hacks.cpp
index 65c226709e0..9338e84f9f4 100644
--- a/engines/mtropolis/hacks.cpp
+++ b/engines/mtropolis/hacks.cpp
@@ -40,6 +40,7 @@ Hacks::Hacks() {
 	removeQuickTimeEdits = false;
 	midiVolumeScale = 256;
 	minTransitionDuration = 0;
+	ignoreMToonMaintainRateFlag = false;
 }
 
 Hacks::~Hacks() {
@@ -1018,6 +1019,17 @@ void addObsidianSaveMechanism(const MTropolisGameDescription &desc, Hacks &hacks
 	hacks.addSaveLoadMechanismHooks(mechanism);
 }
 
+void addMTIQuirks(const MTropolisGameDescription &desc, Hacks &hacks) {
+	// MTI uses a lot of "maintain rate" mToons at 10Hz.  This means their frame timer resets on every frame advance, and
+	// is supposed to ensure that the mToon plays back at a smooth rate regardless of clock jitter.  Unfortunately, it
+	// does this with mToons that are synchronized to sounds, which is bad!  Presumably the reason this wasn't a problem
+	// is because MacOS runs with a 60Hz tick clock so it always divides evenly into the frame rate, and Windows... not sure.
+	//
+	// Anyway, there are two possible solutions to this: Lock the clock to 60Hz, or ignore the flag.
+	// Given that the flag should not be set, we ignore the flag.
+	hacks.ignoreMToonMaintainRateFlag = true;
+}
+
 } // End of namespace HackSuites
 
 } // End of namespace MTropolis
diff --git a/engines/mtropolis/hacks.h b/engines/mtropolis/hacks.h
index dcb8758319b..371cc976066 100644
--- a/engines/mtropolis/hacks.h
+++ b/engines/mtropolis/hacks.h
@@ -50,6 +50,7 @@ struct Hacks {
 
 	bool ignoreMismatchedProjectNameInObjectLookups;
 	bool removeQuickTimeEdits;
+	bool ignoreMToonMaintainRateFlag;
 	uint midiVolumeScale;	// 256 = 1.0
 
 	uint32 minTransitionDuration;
@@ -73,6 +74,8 @@ void addObsidianAutoSaves(const MTropolisGameDescription &desc, Hacks &hacks, IA
 void addObsidianSaveMechanism(const MTropolisGameDescription &desc, Hacks &hacks);
 void addObsidianImprovedWidescreen(const MTropolisGameDescription &desc, Hacks &hacks);
 
+void addMTIQuirks(const MTropolisGameDescription &desc, Hacks &hacks);
+
 } // End of namespace HackSuites
 
 } // End of namespace MTropolis
diff --git a/engines/mtropolis/mtropolis.cpp b/engines/mtropolis/mtropolis.cpp
index a89480236fb..b2a677c9aa5 100644
--- a/engines/mtropolis/mtropolis.cpp
+++ b/engines/mtropolis/mtropolis.cpp
@@ -143,6 +143,8 @@ Common::Error MTropolisEngine::run() {
 		preferredHeight = 480;
 		preferredColorDepthMode = kColorDepthMode8Bit;
 		enhancedColorDepthMode = kColorDepthMode32Bit;
+
+		HackSuites::addMTIQuirks(*_gameDescription, _runtime->getHacks());
 	}
 
 	if (_gameDescription->gameID == GID_SPQR) {


Commit: 752b276a119dab93af03b8e81a9c0f173a7b2b7d
    https://github.com/scummvm/scummvm/commit/752b276a119dab93af03b8e81a9c0f173a7b2b7d
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-30T21:44:11-04:00

Commit Message:
MTROPOLIS: Add detection for SPQR: The Empire's Darkest Hour Macintosh Retail.

Changed paths:
    engines/mtropolis/boot.cpp
    engines/mtropolis/detection.cpp
    engines/mtropolis/detection.h
    engines/mtropolis/detection_tables.h


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index 56ab3d9b53b..f1c43cf11db 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -792,6 +792,17 @@ const char *spqrRetailWinDirectories[] = {
 	nullptr
 };
 
+const ManifestFile spqrRetailMacEnFiles[] = {
+	{"Install.vct", MTFT_SPECIAL},
+	{"S_6772", MTFT_ADDITIONAL},
+	{nullptr, MTFT_AUTO}
+};
+
+const char *spqrRetailMacDirectories[] = {
+	"GAME",
+	nullptr
+};
+
 const Game games[] = {
 	// Obsidian - Retail - Macintosh - English
 	{
@@ -905,7 +916,7 @@ const Game games[] = {
 		nullptr,
 		GameDataHandlerFactory<MTIGameDataHandler>::create
 	},
-	// SPQR: The Empire's Darkest Hour - Retail - Windows
+	// SPQR: The Empire's Darkest Hour - Retail - Windows - English
 	{
 		MTBOOT_SPQR_RETAIL_WIN,
 		spqrRetailWinEnFiles,
@@ -913,6 +924,14 @@ const Game games[] = {
 		nullptr,
 		GameDataHandlerFactory<GameDataHandler>::create
 	},
+	// SPQR: The Empire's Darkest Hour - Retail - Macintosh - English
+	{
+		MTBOOT_SPQR_RETAIL_MAC,
+		spqrRetailMacEnFiles,
+		spqrRetailMacDirectories,
+		nullptr,
+		GameDataHandlerFactory<GameDataHandler>::create
+	},
 };
 
 } // End of namespace Games
diff --git a/engines/mtropolis/detection.cpp b/engines/mtropolis/detection.cpp
index 525167955d4..cc7d2d123b8 100644
--- a/engines/mtropolis/detection.cpp
+++ b/engines/mtropolis/detection.cpp
@@ -115,6 +115,7 @@ static const char *directoryGlobs[] = {
 	"RESOURCE",
 	"Saved Games",
 	"MTPLAY32",
+	"GAME",
 	nullptr
 };
 
diff --git a/engines/mtropolis/detection.h b/engines/mtropolis/detection.h
index 9d7b3f3c8b2..7bd18e77e3d 100644
--- a/engines/mtropolis/detection.h
+++ b/engines/mtropolis/detection.h
@@ -56,6 +56,7 @@ enum MTropolisGameBootID {
 	MTBOOT_MTI_DEMO_WIN,
 
 	MTBOOT_SPQR_RETAIL_WIN,
+	MTBOOT_SPQR_RETAIL_MAC,
 };
 
 struct MTropolisGameDescription {
diff --git a/engines/mtropolis/detection_tables.h b/engines/mtropolis/detection_tables.h
index 95d373a074a..0a538a1976c 100644
--- a/engines/mtropolis/detection_tables.h
+++ b/engines/mtropolis/detection_tables.h
@@ -469,6 +469,25 @@ static const MTropolisGameDescription gameDescriptions[] = {
 		MTBOOT_SPQR_RETAIL_WIN,
 	},
 
+	{ // SPQR: The Empire's Darkest Hour Macintosh CD-ROM
+		{
+			"spqr",
+			"",
+			{
+				{ "Install.vct", 0, "df8b7e964bf2ce4d32a38091836bdd75", 3539712 },
+				{ "S_6772", 0, "8f8e503fd5b6d0f7651149ff8d92a7a2", 576188928 },
+				AD_LISTEND
+			},
+			Common::EN_ANY,
+			Common::kPlatformMacintosh,
+			ADGF_UNSTABLE,
+			GUIO0()
+		},
+		GID_SPQR,
+		0,
+		MTBOOT_SPQR_RETAIL_MAC,
+	},
+
 	{ AD_TABLE_END_MARKER, 0, 0, MTBOOT_INVALID }
 };
 




More information about the Scummvm-git-logs mailing list