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
This commit is contained in:
Johannes Schickel 2009-11-25 23:02:03 +00:00
parent 12828d3aaf
commit 776d735c2e

View File

@ -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