aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-05 23:40:54 +0000
committerJohannes Schickel2009-05-05 23:40:54 +0000
commit25ca710eae70a30538d736da0374b74279c3a23f (patch)
tree2eb222fade5a633c90f0ae1071154cc473e535a8 /sound/softsynth
parenteddd7bff8fff4291ab869f73892b506b9dacbc43 (diff)
downloadscummvm-rg350-25ca710eae70a30538d736da0374b74279c3a23f.tar.gz
scummvm-rg350-25ca710eae70a30538d736da0374b74279c3a23f.tar.bz2
scummvm-rg350-25ca710eae70a30538d736da0374b74279c3a23f.zip
Really fix Dual OPL2 initialization.
svn-id: r40341
Diffstat (limited to 'sound/softsynth')
-rw-r--r--sound/softsynth/opl/dosbox.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/softsynth/opl/dosbox.cpp b/sound/softsynth/opl/dosbox.cpp
index eff0ec4b55..c61016e358 100644
--- a/sound/softsynth/opl/dosbox.cpp
+++ b/sound/softsynth/opl/dosbox.cpp
@@ -171,7 +171,7 @@ namespace OPL3 {
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 @@ bool OPL::init(int rate) {
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 @@ bool OPL::init(int rate) {
}
_handler->init(rate);
+
+ if (_type == kDualOpl2) {
+ // Setup opl3 mode in the hander
+ _handler->writeReg(0x105, 1);
+ }
+
_rate = rate;
return true;
}
@@ -336,7 +337,7 @@ void OPL::dualWrite(uint8 index, uint8 reg, uint8 val) {
return;
// Enabling panning
- if (reg >= 0xc0 && reg < 0xc8) {
+ if (reg >= 0xC0 && reg < 0xC8) {
val &= 7;
val |= index ? 0xA0 : 0x50;
}