aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-11-25 01:19:45 +0000
committerFilippos Karapetis2010-11-25 01:19:45 +0000
commit75082609544bc64e3cb8d72e424f1fd81ff4126f (patch)
tree4d2baaed802ec9df15664488da0488ea76a4ea47 /engines
parent169c6be32b99e898a3a52ba394ea6c025642e561 (diff)
downloadscummvm-rg350-75082609544bc64e3cb8d72e424f1fd81ff4126f.tar.gz
scummvm-rg350-75082609544bc64e3cb8d72e424f1fd81ff4126f.tar.bz2
scummvm-rg350-75082609544bc64e3cb8d72e424f1fd81ff4126f.zip
SCI: Added support for the alternative GM tracks of the Windows version of KQ5CD (bug #3041239)
Note that the empty GM track for the Sierra logo makes the game hang, so the MT-32 track is used, which sounds awful svn-id: r54464
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/detection_tables.h12
-rw-r--r--engines/sci/resource_audio.cpp17
-rw-r--r--engines/sci/sound/drivers/midi.cpp13
3 files changed, 40 insertions, 2 deletions
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index a8086b903f..ca4f041100 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1128,6 +1128,18 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ // King's Quest 5 - English DOS CD (from the King's Quest Collection)
+ // Executable scanning reports "x.yyy.zzz", VERSION file reports "1.000.052"
+ // SCI interpreter version 1.000.784
+ // Same entry as the DOS version above. This one is used for the alternate
+ // MIDI music tracks in the Windows version
+ {"kq5", "CD", {
+ {"resource.map", 0, "f68ba690e5920725dcf9328001b90e33", 13122},
+ {"resource.000", 0, "449471bfd77be52f18a3773c7f7d843d", 571368},
+ {"resource.001", 0, "b45a581ff8751e052c7e364f58d3617f", 16800210},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE },
+
// King's Quest 5 - English DOS Floppy
// SCI interpreter version 1.000.060
{"kq5", "", {
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 9949373852..a61c1f6ce7 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -562,6 +562,13 @@ bool ResourceManager::isGMTrackIncluded() {
}
SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVersion soundVersion) : _resMan(resMan), _soundVersion(soundVersion) {
+ // Modify the resourceId for the Windows version of KQ5, like SSCI did.
+ // FIXME: For some reason, song 1500 (the Sierra theme) doesn't work
+ // correctly, and the game hangs. A relevant hack because of this exists
+ // in getTrackByType()
+ if (g_sci->getGameId() == GID_KQ5 && g_sci->getPlatform() == Common::kPlatformWindows && resourceNr != 500)
+ resourceNr += 1000;
+
Resource *resource = _resMan->findResource(ResourceId(kResourceTypeSound, resourceNr), true);
int trackNr, channelNr;
if (!resource)
@@ -734,6 +741,16 @@ SoundResource::Track *SoundResource::getTrackByType(byte type) {
if (_tracks[trackNr].type == type)
return &_tracks[trackNr];
}
+
+ // HACK for the Sierra theme (song 500) in KQ5CD Windows. Because the
+ // associated GM track (1500) hangs, we fall back to the MT-32 track
+ // for that one inside SoundResource(). Thus, use the appropriate
+ // MT-32 play mask for that song, too.
+ if (g_sci->getGameId() == GID_KQ5 && g_sci->getPlatform() == Common::kPlatformWindows && _innerResource->getNumber() == 500) {
+ warning("KQ5CD Windows: falling back to the MT-32 track for the Sierra logo screen"); // because this will sound awful without mapping...
+ return getTrackByType(0x0c);
+ }
+
return NULL;
}
diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index ccb1c87d02..5e81d17df4 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -840,6 +840,10 @@ int MidiPlayer_Midi::open(ResourceManager *resMan) {
_percussionVelocityScale[i] = 127;
}
+ // Don't do any mapping for the Windows version of KQ5CD
+ if (g_sci && g_sci->getGameId() == GID_KQ5 && g_sci->getPlatform() == Common::kPlatformWindows)
+ return 0;
+
Resource *res = NULL;
if (_isMt32) {
@@ -963,10 +967,15 @@ byte MidiPlayer_Midi::getPlayId() const {
case SCI_VERSION_0_LATE:
return 0x01;
default:
- if (_isMt32)
+ if (_isMt32) {
return 0x0c;
- else
+ } else {
+ // Use the GM play mask for the Windows version of KQ5CD.
+ if (g_sci && g_sci->getGameId() == GID_KQ5 && g_sci->getPlatform() == Common::kPlatformWindows)
+ return 0x07;
+
return _useMT32Track ? 0x0c : 0x07;
+ }
}
}