[Scummvm-git-logs] scummvm branch-2-7-0 -> e0dd681f2353b54a7e538bb5cf96fbb29ea736fb

NMIError noreply at scummvm.org
Tue Jul 4 19:00:34 UTC 2023


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

Summary:
34a544dae3 AGOS: Add fallback for Simon 2 AdLib instruments
ca692ba547 AGOS: Add fallback for Simon 1 AdLib instruments
2129b297ff AGOS: Disable MT-32 on GM warning for PC-98xx
4cfe53bd13 AGOS: Add Simon 1 25th Anniversary detection
08c3cfb1e7 AGOS: Add Simon 1 AdLib SFX fallback
e0dd681f23 AGOS: Fix support for Simon 2 25th Anniversary


Commit: 34a544dae30e06f046167ae1ef47e3c5905264b4
    https://github.com/scummvm/scummvm/commit/34a544dae30e06f046167ae1ef47e3c5905264b4
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-04T21:00:07+02:00

Commit Message:
AGOS: Add fallback for Simon 2 AdLib instruments

GOG has not included the AdLib instruments file with their release of Simon the
Sorcerer 2 DOS version. The game would not start in ScummVM when this file was
missing and AdLib was selected. Added a fallback to the generic AdLib driver
with built-in instruments.
Also made the Windows version start with AdLib if an OPL2-only emulator is used.

Changed paths:
    engines/agos/midi.cpp


diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 2ba7ea5119b..dfd335e97bb 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -196,8 +196,12 @@ int MidiPlayer::open() {
 
 	// OPL3 is used for Windows and Acorn versions, all Simon 2 versions and
 	// if the user has set the OPL3 mode option. Otherwise OPL2 is used.
-	OPL::Config::OplType oplType = (_vm->getPlatform() != Common::kPlatformDOS ||
-		_vm->getGameType() == GType_SIMON2 || ConfMan.getBool("opl3_mode")) ? OPL::Config::kOpl3 : OPL::Config::kOpl2;
+	OPL::Config::OplType oplType =
+		MidiDriver_ADLIB_Multisource::detectOplType(OPL::Config::kOpl3) ? OPL::Config::kOpl3 : OPL::Config::kOpl2;
+	if (oplType == OPL::Config::kOpl3) {
+		oplType = (_vm->getPlatform() != Common::kPlatformDOS ||
+			_vm->getGameType() == GType_SIMON2 || ConfMan.getBool("opl3_mode")) ? OPL::Config::kOpl3 : OPL::Config::kOpl2;
+	}
 
 	// Create drivers and parsers for the different versions of the games.
 	if ((_vm->getGameType() == GType_ELVIRA1 && _vm->getPlatform() == Common::kPlatformDOS) ||
@@ -397,7 +401,7 @@ int MidiPlayer::open() {
 					// if there is a file called MIDPAK.AD, use it directly
 					warning("MidiPlayer::open - SIMON 2: using MIDPAK.AD");
 					_driverMsMusic = Audio::MidiDriver_Miles_AdLib_create("MIDPAK.AD", "");
-				} else {
+				} else if (Common::File::exists("SETUP.SHR")) {
 					// if there is no file called MIDPAK.AD, try to extract it from the file SETUP.SHR
 					// if we didn't do this, the user would be forced to "install" the game instead of simply
 					// copying all files from CD-ROM.
@@ -409,10 +413,22 @@ int MidiPlayer::open() {
 					warning("MidiPlayer::open - SIMON 2: using MIDPAK.AD extracted from SETUP.SHR");
 					_driverMsMusic = Audio::MidiDriver_Miles_AdLib_create("", "", midpakAdLibStream);
 					delete midpakAdLibStream;
+				} else {
+					// Fallback in case AdLib instrument definitions are missing.
+					GUI::MessageDialog dialog(
+						Common::U32String::format(
+							_("Could not find AdLib instrument definition file\n"
+							  "%s or %s. Without one of these files,\n"
+							  "the music will not sound the same as the original game."),
+							"MIDPAK.AD", "SETUP.SHR"),
+						_("OK"));
+					dialog.runModal();
+
+					_driverMsMusic = new MidiDriver_ADLIB_Multisource(oplType);
 				}
 			} else {
 				// Windows
-				_driverMsMusic = new MidiDriver_ADLIB_Multisource(OPL::Config::kOpl3);
+				_driverMsMusic = new MidiDriver_ADLIB_Multisource(oplType);
 			}
 			break;
 		case MT_MT32:


Commit: ca692ba5471bfcfac1f26db9ddae5293c8ab1eb1
    https://github.com/scummvm/scummvm/commit/ca692ba5471bfcfac1f26db9ddae5293c8ab1eb1
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-04T21:00:09+02:00

Commit Message:
AGOS: Add fallback for Simon 1 AdLib instruments

GOG has not included the AdLib instruments file with their release of Simon the
Sorcerer 1 DOS version. The game would not start in ScummVM when this file was
missing and AdLib was selected. Added a fallback to the generic AdLib driver
with built-in instruments.

Changed paths:
    engines/agos/midi.cpp


diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index dfd335e97bb..788a6509bdd 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -304,7 +304,22 @@ int MidiPlayer::open() {
 		case MT_ADLIB:
 			if (_vm->getPlatform() == Common::kPlatformDOS) {
 				// The DOS version AdLib driver uses an instrument bank file.
-				_driverMsMusic = createMidiDriverSimon1AdLib("MT_FM.IBK", oplType);
+				if (Common::File::exists("MT_FM.IBK")) {
+					_driverMsMusic = createMidiDriverSimon1AdLib("MT_FM.IBK", oplType);
+				} else {
+					// Fallback in case AdLib instrument definitions are missing.
+					GUI::MessageDialog dialog(
+						Common::U32String::format(
+							_("Could not find AdLib instrument definition file\n"
+							  "%s. Without this file,\n"
+							  "the music will not sound the same as the original game."),
+							"MT_FM.IBK"),
+						_("OK"));
+					dialog.runModal();
+
+					_driverMsMusic = new MidiDriver_ADLIB_Multisource(oplType);
+					_driverMsMusic->setInstrumentRemapping(MidiDriver::_mt32ToGm);
+				}
 				if (!(_vm->getFeatures() & GF_TALKIE)) {
 					// The DOS floppy version has AdLib MIDI SFX.
 					_driverMsSfx = _driverMsMusic;


Commit: 2129b297ffba884d95f8b9aaf0c77ae13ff0e035
    https://github.com/scummvm/scummvm/commit/2129b297ffba884d95f8b9aaf0c77ae13ff0e035
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-04T21:00:10+02:00

Commit Message:
AGOS: Disable MT-32 on GM warning for PC-98xx

Changed paths:
    engines/agos/midi.cpp


diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 788a6509bdd..31aa0abb2dc 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -178,7 +178,10 @@ int MidiPlayer::open() {
 		_dataType = MT_MT32;
 	}
 
-	if (_dataType == MT_MT32 && _deviceType == MT_GM) {
+	// Check for MT-32 playback on a GM device and show a warning.
+	// Elvira 1 PC-98xx driver remaps MT-32 instruments to GM like the
+	// original driver does, so no warning needed in that case.
+	if (_dataType == MT_MT32 && _deviceType == MT_GM && !_pc98) {
 		// Not a real MT32 / no MUNT
 		::GUI::MessageDialog dialog(_(
 			"You appear to be using a General MIDI device,\n"


Commit: 4cfe53bd1397fd913d11f660f4630c79f0bfc315
    https://github.com/scummvm/scummvm/commit/4cfe53bd1397fd913d11f660f4630c79f0bfc315
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-04T21:00:11+02:00

Commit Message:
AGOS: Add Simon 1 25th Anniversary detection

Adds detection entries for the new versions in the 25th Anniversary editions.
The remaining language versions are already detected.
To use the 25th Anniversary versions you have to copy the files from the
subdirectory of the language you want to use to the main directory, then detect
the main directory; or just detect without copying for English CD.

Changed paths:
    engines/agos/detection_tables.h


diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index a1207306554..4dde2422dc1 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -2048,6 +2048,131 @@ static const AGOSGameDescription gameDescriptions[] = {
 		GF_TALKIE
 	},
 
+	// Simon the Sorcerer 1 - 25th Anniversary Edition - English CD
+	{
+		{
+			"simon1",
+			"25th Anniversary Edition",
+
+			{
+				{ "gamepc",			GAME_BASEFILE,	"a21272b3c51ebd18bcbfe88715340924", 36191},
+				{ "icon.dat",		GAME_ICONFILE,	"22107c24dfb31b66ac503c28a6e20b19", 14361},
+				{ "simon.gme",		GAME_GMEFILE,	"b1b18d0731b64c0738c5cc4a2ee792fc", 7030377},
+				{ "stripped.txt",	GAME_STRFILE,	"a27e87a9ba21212d769804b3df47bfb2", 252},
+				{ "tbllist",		GAME_TBLFILE,	"d198a80de2c59e4a0cd24b98814849e8", 711},
+				AD_LISTEND
+			},
+			Common::EN_ANY,
+			Common::kPlatformWindows,
+			ADGF_CD,
+			GUIO3(GUIO_NOSUBTITLES, GAMEOPTION_WINDOWS_TEMPOS, GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON1,
+		GID_SIMON1,
+		GF_TALKIE
+	},
+
+	// Simon the Sorcerer 1 - 25th Anniversary Edition - Spanish CD
+	{
+		{
+			"simon1",
+			"25th Anniversary Edition",
+
+			{
+				{ "gamepc",			GAME_BASEFILE,	"71adc00b0ee14a59ef4f969f2f52829d", 37877},
+				{ "icon.dat",		GAME_ICONFILE,	"22107c24dfb31b66ac503c28a6e20b19", 14361},
+				{ "simon.gme",		GAME_GMEFILE,	"eff2774a73890b9eac533db90cd1afa1", 7030485},
+				{ "stripped.txt",	GAME_STRFILE,	"9d31bef42db1a8abe4e9f368014df1d5", 252},
+				{ "tbllist",		GAME_TBLFILE,	"d198a80de2c59e4a0cd24b98814849e8", 711},
+				AD_LISTEND
+			},
+			Common::ES_ESP,
+			Common::kPlatformDOS,
+			ADGF_CD,
+			GUIO3(GAMEOPTION_OPL3_MODE, GAMEOPTION_DOS_TEMPOS, GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON1,
+		GID_SIMON1,
+		GF_TALKIE
+	},
+
+	// Simon the Sorcerer 1 - 25th Anniversary Edition - French CD
+	{
+		{
+			"simon1",
+			"25th Anniversary Edition",
+
+			{
+				{ "gamepc",			GAME_BASEFILE,	"226e152e0d2333d46c091a0b71de84f0", 39354},
+				{ "icon.dat",		GAME_ICONFILE,	"22107c24dfb31b66ac503c28a6e20b19", 14361},
+				{ "simon.gme",		GAME_GMEFILE,	"638049fa5d41b81fb6fb11671721b871", 7041803},
+				{ "stripped.txt",	GAME_STRFILE,	"ef51ac74c946881ae4d7ca66cc7a0d1e", 252},
+				{ "tbllist",		GAME_TBLFILE,	"d198a80de2c59e4a0cd24b98814849e8", 711},
+				AD_LISTEND
+			},
+			Common::FR_FRA,
+			Common::kPlatformDOS,
+			ADGF_CD,
+			GUIO3(GAMEOPTION_OPL3_MODE, GAMEOPTION_DOS_TEMPOS, GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON1,
+		GID_SIMON1,
+		GF_TALKIE
+	},
+
+	// Simon the Sorcerer 1 - 25th Anniversary Edition - Hebrew CD Subtitled
+	{
+		{
+			"simon1",
+			"25th Anniversary Edition",
+
+			{
+				{ "gamepc",			GAME_BASEFILE,	"c5a1fe539d96e22e12b7b6e2576090ad", 34376},
+				{ "icon.dat",		GAME_ICONFILE,	"22107c24dfb31b66ac503c28a6e20b19", 14361},
+				{ "simon.gme",		GAME_GMEFILE,	"a34b2c8642f2e3676d7088b5c8b3e884", 6976948},
+				{ "stripped.txt",	GAME_STRFILE,	"9d31bef42db1a8abe4e9f368014df1d5", 252},
+				{ "tbllist",		GAME_TBLFILE,	"d198a80de2c59e4a0cd24b98814849e8", 711},
+				AD_LISTEND
+			},
+			Common::HE_ISR,
+			Common::kPlatformDOS,
+			ADGF_CD,
+			GUIO3(GAMEOPTION_OPL3_MODE, GAMEOPTION_DOS_TEMPOS, GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON1,
+		GID_SIMON1,
+		GF_TALKIE
+	},
+
+	// Simon the Sorcerer 1 - 25th Anniversary Edition - Italian CD
+	{
+		{
+			"simon1",
+			"25th Anniversary Edition",
+
+			{
+				{ "gamepc",			GAME_BASEFILE,	"6fd37fefa04315fdd5889e52e4c01731", 37840},
+				{ "icon.dat",		GAME_ICONFILE,	"22107c24dfb31b66ac503c28a6e20b19", 14361},
+				{ "simon.gme",		GAME_GMEFILE,	"52e315e0e02feca86d15cc82e3306b6c", 7035767},
+				{ "stripped.txt",	GAME_STRFILE,	"9d31bef42db1a8abe4e9f368014df1d5", 252},
+				{ "tbllist",		GAME_TBLFILE,	"d198a80de2c59e4a0cd24b98814849e8", 711},
+				AD_LISTEND
+			},
+			Common::IT_ITA,
+			Common::kPlatformDOS,
+			ADGF_CD,
+			GUIO3(GAMEOPTION_OPL3_MODE, GAMEOPTION_DOS_TEMPOS, GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON1,
+		GID_SIMON1,
+		GF_TALKIE
+	},
+
 	// Simon the Sorcerer 2 - English DOS Floppy
 	{
 		{


Commit: 08c3cfb1e76af67a308c1b9c43535094226f9018
    https://github.com/scummvm/scummvm/commit/08c3cfb1e76af67a308c1b9c43535094226f9018
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-04T21:00:12+02:00

Commit Message:
AGOS: Add Simon 1 AdLib SFX fallback

Changed paths:
    engines/agos/midi.cpp


diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 31aa0abb2dc..8ab968d1102 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -365,7 +365,22 @@ int MidiPlayer::open() {
 					ConfMan.getBool("multi_midi")) {
 				// The DOS floppy version can use AdLib MIDI SFX with MT-32
 				// music.
-				_driverMsSfx = createMidiDriverSimon1AdLib("MT_FM.IBK", oplType);
+				if (Common::File::exists("MT_FM.IBK")) {
+					_driverMsSfx = createMidiDriverSimon1AdLib("MT_FM.IBK", oplType);
+				} else {
+					// Fallback in case AdLib instrument definitions are missing.
+					GUI::MessageDialog dialog(
+						Common::U32String::format(
+							_("Could not find AdLib instrument definition file\n"
+							  "%s. Without this file,\n"
+							  "the sound effects will not sound the same as the original game."),
+							"MT_FM.IBK"),
+						_("OK"));
+					dialog.runModal();
+
+					_driverMsSfx = new MidiDriver_ADLIB_Multisource(oplType);
+					_driverMsSfx->setInstrumentRemapping(MidiDriver::_mt32ToGm);
+				}
 			}
 
 			break;


Commit: e0dd681f2353b54a7e538bb5cf96fbb29ea736fb
    https://github.com/scummvm/scummvm/commit/e0dd681f2353b54a7e538bb5cf96fbb29ea736fb
Author: Coen Rampen (crampen at gmail.com)
Date: 2023-07-04T21:00:14+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