diff options
author | Matthew Hoops | 2015-04-03 00:18:58 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-07-07 20:19:42 -0400 |
commit | f1f29302f5401c4782985cec4d47d069b99036ee (patch) | |
tree | 60c6c8c7b2867cf9524197d2c2c0734746906b71 /engines/kyra | |
parent | 2fa1ce51dd3cb00eef289094fe9f660c237254bc (diff) | |
download | scummvm-rg350-f1f29302f5401c4782985cec4d47d069b99036ee.tar.gz scummvm-rg350-f1f29302f5401c4782985cec4d47d069b99036ee.tar.bz2 scummvm-rg350-f1f29302f5401c4782985cec4d47d069b99036ee.zip |
AUDIO: Remove the legacy OPL API
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index c0e0f67b8e..203931fcd1 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -88,7 +88,7 @@ public: int32 render = MIN(samplesLeft, _samplesTillCallback); samplesLeft -= render; _samplesTillCallback -= render; - YM3812UpdateOne(_adlib, buffer, render); + _adlib->readBuffer(buffer, render); buffer += render; } return numSamples; @@ -365,7 +365,7 @@ private: uint8 _unkValue19; uint8 _unkValue20; - FM_OPL *_adlib; + OPL::OPL *_adlib; uint8 *_soundData; uint32 _soundDataSize; @@ -427,8 +427,9 @@ AdLibDriver::AdLibDriver(Audio::Mixer *mixer, int version) { _mixer = mixer; - _adlib = makeAdLibOPL(getRate()); - assert(_adlib); + _adlib = OPL::Config::create(); + if (!_adlib || !_adlib->init(getRate())) + error("Failed to create OPL"); memset(_channels, 0, sizeof(_channels)); _soundData = 0; @@ -471,7 +472,7 @@ AdLibDriver::AdLibDriver(Audio::Mixer *mixer, int version) { AdLibDriver::~AdLibDriver() { _mixer->stopHandle(_soundHandle); - OPLDestroy(_adlib); + delete _adlib; _adlib = 0; } @@ -877,7 +878,7 @@ void AdLibDriver::resetAdLibState() { // New calling style: writeOPL(0xAB, 0xCD) void AdLibDriver::writeOPL(byte reg, byte val) { - OPLWriteReg(_adlib, reg, val); + _adlib->writeReg(reg, val); } void AdLibDriver::initChannel(Channel &channel) { |