aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-09-02 21:50:00 +0000
committerFilippos Karapetis2010-09-02 21:50:00 +0000
commitd87fa1c8903ba21a2ce5d5946947a50af841700a (patch)
tree072dac53a41b62c101e687170e25183f3da6d539
parent3606e51e76a82d8f73c9ea4f4c6996896b9f5594 (diff)
downloadscummvm-rg350-d87fa1c8903ba21a2ce5d5946947a50af841700a.tar.gz
scummvm-rg350-d87fa1c8903ba21a2ce5d5946947a50af841700a.tar.bz2
scummvm-rg350-d87fa1c8903ba21a2ce5d5946947a50af841700a.zip
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. svn-id: r52500
-rw-r--r--engines/sci/sci.cpp33
-rw-r--r--engines/sci/sound/music.cpp3
-rw-r--r--engines/sci/sound/music.h2
-rw-r--r--engines/sci/sound/soundcmd.cpp5
-rw-r--r--engines/sci/sound/soundcmd.h3
5 files changed, 45 insertions, 1 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 4b5888a245..8fc0f667d3 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -310,6 +310,39 @@ Common::Error SciEngine::run() {
}
}
+ // 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();
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 74dca191a8..fe1d4fdbbb 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -67,8 +67,9 @@ void SciMusic::init() {
// 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)
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index dfef49e3bf..b10f64aa18 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -155,6 +155,7 @@ public:
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 @@ private:
MusicEntry *_usedChannel[16];
MidiCommandQueue _queuedCommands;
+ MusicType _musicType;
int _driverFirstChannel;
};
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index c85d4c90a6..84aedc8515 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -696,4 +696,9 @@ void SoundCommandParser::pauseAll(bool pause) {
_music->pauseAll(pause);
}
+MusicType SoundCommandParser::getMusicType() const {
+ assert(_music);
+ return _music->soundGetMusicType();
+}
+
} // End of namespace Sci
diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h
index 4f006c20d8..61371d903f 100644
--- a/engines/sci/sound/soundcmd.h
+++ b/engines/sci/sound/soundcmd.h
@@ -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 @@ public:
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