[Scummvm-cvs-logs] SF.net SVN: scummvm:[40341] scummvm/trunk/sound/softsynth/opl/dosbox.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed May 6 01:40:55 CEST 2009


Revision: 40341
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40341&view=rev
Author:   lordhoto
Date:     2009-05-05 23:40:54 +0000 (Tue, 05 May 2009)

Log Message:
-----------
Really fix Dual OPL2 initialization.

Modified Paths:
--------------
    scummvm/trunk/sound/softsynth/opl/dosbox.cpp

Modified: scummvm/trunk/sound/softsynth/opl/dosbox.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/opl/dosbox.cpp	2009-05-05 22:36:16 UTC (rev 40340)
+++ scummvm/trunk/sound/softsynth/opl/dosbox.cpp	2009-05-05 23:40:54 UTC (rev 40341)
@@ -171,7 +171,7 @@
 
 struct Handler : public DOSBox::Handler {
 	void writeReg(uint32 reg, uint8 val) {	
-		adlib_write(reg,val);
+		adlib_write(reg, val);
 	}
 
 	uint32 writeAddr(uint32 port, uint8 val) {
@@ -213,11 +213,6 @@
 		break;
 
 	case kDualOpl2:
-		_handler = new OPL3::Handler();
-		// Setup opl3 mode in the hander
-		_handler->writeReg(0x105, 1);
-		break;
-
 	case kOpl3:
 		_handler = new OPL3::Handler();
 		break;
@@ -227,6 +222,12 @@
 	}
 
 	_handler->init(rate);
+	
+	if (_type == kDualOpl2) {
+		// Setup opl3 mode in the hander
+		_handler->writeReg(0x105, 1);
+	}
+
 	_rate = rate;
 	return true;
 }
@@ -336,7 +337,7 @@
 		return;
 
 	// Enabling panning
-	if (reg >= 0xc0 && reg < 0xc8) {
+	if (reg >= 0xC0 && reg < 0xC8) {
 		val &= 7;
 		val |= index ? 0xA0 : 0x50;
 	}


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