[Scummvm-git-logs] scummvm master -> 00d273fc5564959cfa97fa537eb8dca99501554a

NMIError noreply at scummvm.org
Mon Jul 3 19:57:45 UTC 2023


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:
00d273fc55 AGOS: Fix support for Simon 2 25th Anniversary


Commit: 00d273fc5564959cfa97fa537eb8dca99501554a
    https://github.com/scummvm/scummvm/commit/00d273fc5564959cfa97fa537eb8dca99501554a
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-03T21:57:39+02:00

Commit Message:
AGOS: Fix support for Simon 2 25th Anniversary

This adds detection entries for the German and French versions. All language
versions except Russian use WAV sound effects and GM SMF MIDI data, so the
platform is changed to Windows. These versions also contain the MT-32 MIDI data
in XMIDI format, so support for this is added as well. Finally, the MT-32 track
10 workaround has been updated to deal with these versions.

Changed paths:
    engines/agos/agos.h
    engines/agos/detection_tables.h
    engines/agos/intern_detection.h
    engines/agos/midi.cpp
    engines/agos/res_snd.cpp


diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 9ceb1dd3368..d8ee88da835 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1298,11 +1298,12 @@ protected:
 	void windowScroll(WindowBlock *window);
 	virtual void windowDrawChar(WindowBlock *window, uint x, uint y, byte chr);
 
-	// Loads the MIDI data for the specified track. The forceSimon2Gm parameter
-	// forces loading the MIDI data from the GM data set and activates GM to
-	// MT-32 instrument remapping. This is useful only for a specific
+	// Loads the MIDI data for the specified track. The forceSimon2GmData
+	// parameter forces loading the MIDI data from the GM data set.
+	// The useSimon2Remapping parameter activates GM to MT-32 instrument
+	// remapping. These parameters are useful only for a specific
 	// workaround (see AGOSEngine_Simon2::playMusic for more details).
-	void loadMusic(uint16 track, bool forceSimon2Gm = false);
+	void loadMusic(uint16 track, bool forceSimon2GmData = false, bool useSimon2Remapping = false);
 	void playModule(uint16 music);
 	virtual void playMusic(uint16 music, uint16 track);
 	void stopMusic();
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index 4dde2422dc1..dc3fcc030e6 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -2766,17 +2766,68 @@ static const AGOSGameDescription gameDescriptions[] = {
 				AD_LISTEND
 			},
 			Common::EN_ANY,
-			Common::kPlatformDOS,
+			Common::kPlatformWindows,
 			ADGF_CD,
 			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
 		},
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
+	},
+
+	// Simon the Sorcerer 2 - German with MT-32 hack (25th Anniversary Edition)
+	{
+		{
+			"simon2",
+			"25th Anniversary Edition",
+
+			{
+				{ "gsptr30",		GAME_BASEFILE, "a76ea940076b5d9316796dea225a9b69", 62346 },
+				{ "icon.dat",		GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab", 18089 },
+				{ "simon2.gme",		GAME_GMEFILE, "8aab32f1ed8567b6b9fa46139a1e492c", 20065511 },
+				{ "stripped.txt",	GAME_STRFILE, "6de6292c9ac11bfb2e70fdb0f773ba85", 171 },
+				{ "tbllist",		GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9", 513 },
+				AD_LISTEND
+			},
+			Common::DE_DEU,
+			Common::kPlatformWindows,
+			ADGF_CD,
+			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON2,
+		GID_SIMON2,
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
+	},
+
+	// Simon the Sorcerer 2 - French with MT-32 hack (25th Anniversary Edition)
+	{
+		{
+			"simon2",
+			"25th Anniversary Edition",
+
+			{
+				{ "gsptr30",		GAME_BASEFILE, "43b3a04d2f0a0cbd1b024c814856561a", 60857 },
+				{ "icon.dat",		GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab", 18089 },
+				{ "simon2.gme",		GAME_GMEFILE, "d71807365d4e13063009ea0b9a849190", 20072692 },
+				{ "stripped.txt",	GAME_STRFILE, "5ea27977b4d7dcfd50eb5074e162ebbf", 171 },
+				{ "tbllist",		GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9", 513 },
+				AD_LISTEND
+			},
+			Common::FR_FRA,
+			Common::kPlatformWindows,
+			ADGF_CD,
+			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON2,
+		GID_SIMON2,
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
 	// Simon the Sorcerer 2 - Russian Fan with MT-32 hack (25th Anniversary Edition)
+	// Note: unlike the other 25th Anniversary versions, this uses VOC and XMIDI data.
 	{
 		{
 			"simon2",
@@ -2798,7 +2849,7 @@ static const AGOSGameDescription gameDescriptions[] = {
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE
+		GF_TALKIE | GF_MT32_TRACK10_FIX
 	},
 
 	// Simon the Sorcerer 2 - Polish with MT-32 hack (25th Anniversary Edition)
@@ -2816,14 +2867,14 @@ static const AGOSGameDescription gameDescriptions[] = {
 				AD_LISTEND
 			},
 			Common::PL_POL,
-			Common::kPlatformDOS,
+			Common::kPlatformWindows,
 			ADGF_CD,
 			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
 		},
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE | GF_WAVSFX
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
 	// Simon the Sorcerer 2 - Hebrew with MT-32 hack (25th Anniversary Edition)
@@ -2841,14 +2892,14 @@ static const AGOSGameDescription gameDescriptions[] = {
 				AD_LISTEND
 			},
 			Common::HE_ISR,
-			Common::kPlatformDOS,
+			Common::kPlatformWindows,
 			ADGF_CD,
 			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
 		},
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE | GF_WAVSFX
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
 	// Simon the Sorcerer 2 - Italian with MT-32 hack (25th Anniversary Edition)
@@ -2866,14 +2917,14 @@ static const AGOSGameDescription gameDescriptions[] = {
 				AD_LISTEND
 			},
 			Common::IT_ITA,
-			Common::kPlatformDOS,
+			Common::kPlatformWindows,
 			ADGF_CD,
 			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
 		},
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE | GF_WAVSFX
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
 	// Simon the Sorcerer 2 - Czech with MT-32 hack (25th Anniversary Edition)
@@ -2891,14 +2942,14 @@ static const AGOSGameDescription gameDescriptions[] = {
 				AD_LISTEND
 			},
 			Common::CS_CZE,
-			Common::kPlatformDOS,
+			Common::kPlatformWindows,
 			ADGF_CD,
 			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
 		},
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE | GF_WAVSFX
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
 	// Simon the Sorcerer 2 - Spanish with MT-32 hack (25th Anniversary Edition)
@@ -2916,14 +2967,14 @@ static const AGOSGameDescription gameDescriptions[] = {
 				AD_LISTEND
 			},
 			Common::ES_ESP,
-			Common::kPlatformDOS,
+			Common::kPlatformWindows,
 			ADGF_CD,
 			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
 		},
 
 		GType_SIMON2,
 		GID_SIMON2,
-		GF_TALKIE | GF_WAVSFX
+		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
 	// The Feeble Files - English DOS Demo
diff --git a/engines/agos/intern_detection.h b/engines/agos/intern_detection.h
index a9a6c82b018..9a783d972f6 100644
--- a/engines/agos/intern_detection.h
+++ b/engines/agos/intern_detection.h
@@ -55,7 +55,9 @@ enum GameFeatures {
 	GF_DEMO             = 1 << 8,
 	GF_PACKED           = 1 << 9,
 	GF_BROKEN_FF_RATING = 1 << 10,
-	GF_WAVSFX           = 1 << 11
+	GF_WAVSFX           = 1 << 11,
+	GF_MT32_XMIDI       = 1 << 12,
+	GF_MT32_TRACK10_FIX = 1 << 13
 };
 
 enum GameFileTypes {
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 8ab968d1102..6f697a55dc7 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -481,7 +481,7 @@ int MidiPlayer::open() {
 		_driver = _driverMsMusic;
 
 		// Create the MIDI parser(s) for the format used by the platform.
-		if (_vm->getPlatform() == Common::kPlatformDOS) {
+		if (_vm->getPlatform() == Common::kPlatformDOS || (usesMT32Data() && (_vm->getFeatures() & GF_MT32_XMIDI))) {
 			// DOS uses Miles XMIDI.
 			_parserMusic = MidiParser::createParser_XMIDI(MidiParser::defaultXMidiCallback, 0, 0);
 		} else {
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index a49b002a062..7ef511b29eb 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -131,17 +131,17 @@ void AGOSEngine::skipSpeech() {
 	}
 }
 
-void AGOSEngine::loadMusic(uint16 music, bool forceSimon2Gm) {
+void AGOSEngine::loadMusic(uint16 music, bool forceSimon2GmData, bool useSimon2Remapping) {
 	stopMusic();
 
-	uint16 indexBase = forceSimon2Gm ? MUSIC_INDEX_BASE_SIMON2_GM : _musicIndexBase;
+	uint16 indexBase = forceSimon2GmData ? MUSIC_INDEX_BASE_SIMON2_GM : _musicIndexBase;
 
 	_gameFile->seek(_gameOffsetsPtr[indexBase + music - 1], SEEK_SET);
 	_midi->load(_gameFile);
 
 	// Activate Simon 2 GM to MT-32 remapping if we force GM, otherwise
 	// deactivate it (in case it was previously activated).
-	_midi->setSimon2Remapping(forceSimon2Gm);
+	_midi->setSimon2Remapping(useSimon2Remapping);
 
 	_lastMusicPlayed = music;
 	_nextMusicToPlay = -1;
@@ -240,10 +240,15 @@ void AGOSEngine_Simon2::playMusic(uint16 music, uint16 track) {
 		// and does not restart until the next scene.
 		// We fix this by loading the GM version of track 10 and remapping the
 		// instruments to MT-32.
-
-		// Reload track 10 and force GM for all subtracks but the first (this
-		// also activates the instrument remapping).
-		loadMusic(10, track > 0);
+		// The 25th Anniversary Editions of the game attempted to fix this
+		// problem by replacing the track 10 MT-32 data with the track 10 GM
+		// data. For these versions, we can just load the MT-32 data. However,
+		// we now have to remap instruments for all subtracks.
+
+		// Reload track 10 using GM data (if necessary) and activate instrument
+		// remapping.
+		bool track10Fix = getFeatures() & GF_MT32_TRACK10_FIX;
+		loadMusic(10, !track10Fix && track > 0, track10Fix || track > 0);
 	}
 
 	_midi->play(track);




More information about the Scummvm-git-logs mailing list