[Scummvm-cvs-logs] scummvm master -> 4a8b501a225c170868555d39d6939015f79493f9

athrxx athrxx at scummvm.org
Fri Jun 3 22:12:55 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:
85f7a01d2a FM-TOWNS AUDIO: some cleanup in midi driver code
4a8b501a22 SCUMM: fix typo (reported by Littleboy)


Commit: 85f7a01d2a229da7523d5b6e01359c564dd1d912
    https://github.com/scummvm/scummvm/commit/85f7a01d2a229da7523d5b6e01359c564dd1d912
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-03T13:08:22-07:00

Commit Message:
FM-TOWNS AUDIO: some cleanup in midi driver code

Changed paths:
    audio/softsynth/fmtowns_pc98/towns_midi.cpp
    audio/softsynth/fmtowns_pc98/towns_midi.h



diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
index 4617b05..071a697 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
@@ -833,9 +833,8 @@ const uint8 TownsMidiInputChannel::_programAdjustLevel[] = {
 };
 
 MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerProcPara(0), _channels(0), _out(0),
-	_chanState(0), _operatorLevelTable(0), _tickCounter1(0), _tickCounter2(0), _rand(1), _allocCurPos(0), _isOpen(false) {
-	// We set exteral mutex handling to true, since this driver is only suitable for use with the SCUMM engine
-	// which has its own mutex. This causes lockups which cannot always be avoided.
+	_baseTempo(10080), _chanState(0), _operatorLevelTable(0), _tickCounter(0), _rand(1), _allocCurPos(0), _isOpen(false) {
+	// We set exteral mutex handling to true to avoid lockups in SCUMM which has its own mutex.
 	_intf = new TownsAudioInterface(mixer, this, true);
 
 	_channels = new TownsMidiInputChannel*[32];
@@ -958,7 +957,7 @@ void MidiDriver_TOWNS::setTimerCallback(void *timer_param, Common::TimerManager:
 }
 
 uint32 MidiDriver_TOWNS::getBaseTempo() {
-	return 10080;
+	return _baseTempo;
 }
 
 MidiChannel *MidiDriver_TOWNS::allocateChannel() {
@@ -986,12 +985,6 @@ void MidiDriver_TOWNS::timerCallback(int timerId) {
 	case 1:
 		updateParser();
 		updateOutputChannels();
-
-		/*_tickCounter1 += 10000;
-		while (_tickCounter1 >= 4167) {
-			_tickCounter1 -= 4167;
-			unkUpdate();
-		}*/
 		break;
 	default:
 		break;
@@ -1004,9 +997,9 @@ void MidiDriver_TOWNS::updateParser() {
 }
 
 void MidiDriver_TOWNS::updateOutputChannels() {
-	_tickCounter2 += 10000;
-	while (_tickCounter2 >= 16667) {
-		_tickCounter2 -= 16667;
+	_tickCounter += _baseTempo;
+	while (_tickCounter >= 16667) {
+		_tickCounter -= 16667;
 		for (int i = 0; i < 6; i++) {
 			if (_out[i]->update())
 				return;
diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.h b/audio/softsynth/fmtowns_pc98/towns_midi.h
index a98bb1b..9aa7c93 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.h
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.h
@@ -69,14 +69,15 @@ private:
 
 	TownsAudioInterface *_intf;
 
-	uint32 _tickCounter1;
-	uint32 _tickCounter2;
+	uint32 _tickCounter;
 	uint8 _allocCurPos;
 	uint8 _rand;
 	
 	bool _isOpen;
 
 	uint8 *_operatorLevelTable;
+	
+	const uint16 _baseTempo;
 };
 
 #endif


Commit: 4a8b501a225c170868555d39d6939015f79493f9
    https://github.com/scummvm/scummvm/commit/4a8b501a225c170868555d39d6939015f79493f9
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-03T13:09:25-07:00

Commit Message:
SCUMM: fix typo (reported by Littleboy)

Changed paths:
    engines/scumm/scumm.cpp



diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c0c477a..36caff4 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1832,7 +1832,7 @@ void ScummEngine::setupMusic(int midi) {
 		if (nativeMidiDriver != NULL && _native_mt32)
 			nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
 		bool multi_midi = ConfMan.getBool("multi_midi") && _musicType != MDT_NONE && (midi & MDT_ADLIB);
-		if (_musicType == MDT_ADLIB || MDT_TOWNS || multi_midi) {
+		if (_musicType == MDT_ADLIB || _musicType == MDT_TOWNS || multi_midi) {
 			adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB));
 			adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0);
 		}






More information about the Scummvm-git-logs mailing list