aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth/opl
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-12 18:42:44 +0000
committerJohannes Schickel2009-05-12 18:42:44 +0000
commit4f0768b9096aab65961d697ca60d6e939f36eae2 (patch)
treecdd956f755a04eb23c140913a0e681ad6094b79b /sound/softsynth/opl
parent938db170f3af6eaade05fec36edc8011e155422f (diff)
downloadscummvm-rg350-4f0768b9096aab65961d697ca60d6e939f36eae2.tar.gz
scummvm-rg350-4f0768b9096aab65961d697ca60d6e939f36eae2.tar.bz2
scummvm-rg350-4f0768b9096aab65961d697ca60d6e939f36eae2.zip
- Add support for selecting the OPL emulator being used (config entry: "opl_driver")
- Make MAME FM OPL the default emulator again - Add GUI support for selecting the active OPL emulator - Update themes svn-id: r40496
Diffstat (limited to 'sound/softsynth/opl')
-rw-r--r--sound/softsynth/opl/dosbox.cpp36
-rw-r--r--sound/softsynth/opl/dosbox.h6
2 files changed, 21 insertions, 21 deletions
diff --git a/sound/softsynth/opl/dosbox.cpp b/sound/softsynth/opl/dosbox.cpp
index db8f8109d7..cbb3090608 100644
--- a/sound/softsynth/opl/dosbox.cpp
+++ b/sound/softsynth/opl/dosbox.cpp
@@ -190,7 +190,7 @@ struct Handler : public DOSBox::Handler {
};
} // end of namespace OPL3
-OPL::OPL(kOplType type) : _type(type), _rate(0), _handler(0) {
+OPL::OPL(Config::OplType type) : _type(type), _rate(0), _handler(0) {
}
OPL::~OPL() {
@@ -209,12 +209,12 @@ bool OPL::init(int rate) {
memset(_chip, 0, sizeof(_chip));
switch (_type) {
- case kOpl2:
+ case Config::kOpl2:
_handler = new OPL2::Handler();
break;
- case kDualOpl2:
- case kOpl3:
+ case Config::kDualOpl2:
+ case Config::kOpl3:
_handler = new OPL3::Handler();
break;
@@ -224,7 +224,7 @@ bool OPL::init(int rate) {
_handler->init(rate);
- if (_type == kDualOpl2) {
+ if (_type == Config::kDualOpl2) {
// Setup opl3 mode in the hander
_handler->writeReg(0x105, 1);
}
@@ -240,12 +240,12 @@ void OPL::reset() {
void OPL::write(int port, int val) {
if (port&1) {
switch (_type) {
- case kOpl2:
- case kOpl3:
+ case Config::kOpl2:
+ case Config::kOpl3:
if (!_chip[0].write(_reg.normal, val))
_handler->writeReg(_reg.normal, val);
break;
- case kDualOpl2:
+ case Config::kDualOpl2:
// Not a 0x??8 port, then write to a specific port
if (!(port & 0x8)) {
byte index = (port & 2) >> 1;
@@ -261,13 +261,13 @@ void OPL::write(int port, int val) {
// Ask the handler to write the address
// Make sure to clip them in the right range
switch (_type) {
- case kOpl2:
+ case Config::kOpl2:
_reg.normal = _handler->writeAddr(port, val) & 0xff;
break;
- case kOpl3:
+ case Config::kOpl3:
_reg.normal = _handler->writeAddr(port, val) & 0x1ff;
break;
- case kDualOpl2:
+ case Config::kDualOpl2:
// Not a 0x?88 port, when write to a specific side
if (!(port & 0x8)) {
byte index = (port & 2) >> 1;
@@ -283,16 +283,16 @@ void OPL::write(int port, int val) {
byte OPL::read(int port) {
switch (_type) {
- case kOpl2:
+ case Config::kOpl2:
if (!(port & 1))
//Make sure the low bits are 6 on opl2
return _chip[0].read() | 0x6;
break;
- case kOpl3:
+ case Config::kOpl3:
if (!(port & 1))
return _chip[0].read();
break;
- case kDualOpl2:
+ case Config::kDualOpl2:
// Only return for the lower ports
if (port & 1)
return 0xff;
@@ -305,9 +305,9 @@ byte OPL::read(int port) {
void OPL::writeReg(int r, int v) {
byte tempReg = 0;
switch (_type) {
- case kOpl2:
- case kDualOpl2:
- case kOpl3:
+ case Config::kOpl2:
+ case Config::kDualOpl2:
+ case Config::kOpl3:
// We can't use _handler->writeReg here directly, since it would miss timer changes.
// Backup old setup register
@@ -350,7 +350,7 @@ void OPL::dualWrite(uint8 index, uint8 reg, uint8 val) {
void OPL::readBuffer(int16 *buffer, int length) {
// For stereo OPL cards, we divide the sample count by 2,
// to match stereo AudioStream behavior.
- if (_type != kOpl2)
+ if (_type != Config::kOpl2)
length >>= 1;
_handler->generate(buffer, length);
diff --git a/sound/softsynth/opl/dosbox.h b/sound/softsynth/opl/dosbox.h
index 68a53276f0..488cc3d82a 100644
--- a/sound/softsynth/opl/dosbox.h
+++ b/sound/softsynth/opl/dosbox.h
@@ -85,7 +85,7 @@ public:
class OPL : public ::OPL::OPL {
private:
- kOplType _type;
+ Config::OplType _type;
uint _rate;
Handler *_handler;
@@ -98,7 +98,7 @@ private:
void free();
void dualWrite(uint8 index, uint8 reg, uint8 val);
public:
- OPL(kOplType type);
+ OPL(Config::OplType type);
~OPL();
bool init(int rate);
@@ -110,7 +110,7 @@ public:
void writeReg(int r, int v);
void readBuffer(int16 *buffer, int length);
- bool isStereo() const { return _type != kOpl2; }
+ bool isStereo() const { return _type != Config::kOpl2; }
};
} // end of namespace DOSBox