aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-02 13:51:05 +1000
committerPaul Gilbert2011-07-02 13:51:05 +1000
commitd1a30b41b1bb0bc001751e8a4dcfcdb1044826ad (patch)
tree133d155bc04180e581fc154346bbf92548396605 /engines
parent160a8d96d943c878a1c8bed742507d540d51a15d (diff)
downloadscummvm-rg350-d1a30b41b1bb0bc001751e8a4dcfcdb1044826ad.tar.gz
scummvm-rg350-d1a30b41b1bb0bc001751e8a4dcfcdb1044826ad.tar.bz2
scummvm-rg350-d1a30b41b1bb0bc001751e8a4dcfcdb1044826ad.zip
TSAGE: Linked in the (in progress) SoundBlaster Fx class
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/sound.cpp21
-rw-r--r--engines/tsage/sound.h1
2 files changed, 13 insertions, 9 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 7f454bf801..b2cf5300e5 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -155,7 +155,9 @@ Common::List<SoundDriverEntry> &SoundManager::buildDriverList(bool detectFlag) {
void SoundManager::installConfigDrivers() {
installDriver(ADLIB_DRIVER_NUM);
+#ifdef DEBUG
installDriver(SBLASTER_DRIVER_NUM);
+#endif
}
Common::List<SoundDriverEntry> &SoundManager::getDriverList(bool detectFlag) {
@@ -220,8 +222,14 @@ void SoundManager::installDriver(int driverNum) {
* Instantiate a driver class for the specified driver number
*/
SoundDriver *SoundManager::instantiateDriver(int driverNum) {
- assert(driverNum == ADLIB_DRIVER_NUM);
- return new AdlibSoundDriver();
+ switch (driverNum) {
+ case ADLIB_DRIVER_NUM:
+ return new AdlibSoundDriver();
+ case SBLASTER_DRIVER_NUM:
+ return new AdlibFxSoundDriver();
+ default:
+ error("Unknown sound driver - %d", driverNum);
+ }
}
/**
@@ -2779,7 +2787,6 @@ AdlibFxSoundDriver::AdlibFxSoundDriver(): SoundDriver() {
_mixer = _vm->_mixer;
_sampleRate = _mixer->getOutputRate();
- _opl = makeAdLibOPL(_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);
@@ -2798,7 +2805,6 @@ AdlibFxSoundDriver::AdlibFxSoundDriver(): SoundDriver() {
AdlibFxSoundDriver::~AdlibFxSoundDriver() {
_mixer->stopHandle(_soundHandle);
- OPLDestroy(_opl);
}
bool AdlibFxSoundDriver::open() {
@@ -2900,10 +2906,7 @@ void AdlibFxSoundDriver::write(int v) {
void AdlibFxSoundDriver::flush() {
Common::StackLock slock(SoundManager::sfManager()._serverDisabledMutex);
- while (!_queue.empty()) {
- RegisterValue v = _queue.pop();
- OPLWriteReg(_opl, v._regNum, v._value);
- }
+ // No data output yet
}
@@ -2914,6 +2917,7 @@ int AdlibFxSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
}
void AdlibFxSoundDriver::update(int16 *buf, int len) {
+/*
static int samplesLeft = 0;
while (len != 0) {
int count = samplesLeft;
@@ -2929,6 +2933,7 @@ void AdlibFxSoundDriver::update(int16 *buf, int len) {
}
buf += count;
}
+*/
}
void AdlibFxSoundDriver::write209() {
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 26bf3e6d33..6a47a1aaf5 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -459,7 +459,6 @@ private:
Common::Queue<RegisterValue> _queue;
GroupData _groupData;
Audio::Mixer *_mixer;
- FM_OPL *_opl;
Audio::SoundHandle _soundHandle;
int _sampleRate;