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

csnover csnover at users.noreply.github.com
Tue Jul 25 02:37:42 CEST 2017


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

Summary:
4c316d45fd SCI32: Fix ResourceManager::changeAudioDirectory
f88bcb3ee9 SCI32: Add deflang (default language) kGetConfig key for MGDX
40e9963baa SCI32: Deduplicate volume reset script patches & add to MGDX
bfa6ad5155 SCI32: Use dynamic selector in QFG4 trap script patch
dbdbb9b5b3 SCI32: Match 4-language MGDX extra save game data
5ab010e15f SCI32: Fix MGDX platform in detection tables
97f7308da3 SCI32: Add music volume UI sync for MGDX
ad8be1e506 SCI32: Promote MGDX to ADGF_TESTING


Commit: 4c316d45fd2181517ee40aeff1b0b749ec62bf42
    https://github.com/scummvm/scummvm/commit/4c316d45fd2181517ee40aeff1b0b749ec62bf42
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:28-05:00

Commit Message:
SCI32: Fix ResourceManager::changeAudioDirectory

Fixes Trac#9577.

Changed paths:
    engines/sci/resource.h
    engines/sci/resource_audio.cpp


diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 8e91a60..bdf46ef 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -380,7 +380,7 @@ public:
 
 	void setAudioLanguage(int language);
 	int getAudioLanguage() const;
-	void changeAudioDirectory(const Common::String &path);
+	void changeAudioDirectory(Common::String path);
 	bool isGMTrackIncluded();
 	bool isSci11Mac() const { return _volVersion == kResVersionSci11Mac; }
 	ViewType getViewType() const { return _viewType; }
@@ -465,7 +465,8 @@ protected:
 	int _maxMemoryLRU;
 
 	ViewType _viewType; // Used to determine if the game has EGA or VGA graphics
-	Common::List<ResourceSource *> _sources;
+	typedef Common::List<ResourceSource *> SourcesList;
+	SourcesList _sources;
 	int _memoryLocked;	///< Amount of resource bytes in locked memory
 	int _memoryLRU;		///< Amount of resource bytes under LRU control
 	Common::List<Resource *> _LRU; ///< Last Resource Used list
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 741968b..9fd5dc0 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -991,62 +991,93 @@ bool ResourceManager::addAudioSources() {
 	return true;
 }
 
-void ResourceManager::changeAudioDirectory(const Common::String &path) {
-	// Resources must be cleared before ResourceSources because the destructor
-	// of a Resource accesses its own ResourceSource
-	ResourceMap::iterator resIt = _resMap.begin();
-	while (resIt != _resMap.end()) {
-		Resource *resource = resIt->_value;
-		ResourceType type = resource->getType();
-		if (type == kResourceTypeMap ||
-			type == kResourceTypeAudio36 ||
-			type == kResourceTypeSync36) {
-
-			if (type == kResourceTypeMap && resource->getNumber() == 65535) {
-				++resIt;
+void ResourceManager::changeAudioDirectory(Common::String path) {
+	if (!path.empty()) {
+		path += "/";
+	}
+
+	const Common::String resAudPath = path + "RESOURCE.AUD";
+
+	if (!SearchMan.hasFile(resAudPath)) {
+		error("Could not find %s", resAudPath.c_str());
+	}
+
+	// When a IntMapResourceSource is scanned, it will not update existing
+	// resources. There is also no guarantee that there are exactly the same
+	// number of audio36/sync36/map resources in each audio directory.
+	// Therefore, all of these resources must be deleted before scanning.
+	for (ResourceMap::iterator it = _resMap.begin(); it != _resMap.end(); ++it) {
+		const ResourceType type = it->_key.getType();
+
+		if (type == kResourceTypeMap || type == kResourceTypeAudio36 || type == kResourceTypeSync36) {
+			if (type == kResourceTypeMap && it->_key.getNumber() == 65535) {
 				continue;
 			}
 
-			if (resource->_status == kResStatusLocked) {
-				resource->_lockers = 1;
-				unlockResource(resource);
-			}
-			if (resource->_status == kResStatusEnqueued) {
-				removeFromLRU(resource);
+			Resource *resource = it->_value;
+			if (resource) {
+				// If one of these resources ends up being locked here, it
+				// probably means Audio32 is using it and we need to stop
+				// playback of audio before switching directories
+				assert(!resource->isLocked());
+
+				if (resource->_status == kResStatusEnqueued) {
+					removeFromLRU(resource);
+				}
+
+				// A PatchResourceSource is not added to _sources and is
+				// automatically deleted when the corresponding Resource is
+				// deleted
+				delete resource;
 			}
-			delete resource;
-			_resMap.erase(resIt);
-		}
 
-		++resIt;
+			_resMap.erase(it);
+		}
 	}
 
-	Common::List<ResourceSource *>::iterator sourceIt = _sources.begin();
-	while (sourceIt != _sources.end()) {
-		ResourceSource *source = *sourceIt;
-		ResSourceType sourceType = source->getSourceType();
-		if ((sourceType == kSourceIntMap && source->_volumeNumber != 65535) ||
-			(sourceType == kSourceAudioVolume && source->getLocationName() != "RESOURCE.SFX")) {
+	for (SourcesList::iterator it = _sources.begin(); it != _sources.end(); ) {
+		IntMapResourceSource *mapSource = dynamic_cast<IntMapResourceSource *>(*it);
+		if (mapSource && mapSource->_mapNumber != 65535) {
+			delete *it;
+			it = _sources.erase(it);
+			continue;
+		}
 
-			sourceIt = _sources.erase(sourceIt);
-			delete source;
-		} else {
-			++sourceIt;
+		AudioVolumeResourceSource *volSource = dynamic_cast<AudioVolumeResourceSource *>(*it);
+		if (volSource && volSource->getLocationName().contains("RESOURCE.AUD")) {
+			delete volSource;
+			it = _sources.erase(it);
+			continue;
 		}
+
+		++it;
 	}
 
-	const Common::String audioResourceName = (path.empty() ? "" : path + "/") + "RESOURCE.AUD";
+	// # is used as the first pattern character to avoid matching non-audio maps
+	// like RESOURCE.MAP
+	Common::ArchiveMemberList mapFiles;
+	SearchMan.listMatchingMembers(mapFiles, path + "#*.MAP");
 
-	Common::List<ResourceId> resources = listResources(kResourceTypeMap);
-	Common::List<ResourceId>::iterator it;
-	for (it = resources.begin(); it != resources.end(); ++it) {
-		// Don't readd 65535.map or resource.sfx
-		if (it->getNumber() == 65535)
+	for (Common::ArchiveMemberList::const_iterator it = mapFiles.begin(); it != mapFiles.end(); ++it) {
+		const Common::ArchiveMemberPtr &file = *it;
+		assert(file);
+
+		const Common::String fileName = file->getName();
+		const int mapNo = atoi(fileName.c_str());
+
+		// Sound effects are the same across all audio directories, so ignore
+		// any new SFX map
+		if (mapNo == 65535) {
 			continue;
+		}
+
+		ResourceSource *newSource = new PatchResourceSource(path + fileName);
+		processPatch(newSource, kResourceTypeMap, mapNo);
+		Resource *mapResource = _resMap.getVal(ResourceId(kResourceTypeMap, mapNo));
+		assert(mapResource);
 
-		const Resource *mapResource = _resMap.getVal(*it);
-		ResourceSource *src = addSource(new IntMapResourceSource(mapResource->getResourceLocation(), 0, it->getNumber()));
-		addSource(new AudioVolumeResourceSource(this, audioResourceName, src, 0));
+		ResourceSource *audioMap = addSource(new IntMapResourceSource(mapResource->getResourceLocation(), 0, mapNo));
+		addSource(new AudioVolumeResourceSource(this, resAudPath, audioMap, 0));
 	}
 
 	scanNewSources();


Commit: f88bcb3ee911b5320df0e74515243855e19cf334
    https://github.com/scummvm/scummvm/commit/f88bcb3ee911b5320df0e74515243855e19cf334
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:32-05:00

Commit Message:
SCI32: Add deflang (default language) kGetConfig key for MGDX

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


diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 8b0125e..aaea889 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -422,6 +422,9 @@ reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) {
 	} else if (setting == "jumpto") {
 		// Hoyle 5 startup.
 		s->_segMan->strcpy(data, "");
+	} else if (setting == "deflang") {
+		// MGDX 4-language startup.
+		s->_segMan->strcpy(data, "");
 	} else {
 		error("GetConfig: Unknown configuration setting %s", setting.c_str());
 	}


Commit: 40e9963baa18754fd579a1183518b2a161d00cb3
    https://github.com/scummvm/scummvm/commit/40e9963baa18754fd579a1183518b2a161d00cb3
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:34-05:00

Commit Message:
SCI32: Deduplicate volume reset script patches & add to MGDX

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 6dcdaac..f5e6566 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -116,6 +116,7 @@ static const char *const selectorNameTable[] = {
 	"get",          // Torin
 	"set",          // Torin
 	"clear",        // Torin
+	"masterVolume", // SCI2 master volume reset
 #endif
 	NULL
 };
@@ -158,7 +159,8 @@ enum ScriptPatcherSelectors {
 	SELECTOR_test,
 	SELECTOR_get,
 	SELECTOR_set,
-	SELECTOR_clear
+	SELECTOR_clear,
+	SELECTOR_masterVolume
 #endif
 };
 
@@ -262,6 +264,24 @@ static const uint16 sci2BenchmarkPatch[] = {
 	PATCH_END
 };
 
+// The init code that runs in many SCI32 games unconditionally resets the music
+// volume, but the game should always use the volume stored in ScummVM.
+// Applies to at least: LSL6hires, MGDX, PQ:SWAT, QFG4
+static const uint16 sci2VolumeResetSignature[] = {
+	SIG_MAGICDWORD,
+	0x38, SIG_SELECTOR16(masterVolume), // pushi masterVolume
+	0x78,                               // push1
+	0x39, SIG_ADDTOOFFSET(+1),          // pushi [default volume]
+	0x81, 0x01,                         // lag 1
+	0x4a, SIG_UINT16(0x06),             // send 6
+	SIG_END
+};
+
+static const uint16 sci2VolumeResetPatch[] = {
+	0x32, PATCH_UINT16(8), // jmp 8 [past volume reset]
+	PATCH_END
+};
+
 // Torin/LSL7-specific version of sci2NumSavesSignature1/2
 // Applies to at least: English CD
 static const uint16 torinNumSavesSignature[] = {
@@ -2552,24 +2572,20 @@ static const uint16 larry6HiresPatchSetScale[] = {
 // Applies to at least: English CD
 static const uint16 larry6HiresSignatureVolumeReset[] = {
 	SIG_MAGICDWORD,
-	0x38, SIG_UINT16(0x221), // pushi $221 (masterVolume)
-	0x78,                    // push1
-	0x39, 0x0c,              // push $0c
-	0x81, 0x01,              // lag $01
-	0x4a, SIG_UINT16(0x06),  // send $6
-	0x35, 0x0b,              // ldi $0b
-	0xa1, 0xc2,              // sag $c2
+	0x35, 0x0b,                         // ldi $0b
+	0xa1, 0xc2,                         // sag $c2
 	SIG_END
 };
 
 static const uint16 larry6HiresPatchVolumeReset[] = {
-	0x32, PATCH_UINT16(12),  // jmp 12 [past volume changes]
+	0x32, PATCH_UINT16(1),  // jmp 1 [past volume change]
 	PATCH_END
 };
 
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry larry6HiresSignatures[] = {
-	{  true,    71, "disable volume reset on startup",             1, larry6HiresSignatureVolumeReset,  larry6HiresPatchVolumeReset },
+	{  true,    71, "disable volume reset on startup (1/2)",       1, sci2VolumeResetSignature,         sci2VolumeResetPatch },
+	{  true,    71, "disable volume reset on startup (2/2)",       1, larry6HiresSignatureVolumeReset,  larry6HiresPatchVolumeReset },
 	{  true,   270, "fix incorrect setScale call",                 1, larry6HiresSignatureSetScale,     larry6HiresPatchSetScale },
 	{  true, 64908, "disable video benchmarking",                  1, sci2BenchmarkSignature,           sci2BenchmarkPatch },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
@@ -3568,6 +3584,8 @@ static const uint16 mothergooseHiresPatchHorse[] = {
 
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry mothergooseHiresSignatures[] = {
+	{  true,     0, "disable volume reset on startup (1/2)",       2, sci2VolumeResetSignature,         sci2VolumeResetPatch },
+	{  true,    90, "disable volume reset on startup (2/2)",       1, sci2VolumeResetSignature,         sci2VolumeResetPatch },
 	{  true,   108, "bad logo rendering",                          1, mothergooseHiresSignatureLogo,    mothergooseHiresPatchLogo },
 	{  true,   318, "bad horse z-index",                           1, mothergooseHiresSignatureHorse,   mothergooseHiresPatchHorse },
 	SCI_SIGNATUREENTRY_TERMINATOR
@@ -3959,10 +3977,10 @@ static const SciScriptPatcherEntry pq4Signatures[] = {
 // Applies to at least: English CD
 static const uint16 pqSwatSignatureVolumeReset1[] = {
 	SIG_MAGICDWORD,
-	0x38, SIG_UINT16(0x21a), // pushi $21a (masterVolume)
-	0x78,                    // push1
-	0x39, 0x7f,              // push $7f
-	0x54, SIG_UINT16(0x06),  // self 6
+	0x38, SIG_SELECTOR16(masterVolume), // pushi masterVolume
+	0x78,                               // push1
+	0x39, 0x7f,                         // push $7f
+	0x54, SIG_UINT16(0x06),             // self 6
 	SIG_END
 };
 
@@ -3971,26 +3989,10 @@ static const uint16 pqSwatPatchVolumeReset1[] = {
 	PATCH_END
 };
 
-// pqInitCode::doit
-static const uint16 pqSwatSignatureVolumeReset2[] = {
-	SIG_MAGICDWORD,
-	0x38, SIG_UINT16(0x21a), // pushi $21a (masterVolume)
-	0x78,                    // push1
-	0x39, 0x0f,              // pushi $f
-	0x81, 0x01,              // lag 1
-	0x4a, SIG_UINT16(0x06),  // send 6
-	SIG_END
-};
-
-static const uint16 pqSwatPatchVolumeReset2[] = {
-	0x32, PATCH_UINT16(8), // jmp 8 [past volume reset]
-	PATCH_END
-};
-
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry pqSwatSignatures[] = {
-	{  true,     0, "disable volume reset on startup",             1, pqSwatSignatureVolumeReset1,       pqSwatPatchVolumeReset1 },
-	{  true,     1, "disable volume reset on startup",             1, pqSwatSignatureVolumeReset2,       pqSwatPatchVolumeReset2 },
+	{  true,     0, "disable volume reset on startup (1/2)",       1, pqSwatSignatureVolumeReset1,       pqSwatPatchVolumeReset1 },
+	{  true,     1, "disable volume reset on startup (2/2)",       1, sci2VolumeResetSignature,          sci2VolumeResetPatch },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 
@@ -4966,37 +4968,6 @@ static const SciScriptPatcherEntry qfg3Signatures[] = {
 #pragma mark -
 #pragma mark Quest for Glory 4
 
-// The init code that runs when QFG4 starts up unconditionally resets the
-// master music volume to 15, but the game should always use the volume stored
-// in ScummVM.
-// Applies to at least: English floppy
-static const uint16 qfg4SignatureVolumeReset[] = {
-	SIG_MAGICDWORD,
-	0x38, SIG_UINT16(0x215), // pushi $215 (masterVolume)
-	0x78,                    // push1
-	0x39, 0x0f,              // pushi $f
-	0x81, 0x01,              // lag 1 (Glory object)
-	0x4a, SIG_UINT16(0x06),  // send 6
-	SIG_END
-};
-
-// Same as above, but with a different masterVolume selector.
-// Applies to at least: English CD
-static const uint16 qfg4CDSignatureVolumeReset[] = {
-	SIG_MAGICDWORD,
-	0x38, SIG_UINT16(0x217), // pushi $217 (masterVolume)
-	0x78,                    // push1
-	0x39, 0x0f,              // pushi $f
-	0x81, 0x01,              // lag 1 (Glory object)
-	0x4a, SIG_UINT16(0x06),  // send 6
-	SIG_END
-};
-
-static const uint16 qfg4PatchVolumeReset[] = {
-	0x32, PATCH_UINT16(8),  // jmp 8 [past volume changes]
-	PATCH_END
-};
-
 // The trap init code incorrectly creates an int array for string data.
 // Applies to at least: English CD
 static const uint16 qfg4SignatureTrapArrayType[] = {
@@ -5040,8 +5011,7 @@ static const uint16 qfg4BenchmarkPatch[] = {
 
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry qfg4Signatures[] = {
-	{  true,     1, "disable volume reset on startup (floppy)",    1, qfg4SignatureVolumeReset,         qfg4PatchVolumeReset },
-	{  true,     1, "disable volume reset on startup (CD)",        1, qfg4CDSignatureVolumeReset,       qfg4PatchVolumeReset },
+	{  true,     1, "disable volume reset on startup",             1, sci2VolumeResetSignature,         sci2VolumeResetPatch },
 	{  true,     1, "disable video benchmarking",                  1, qfg4BenchmarkSignature,           qfg4BenchmarkPatch },
 	{  true,    83, "fix incorrect array type",                    1, qfg4SignatureTrapArrayType,       qfg4PatchTrapArrayType },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },


Commit: bfa6ad51558498106d856cec4dfa1c2ec60a7a04
    https://github.com/scummvm/scummvm/commit/bfa6ad51558498106d856cec4dfa1c2ec60a7a04
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:35-05:00

Commit Message:
SCI32: Use dynamic selector in QFG4 trap script patch

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 f5e6566..48ddf97 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4971,12 +4971,12 @@ static const SciScriptPatcherEntry qfg3Signatures[] = {
 // The trap init code incorrectly creates an int array for string data.
 // Applies to at least: English CD
 static const uint16 qfg4SignatureTrapArrayType[] = {
-	0x38, SIG_UINT16(0x92), // pushi $92 (new)
-	0x78,                   // push1
-	0x38, SIG_UINT16(0x80), // pushi $80 (128)
+	0x38, SIG_SELECTOR16(new), // pushi new
+	0x78,                      // push1
+	0x38, SIG_UINT16(0x80),    // pushi $80 (128)
 	SIG_MAGICDWORD,
-	0x51, 0x0b,             // class $b (IntArray)
-	0x4a, SIG_UINT16(0x06), // send 6
+	0x51, 0x0b,                // class $b (IntArray)
+	0x4a, SIG_UINT16(0x06),    // send 6
 	SIG_END
 };
 


Commit: dbdbb9b5b3bbf39b9075cc39aa38a51a43cdd5ec
    https://github.com/scummvm/scummvm/commit/dbdbb9b5b3bbf39b9075cc39aa38a51a43cdd5ec
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:36-05:00

Commit Message:
SCI32: Match 4-language MGDX extra save game data

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


diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 6c96607..1a6695f 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -367,7 +367,16 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) {
 			// Create a virtual file containing the save game description
 			// and avatar ID, as the game scripts expect.
 			int saveNo;
-			sscanf(name.c_str(), "%d.DTA", &saveNo);
+
+			// The 4-language release uses a slightly different filename
+			// structure that includes the letter of the language at the start
+			// of the filename
+			const int skip = name.firstChar() < '0' || name.firstChar() > '9';
+
+			if (sscanf(name.c_str() + skip, "%i.DTA", &saveNo) != 1) {
+				warning("Could not parse game filename %s", name.c_str());
+			}
+
 			saveNo += kSaveIdShift;
 
 			SavegameDesc save;


Commit: 5ab010e15f19fd94720b4199f3ab1c86e74842ad
    https://github.com/scummvm/scummvm/commit/5ab010e15f19fd94720b4199f3ab1c86e74842ad
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:37-05:00

Commit Message:
SCI32: Fix MGDX platform in detection tables

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 4d8290d..e7ea7d0 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2943,21 +2943,21 @@ static const struct ADGameDescription SciGameDescriptions[] = {
                                     GUIO_LINKSPEECHTOSFX, \
                                     GUIO_NOLAUNCHLOAD)
 
-	// Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
+	// Mixed-Up Mother Goose Deluxe - EN/ES Windows CD (supplied by markcoolio in bug report #2723810)
 	// Executable scanning reports "2.100.002"
 	{"mothergoosehires", "", {
 		{"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741},
 		{"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
 
-	// Mixed-Up Mother Goose Deluxe - Multilingual Windows CD (English/French/German/Spanish)
+	// Mixed-Up Mother Goose Deluxe - Multilingual Windows CD (EN/FR/DE/ES)
 	// Executable scanning reports "2.100.002"
 	{"mothergoosehires", "", {
 		{"resmap.000", 0, "ef611af561898dcfea87846919ebf3eb", 4969},
 		{"ressci.000", 0, "227685bc59d90821978d330713e44a7a", 17205800},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
 
 #undef GUIO_MOTHERGOOSEHIRES
 


Commit: 97f7308da3216c3e2c9a520573be2fc75639465f
    https://github.com/scummvm/scummvm/commit/97f7308da3216c3e2c9a520573be2fc75639465f
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:38-05:00

Commit Message:
SCI32: Add music volume UI sync for MGDX

Changed paths:
    engines/sci/engine/guest_additions.cpp
    engines/sci/engine/guest_additions.h
    engines/sci/engine/selector.cpp
    engines/sci/engine/selector.h


diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index 2cfed13..0f4818d 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -1023,6 +1023,10 @@ void GuestAdditions::syncInGameUI(const int16 musicVolume, const int16 sfxVolume
 	}
 
 	switch (g_sci->getGameId()) {
+	case GID_MOTHERGOOSEHIRES:
+		syncMGDXUI(musicVolume);
+		break;
+
 	case GID_PQ4:
 		syncPQ4UI(musicVolume);
 		break;
@@ -1125,6 +1129,23 @@ void GuestAdditions::syncPhant1UI(const int16 oldMusicVolume, const int16 musicV
 	}
 }
 
+void GuestAdditions::syncMGDXUI(const int16 musicVolume) const {
+	const reg_t sliderId = _segMan->findObjectByName("icon1");
+	if (!sliderId.isNull()) {
+		const int16 celNo = 7 - (musicVolume * 8 / (MUSIC_MASTERVOLUME_MAX + 1));
+		writeSelectorValue(_segMan, sliderId, SELECTOR(mainCel), celNo);
+		writeSelectorValue(_segMan, sliderId, SELECTOR(cel), celNo);
+
+		// There does not seem to be any good way to learn whether the
+		// volume slider is visible (and thus eligible for
+		// kUpdateScreenItem)
+		const reg_t planeId = readSelector(_segMan, sliderId, SELECTOR(plane));
+		if (g_sci->_gfxFrameout->getPlanes().findByObject(planeId) != nullptr) {
+			g_sci->_gfxFrameout->kernelUpdateScreenItem(sliderId);
+		}
+	}
+}
+
 void GuestAdditions::syncPQ4UI(const int16 musicVolume) const {
 	const SegmentId segment = _segMan->getScriptSegment(9, SCRIPT_GET_DONT_LOAD);
 	if (segment != 0 && _segMan->getScript(segment)->getLocalsCount() > 2) {
diff --git a/engines/sci/engine/guest_additions.h b/engines/sci/engine/guest_additions.h
index c920fa7..79f498a 100644
--- a/engines/sci/engine/guest_additions.h
+++ b/engines/sci/engine/guest_additions.h
@@ -348,6 +348,7 @@ private:
 	void syncGK1UI() const;
 	void syncGK2UI() const;
 	void syncLSL6HiresUI(const int16 musicVolume) const;
+	void syncMGDXUI(const int16 musicVolume) const;
 	void syncPhant1UI(const int16 oldMusicVolume, const int16 musicVolume, reg_t &musicGlobal, const int16 oldDacVolume, const int16 dacVolume, reg_t &dacGlobal) const;
 	void syncPQ4UI(const int16 musicVolume) const;
 	void syncPQSWATUI() const;
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 9c6921b..7740557 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -218,6 +218,7 @@ void Kernel::mapSelectors() {
 	FIND_SELECTOR(setSize);
 	FIND_SELECTOR(displayValue);
 	FIND_SELECTOR2(new_, "new");
+	FIND_SELECTOR(mainCel);
 #endif
 }
 
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index d97a883..b223262 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -175,6 +175,7 @@ struct SelectorCache {
 	Selector setSize; // for PQ4 volume sync
 	Selector displayValue; // for PQ:SWAT volume sync
 	Selector new_; // for Torin/LSL7 save/load patching
+	Selector mainCel; // for MGDX volume sync
 #endif
 };
 


Commit: ad8be1e506a4145f6c33a10f90c921253177621a
    https://github.com/scummvm/scummvm/commit/ad8be1e506a4145f6c33a10f90c921253177621a
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-07-24T19:36:39-05:00

Commit Message:
SCI32: Promote MGDX to ADGF_TESTING

Changed paths:
    engines/sci/detection_tables.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index e7ea7d0..3650de5 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2949,7 +2949,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741},
 		{"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_TESTING, GUIO_MOTHERGOOSEHIRES },
 
 	// Mixed-Up Mother Goose Deluxe - Multilingual Windows CD (EN/FR/DE/ES)
 	// Executable scanning reports "2.100.002"
@@ -2957,7 +2957,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resmap.000", 0, "ef611af561898dcfea87846919ebf3eb", 4969},
 		{"ressci.000", 0, "227685bc59d90821978d330713e44a7a", 17205800},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_MOTHERGOOSEHIRES },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_TESTING, GUIO_MOTHERGOOSEHIRES },
 
 #undef GUIO_MOTHERGOOSEHIRES
 





More information about the Scummvm-git-logs mailing list