aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-11-25 23:02:03 +0000
committerJohannes Schickel2009-11-25 23:02:03 +0000
commit776d735c2ef84c448f139725380aada51e84b533 (patch)
tree82b73dca2873ebf306011a1d0aad1ce687fa0cd8
parent12828d3aafb5c235b47644e1bed4063651dc114b (diff)
downloadscummvm-rg350-776d735c2ef84c448f139725380aada51e84b533.tar.gz
scummvm-rg350-776d735c2ef84c448f139725380aada51e84b533.tar.bz2
scummvm-rg350-776d735c2ef84c448f139725380aada51e84b533.zip
Do not fall back to a auto detection of the OPL emulator, when the user selected OPL emulator does not support a mode asked for.
We will now output a warning to the user in this case. That should be fine, since SCI is the only engine so far, which uses Dual OPL2 emulation. Albeit this is not supported by our MAME emulator the user will still get sound output, since the SCI engine will do proper recovery and fallback to single OPL2 emulation, which is supported by the MAME emulator. In case a engine would require a specifc mode (like OPL3) and the user selects MAME emulation, this might result in no sound output (or a crash), in case the engine does not take any care of testing whether the OPL creation succeeded. But luckily so far no engine does this, so it should be fine to not worry about that for now. svn-id: r46140
-rw-r--r--sound/fmopl.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp
index 91ff60919a..9b3ffe56a6 100644
--- a/sound/fmopl.cpp
+++ b/sound/fmopl.cpp
@@ -79,11 +79,14 @@ Config::DriverId Config::detect(OplType type) {
// the requested OPL chip.
if (drv != -1 && drv != kAuto) {
// If the chip is supported, just use the driver.
- if ((flags & _drivers[drv].flags))
+ if ((flags & _drivers[drv].flags)) {
return drv;
- // When it doesn't support the flags fall back to auto detection
- else
- drv = -1;
+ } else {
+ // Else we will output a warning and just
+ // return that no valid driver is found.
+ warning("Your selected OPL driver \"%s\" does not support type %d emulation, which is requested by your game.", _drivers[drv].description, type);
+ return -1;
+ }
}
// Detect the first matching emulator