aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/opl/dosbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'audio/softsynth/opl/dosbox.cpp')
-rw-r--r--audio/softsynth/opl/dosbox.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/audio/softsynth/opl/dosbox.cpp b/audio/softsynth/opl/dosbox.cpp
index 5c3d833f54..bcc73a9b9e 100644
--- a/audio/softsynth/opl/dosbox.cpp
+++ b/audio/softsynth/opl/dosbox.cpp
@@ -32,6 +32,7 @@
#include "dosbox.h"
#include "dbopl.h"
+#include "audio/mixer.h"
#include "common/system.h"
#include "common/scummsys.h"
#include "common/util.h"
@@ -156,7 +157,7 @@ void OPL::free() {
_emulator = 0;
}
-bool OPL::init(int rate) {
+bool OPL::init() {
free();
memset(&_reg, 0, sizeof(_reg));
@@ -167,19 +168,19 @@ bool OPL::init(int rate) {
return false;
DBOPL::InitTables();
- _emulator->Setup(rate);
+ _rate = g_system->getMixer()->getOutputRate();
+ _emulator->Setup(_rate);
if (_type == Config::kDualOpl2) {
// Setup opl3 mode in the hander
_emulator->WriteReg(0x105, 1);
}
- _rate = rate;
return true;
}
void OPL::reset() {
- init(_rate);
+ init();
}
void OPL::write(int port, int val) {