diff options
author | Jamieson Christian | 2003-08-15 10:19:24 +0000 |
---|---|---|
committer | Jamieson Christian | 2003-08-15 10:19:24 +0000 |
commit | e1bc6493d858f569716cf2036732e8a1ddf36573 (patch) | |
tree | b8549f630011dcab1b4c684a22daba09b96119b2 /common | |
parent | f9aea7673ffcbb515e2a3ed32108b00f60598414 (diff) | |
download | scummvm-rg350-e1bc6493d858f569716cf2036732e8a1ddf36573.tar.gz scummvm-rg350-e1bc6493d858f569716cf2036732e8a1ddf36573.tar.bz2 scummvm-rg350-e1bc6493d858f569716cf2036732e8a1ddf36573.zip |
Replaced ADLIB_ALWAYS and ADLIB_PREFERRED with a more flexible
list of music types supported. This was done because now
PC speaker support must be treated separately, along with
Adlib and native (GM/MT32) support.
This fixes a problem with games that don't support PC speaker
(including V5 games that don't parse SPK resources yet)
being run with -epcspk or -epcjr. Those games now properly
switch to -enull so that music resources still get parsed
and music/script synchronization mechanisms don't break.
svn-id: r9703
Diffstat (limited to 'common')
-rw-r--r-- | common/gameDetector.cpp | 10 | ||||
-rw-r--r-- | common/gameDetector.h | 14 |
2 files changed, 15 insertions, 9 deletions
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index 9a4fa6fc32..6a06a61c98 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -704,13 +704,17 @@ int GameDetector::detectMain() { * and the game is one of those that want adlib as * default, OR if the game is an older game that doesn't * support anything else anyway. */ + if (_midi_driver == MD_AUTO) + _midi_driver = MD_ADLIB; bool nativeMidiDriver = (_midi_driver != MD_NULL && _midi_driver != MD_ADLIB && _midi_driver != MD_PCSPK && _midi_driver != MD_PCJR); - if ((_game.adlib & VersionSettings::ADLIB_ALWAYS) && nativeMidiDriver || - (_game.adlib & VersionSettings::ADLIB_PREFERRED) && _midi_driver == MD_AUTO) { + if (nativeMidiDriver && !(_game.midi & MDT_NATIVE)) _midi_driver = MD_ADLIB; - } + if (_midi_driver == MD_ADLIB && !(_game.midi & MDT_ADLIB)) + _midi_driver = MD_PCJR; + if ((_midi_driver == MD_PCSPK || _midi_driver == MD_PCJR) && !(_game.midi & MDT_PCSPK)) + _midi_driver = MD_NULL; if (!_gameDataPath) { warning("No path was provided. Assuming the data files are in the current directory"); diff --git a/common/gameDetector.h b/common/gameDetector.h index dbf5d1299b..fcf6846dae 100644 --- a/common/gameDetector.h +++ b/common/gameDetector.h @@ -61,16 +61,18 @@ enum { HB_HEB = 20 }; +enum MidiDriverType { + MDT_NONE = 0, + MDT_PCSPK = 1, // MD_PCSPK and MD_PCJR + MDT_ADLIB = 2, // MD_ADLIB + MDT_NATIVE = 4 // Everything else +}; + struct VersionSettings { const char *filename; const char *gamename; byte id, version; - enum { - ADLIB_DONT_CARE = 0, - ADLIB_PREFERRED = 1, - ADLIB_ALWAYS = 2, - ADLIB_NEVER = 3 - } adlib; + int midi; // MidiDriverType values uint32 features; const char *detectname; }; |