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

dreammaster dreammaster at scummvm.org
Fri Jul 29 12:07:50 CEST 2011


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

Summary:
95b49a4cc3 TSAGE: Removed no longer needed fields from the Fx sound driver
c1870551b0 TSAGE: Renamed AdlibFxSoundDriver to a more accurate SoundBlasterDriver


Commit: 95b49a4cc3c74bc8e7f54f27a1306fd2ed597c91
    https://github.com/scummvm/scummvm/commit/95b49a4cc3c74bc8e7f54f27a1306fd2ed597c91
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-07-29T02:57:29-07:00

Commit Message:
TSAGE: Removed no longer needed fields from the Fx sound driver

Changed paths:
    engines/tsage/sound.cpp
    engines/tsage/sound.h



diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index da70ea2..2f2f550 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -2802,20 +2802,6 @@ AdlibFxSoundDriver::AdlibFxSoundDriver(): SoundDriver() {
 	_mixer = _vm->_mixer;
 	_sampleRate = _mixer->getOutputRate();
 	_audioStream = NULL;
-//	_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
-/*
-	Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false);
-	memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	memset(_v4405E, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	memset(_v44067, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	memset(_v44070, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	memset(_v44079, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	memset(_v44082, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	_v44082[ADLIB_CHANNEL_COUNT] = 0x90;
-	Common::set_to(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000);
-	memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
-	_patchData = NULL;
-*/
 }
 
 AdlibFxSoundDriver::~AdlibFxSoundDriver() {
@@ -2823,26 +2809,13 @@ AdlibFxSoundDriver::~AdlibFxSoundDriver() {
 }
 
 bool AdlibFxSoundDriver::open() {
-	write209();
-	write(64);
-	write(165);
-
-	// for (int idx = 0; idx < 5000 * 16; ++idx) al = port[21h]
-
-//	_v45071 = 1;
-//	_v4506F = 0;
-
 	return true;
 }
 
 void AdlibFxSoundDriver::close() {
-	write(208);
-	write211();
-
 }
 
 bool AdlibFxSoundDriver::reset() {
-
 	return true;
 }
 
@@ -2850,16 +2823,6 @@ const GroupData *AdlibFxSoundDriver::getGroupData() {
 	return &_groupData;
 }
 
-void AdlibFxSoundDriver::poll() {
-	if (!_masterVolume || !_channelVolume) {
-		if (_v45046)
-			write211();
-	} else {
-		if (!_v45046)
-			write209();
-	}
-}
-
 int AdlibFxSoundDriver::setMasterVolume(int volume) {
 	int oldVolume = _masterVolume;
 	_masterVolume = volume;
@@ -2877,7 +2840,6 @@ void AdlibFxSoundDriver::playSound(const byte *channelData, int dataOffset, int
 
 	// Set the new channel data
 	_channelData = channelData + dataOffset;
-	_soundData = _channelData + 18;
 
 	// Make a copy of the buffer
 	int dataSize = _vm->_memoryManager.getSize(channelData);
@@ -2904,10 +2866,9 @@ void AdlibFxSoundDriver::proc38(int channel, int cmd, int value) {
 }
 
 void AdlibFxSoundDriver::proc42(int channel, int cmd, int value, int *v1, int *v2) {
-	_v4506A = value;
-	*v1 = _v4506B;
+	// TODO: v2 is used for flagging a reset of the timer. I'm not sure if it's needed
+	*v1 = 0;
 	*v2 = 0;
-	_v4506B = 0;
 
 	// Note: Checking whether a playing Fx sound had finished was originally done in another
 	// method in the sample playing code. But since we're using the ScummVM audio soundsystem,
@@ -2921,23 +2882,6 @@ void AdlibFxSoundDriver::proc42(int channel, int cmd, int value, int *v1, int *v
 	if (!_channelData)
 		// Flag that sound isn't playing
 		*v1 = 1;
-
-	// TODO: v2 is used for flagging a reset of the timer. I'm not sure if it's needed
-	*v2 = 0;
-}
-
-void AdlibFxSoundDriver::write(int v) {
-	// No implementation
-}
-
-void AdlibFxSoundDriver::write209() {
-	write(209);
-	_v45046 = true;
-}
-
-void AdlibFxSoundDriver::write211() {
-	write(211);
-	_v45046 = false;
 }
 
 } // End of namespace tSage
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 244b4dd..295ad3d 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -461,29 +461,15 @@ public:
 
 class AdlibFxSoundDriver: public SoundDriver {
 private:
-	Common::Queue<RegisterValue> _queue;
 	GroupData _groupData;
 	Audio::Mixer *_mixer;
 	Audio::SoundHandle _soundHandle;
 	Audio::QueuingAudioStream *_audioStream;
 	int _sampleRate;
 
-	int _v45062;
-	int _v45066;
-	int _v45068;
-	int _v4506A;
-	int _v4506B;
-	bool _v45046;
 	byte _masterVolume;
 	byte _channelVolume;
 	const byte *_channelData;
-	const byte *_soundData;
-
-	void write(int v);
-	void flush();
-	void sub_4556E();
-	void write209();
-	void write211();
 public:
 	AdlibFxSoundDriver();
 	virtual ~AdlibFxSoundDriver();
@@ -492,7 +478,6 @@ public:
 	virtual void close();
 	virtual bool reset();
 	virtual const GroupData *getGroupData();
-	virtual void poll();
 	virtual int setMasterVolume(int volume);
 	virtual void playSound(const byte *channelData, int dataOffset, int program, int channel, int v0, int v1);
 	virtual void updateVoice(int channel);


Commit: c1870551b07b0ea16ecfc4bd8e1ce7175a08978e
    https://github.com/scummvm/scummvm/commit/c1870551b07b0ea16ecfc4bd8e1ce7175a08978e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-07-29T03:05:02-07:00

Commit Message:
TSAGE: Renamed AdlibFxSoundDriver to a more accurate SoundBlasterDriver

Changed paths:
    engines/tsage/sound.cpp
    engines/tsage/sound.h



diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 2f2f550..2d51d5d 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -228,7 +228,7 @@ SoundDriver *SoundManager::instantiateDriver(int driverNum) {
 	case ADLIB_DRIVER_NUM:
 		return new AdlibSoundDriver();
 	case SBLASTER_DRIVER_NUM:
-		return new AdlibFxSoundDriver();
+		return new SoundBlasterDriver();
 	default:
 		error("Unknown sound driver - %d", driverNum);
 	}
@@ -2786,10 +2786,10 @@ int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
 
 /*--------------------------------------------------------------------------*/
 
-const byte adlibFx_group_data[] = { 3, 1, 1, 0, 0xff };
+const byte soundBlaster_group_data[] = { 3, 1, 1, 0, 0xff };
 
 
-AdlibFxSoundDriver::AdlibFxSoundDriver(): SoundDriver() {
+SoundBlasterDriver::SoundBlasterDriver(): SoundDriver() {
 	_minVersion = 0x102;
 	_maxVersion = 0x10A;
 	_masterVolume = 0;
@@ -2797,40 +2797,40 @@ AdlibFxSoundDriver::AdlibFxSoundDriver(): SoundDriver() {
 	_groupData.groupMask = 1;
 	_groupData.v1 = 0x3E;
 	_groupData.v2 = 0;
-	_groupData.pData = &adlibFx_group_data[0];
+	_groupData.pData = &soundBlaster_group_data[0];
 
 	_mixer = _vm->_mixer;
 	_sampleRate = _mixer->getOutputRate();
 	_audioStream = NULL;
 }
 
-AdlibFxSoundDriver::~AdlibFxSoundDriver() {
+SoundBlasterDriver::~SoundBlasterDriver() {
 	_mixer->stopHandle(_soundHandle);
 }
 
-bool AdlibFxSoundDriver::open() {
+bool SoundBlasterDriver::open() {
 	return true;
 }
 
-void AdlibFxSoundDriver::close() {
+void SoundBlasterDriver::close() {
 }
 
-bool AdlibFxSoundDriver::reset() {
+bool SoundBlasterDriver::reset() {
 	return true;
 }
 
-const GroupData *AdlibFxSoundDriver::getGroupData() {
+const GroupData *SoundBlasterDriver::getGroupData() {
 	return &_groupData;
 }
 
-int AdlibFxSoundDriver::setMasterVolume(int volume) {
+int SoundBlasterDriver::setMasterVolume(int volume) {
 	int oldVolume = _masterVolume;
 	_masterVolume = volume;
 
 	return oldVolume;
 }
 
-void AdlibFxSoundDriver::playSound(const byte *channelData, int dataOffset, int program, int channel, int v0, int v1) {
+void SoundBlasterDriver::playSound(const byte *channelData, int dataOffset, int program, int channel, int v0, int v1) {
 	if (program != -1)
 		return;
 
@@ -2854,18 +2854,18 @@ void AdlibFxSoundDriver::playSound(const byte *channelData, int dataOffset, int
 		_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, _audioStream);
 }
 
-void AdlibFxSoundDriver::updateVoice(int channel) {
+void SoundBlasterDriver::updateVoice(int channel) {
 	// No implementation
 }
 
-void AdlibFxSoundDriver::proc38(int channel, int cmd, int value) {
+void SoundBlasterDriver::proc38(int channel, int cmd, int value) {
 	if (cmd == 7) {
 		// Set channel volume
 		_channelVolume = value;
 	}
 }
 
-void AdlibFxSoundDriver::proc42(int channel, int cmd, int value, int *v1, int *v2) {
+void SoundBlasterDriver::proc42(int channel, int cmd, int value, int *v1, int *v2) {
 	// TODO: v2 is used for flagging a reset of the timer. I'm not sure if it's needed
 	*v1 = 0;
 	*v2 = 0;
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 295ad3d..702a277 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -459,7 +459,7 @@ public:
 	void update(int16 *buf, int len);
 };
 
-class AdlibFxSoundDriver: public SoundDriver {
+class SoundBlasterDriver: public SoundDriver {
 private:
 	GroupData _groupData;
 	Audio::Mixer *_mixer;
@@ -471,8 +471,8 @@ private:
 	byte _channelVolume;
 	const byte *_channelData;
 public:
-	AdlibFxSoundDriver();
-	virtual ~AdlibFxSoundDriver();
+	SoundBlasterDriver();
+	virtual ~SoundBlasterDriver();
 
 	virtual bool open();
 	virtual void close();






More information about the Scummvm-git-logs mailing list