From 776d735c2ef84c448f139725380aada51e84b533 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 25 Nov 2009 23:02:03 +0000 Subject: 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 --- sound/fmopl.cpp | 11 +++++++---- 1 file 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 -- cgit v1.2.3