[Scummvm-cvs-logs] SF.net SVN: scummvm:[52500] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Sep 2 23:50:01 CEST 2010


Revision: 52500
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52500&view=rev
Author:   thebluegr
Date:     2010-09-02 21:50:00 +0000 (Thu, 02 Sep 2010)

Log Message:
-----------
SCI: Show a warning window regarding GM in some games.

Sierra has released a patch adding after market General MIDI support for 8 SCI1
games (LSL1, LSL5, Hoyle 3, SQ1, SQ4, Eco1 floppy, Longbow and Fairy Tales). If
the user has selected the General MIDI music driver in one of these games and
no associated MIDI patch is found, show an informational dialog on game startup
in order to inform the user to download Sierra's MIDI patch, together with some
short instructions.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sound/music.cpp
    scummvm/trunk/engines/sci/sound/music.h
    scummvm/trunk/engines/sci/sound/soundcmd.cpp
    scummvm/trunk/engines/sci/sound/soundcmd.h

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-09-02 19:34:23 UTC (rev 52499)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-09-02 21:50:00 UTC (rev 52500)
@@ -310,6 +310,39 @@
 		}
 	}
 
+	// Show a warning if the user has selected a General MIDI device, no GM patch exists
+	// (i.e. patch 4) and the game is one of the known 8 SCI1 games that Sierra has provided
+	// after market patches for in their "General MIDI Utility".
+	if (_soundCmd->getMusicType() == MT_GM) {
+		if (!_resMan->findResource(ResourceId(kResourceTypePatch, 4), 0)) {
+			switch (getGameId()) {
+			case GID_ECOQUEST:
+			case GID_HOYLE3:
+			case GID_LSL1:
+			case GID_LSL5:
+			case GID_LONGBOW:
+			case GID_SQ1:
+			case GID_SQ4:
+			case GID_FAIRYTALES:
+				showScummVMDialog("You have selected General MIDI as a sound device. Sierra "
+								  "has provided after-market support for General MIDI for this "
+								  "game in their \"General MIDI Utility\". Please, apply this "
+								  "patch in order to enjoy MIDI music with this game. Once you "
+								  "have obtained it, you can unpack all of the included *.PAT "
+								  "files in your ScummVM extras folder and ScummVM will add the "
+								  "appropriate patch automatically. Alternatively, you can follow "
+								  "the instructions in the READ.ME file included in the patch and "
+								  "rename the associated *.PAT file to 4.PAT and place it in the "
+								  "game folder. Without this patch, General MIDI music for this "
+								  "game will sound badly distorted.");
+				break;
+			default:
+				break;
+			}
+		}
+	}
+
+
 	runGame();
 
 	ConfMan.flushToDisk();

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-09-02 19:34:23 UTC (rev 52499)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-09-02 21:50:00 UTC (rev 52500)
@@ -67,8 +67,9 @@
 	// Default to MIDI in SCI2.1+ games, as many don't have AdLib support.
 	Common::Platform platform = g_sci->getPlatform();
 	uint32 dev = MidiDriver::detectDevice((getSciVersion() >= SCI_VERSION_2_1) ? (MDT_PCSPK | MDT_PCJR | MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM) : (MDT_PCSPK | MDT_PCJR | MDT_ADLIB | MDT_MIDI));
+	_musicType = MidiDriver::getMusicType(dev);
 
-	switch (MidiDriver::getMusicType(dev)) {
+	switch (_musicType) {
 	case MT_ADLIB:
 		// FIXME: There's no Amiga sound option, so we hook it up to AdLib
 		if (g_sci->getPlatform() == Common::kPlatformAmiga || platform == Common::kPlatformMacintosh)

Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sound/music.h	2010-09-02 19:34:23 UTC (rev 52499)
+++ scummvm/trunk/engines/sci/sound/music.h	2010-09-02 21:50:00 UTC (rev 52500)
@@ -155,6 +155,7 @@
 	void soundSetSoundOn(bool soundOnFlag);
 	uint16 soundGetVoices();
 	uint32 soundGetTempo() const { return _dwTempo; }
+	MusicType soundGetMusicType() const { return _musicType; }
 
 	bool soundIsActive(MusicEntry *pSnd) {
 		assert(pSnd->pStreamAud != 0);
@@ -218,6 +219,7 @@
 	MusicEntry *_usedChannel[16];
 
 	MidiCommandQueue _queuedCommands;
+	MusicType _musicType;
 
 	int _driverFirstChannel;
 };

Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-09-02 19:34:23 UTC (rev 52499)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-09-02 21:50:00 UTC (rev 52500)
@@ -696,4 +696,9 @@
 	_music->pauseAll(pause);
 }
 
+MusicType SoundCommandParser::getMusicType() const {
+	assert(_music);
+	return _music->soundGetMusicType();
+}
+
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/sound/soundcmd.h
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.h	2010-09-02 19:34:23 UTC (rev 52499)
+++ scummvm/trunk/engines/sci/sound/soundcmd.h	2010-09-02 21:50:00 UTC (rev 52500)
@@ -27,6 +27,7 @@
 #define SCI_SOUNDCMD_H
 
 #include "common/list.h"
+#include "sound/mididrv.h"	// for MusicType
 #include "sci/engine/state.h"
 
 namespace Sci {
@@ -67,6 +68,8 @@
 	void processPlaySound(reg_t obj);
 	void processStopSound(reg_t obj, bool sampleFinishedPlaying);
 
+	MusicType getMusicType() const;
+
 	/**
 	 * Synchronizes the current state of the music list to the rest of the engine, so that
 	 * the changes that the sound thread makes to the music are registered with the engine


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list