[Scummvm-cvs-logs] SF.net SVN: scummvm:[46140] scummvm/trunk/sound/fmopl.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Nov 26 00:02:05 CET 2009


Revision: 46140
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46140&view=rev
Author:   lordhoto
Date:     2009-11-25 23:02:03 +0000 (Wed, 25 Nov 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/sound/fmopl.cpp

Modified: scummvm/trunk/sound/fmopl.cpp
===================================================================
--- scummvm/trunk/sound/fmopl.cpp	2009-11-25 21:11:16 UTC (rev 46139)
+++ scummvm/trunk/sound/fmopl.cpp	2009-11-25 23:02:03 UTC (rev 46140)
@@ -79,11 +79,14 @@
 	// 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list