SCI32: Force General MIDI for games that support nothing else

* MGDX has only GM music;
* KQ7 1.x's AdLib data is incomplete, so is not usable even though
  it is partially there

Fixes Trac#9789.
This commit is contained in:
Colin Snover 2017-07-07 11:30:07 -05:00
parent 90cd56e4b6
commit 07d6ffd989
3 changed files with 37 additions and 1 deletions

View File

@ -694,6 +694,23 @@ bool GameFeatures::useAltWinGMSound() {
}
}
bool GameFeatures::generalMidiOnly() {
#ifdef ENABLE_SCI32
switch (g_sci->getGameId()) {
case GID_MOTHERGOOSEHIRES:
return true;
case GID_KQ7: {
SoundResource sound(13, g_sci->getResMan(), detectDoSoundType());
return (sound.getTrackByType(/* AdLib */ 0) == nullptr);
}
default:
break;
}
#endif
return false;
}
// PseudoMouse was added during SCI1
// PseudoMouseAbility is about a tiny difference in the keyboard driver, which sets the event type to either
// 40h (old behaviour) or 44h (the keyboard driver actually added 40h to the existing value).

View File

@ -228,6 +228,11 @@ public:
*/
bool useAltWinGMSound();
/**
* Checks if the game only supports General MIDI for music playback.
*/
bool generalMidiOnly();
/**
* Forces DOS soundtracks in Windows CD versions when the user hasn't
* selected a MIDI output device

View File

@ -68,7 +68,16 @@ void SciMusic::init() {
_dwTempo = 0;
Common::Platform platform = g_sci->getPlatform();
uint32 deviceFlags = MDT_PCSPK | MDT_PCJR | MDT_ADLIB | MDT_MIDI;
uint32 deviceFlags;
#ifdef ENABLE_SCI32
if (g_sci->_features->generalMidiOnly()) {
deviceFlags = MDT_MIDI;
} else {
#endif
deviceFlags = MDT_PCSPK | MDT_PCJR | MDT_ADLIB | MDT_MIDI;
#ifdef ENABLE_SCI32
}
#endif
// Default to MIDI for Windows versions of SCI1.1 games, as their
// soundtrack is written for GM.
@ -93,6 +102,11 @@ void SciMusic::init() {
warning("A Windows CD version with an alternate MIDI soundtrack has been chosen, "
"but no MIDI music device has been selected. Reverting to the DOS soundtrack");
g_sci->_features->forceDOSTracks();
#ifdef ENABLE_SCI32
} else if (g_sci->_features->generalMidiOnly() && _musicType != MT_GM) {
warning("This game only supports General MIDI, but a non-GM device has "
"been selected. Some music may be wrong or missing");
#endif
}
switch (_musicType) {