[Scummvm-cvs-logs] scummvm master -> ad181a810c5856eae7e472cc358006333f9b348a

dreammaster dreammaster at scummvm.org
Mon Jul 4 11:17:00 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ad181a810c TSAGE: Replace usage of deprecated Adlib OPL functions


Commit: ad181a810c5856eae7e472cc358006333f9b348a
    https://github.com/scummvm/scummvm/commit/ad181a810c5856eae7e472cc358006333f9b348a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-07-04T02:14:39-07:00

Commit Message:
TSAGE: Replace usage of deprecated Adlib OPL functions

Changed paths:
    engines/tsage/sound.cpp



diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 8dd584e..e26b3d1 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -2485,7 +2485,10 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() {
 
 	_mixer = _vm->_mixer;
 	_sampleRate = _mixer->getOutputRate();
-	_opl = makeAdLibOPL(_sampleRate);
+	_opl = OPL::Config::create();
+	assert(_opl);
+	_opl->init(_sampleRate);
+		
 	_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
 
 	Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false);
@@ -2504,7 +2507,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() {
 AdlibSoundDriver::~AdlibSoundDriver() {
 	DEALLOCATE(_patchData);
 	_mixer->stopHandle(_soundHandle);
-	OPLDestroy(_opl);
+	delete _opl;
 }
 
 bool AdlibSoundDriver::open() {
@@ -2622,7 +2625,7 @@ void AdlibSoundDriver::flush() {
 
 	while (!_queue.empty()) {
 		RegisterValue v = _queue.pop();
-		OPLWriteReg(_opl, v._regNum, v._value);
+		_opl->writeReg(v._regNum, v._value);
 	}
 }
 
@@ -2760,7 +2763,7 @@ void AdlibSoundDriver::update(int16 *buf, int len) {
 		}
 		samplesLeft -= count;
 		len -= count;
-		YM3812UpdateOne(_opl, buf, count);
+		_opl->readBuffer(buf, count);
 		if (samplesLeft == 0) {
 			flush();
 			samplesLeft = _sampleRate / 50;






More information about the Scummvm-git-logs mailing list