[Scummvm-cvs-logs] scummvm master -> 703af39be5ae936b7047a94689805b1acf4f81eb

dhewg dhewg at wiibrew.org
Sat Mar 26 11:14:08 CET 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:
41762892e0 ANDROID: Fix MIDI packet size
703af39be5 ANDROID: Add code to dump the EAS stream to a file


Commit: 41762892e03695bbc0fa0cc556cf4cb83ec3768f
    https://github.com/scummvm/scummvm/commit/41762892e03695bbc0fa0cc556cf4cb83ec3768f
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-03-26T03:11:17-07:00

Commit Message:
ANDROID: Fix MIDI packet size

Instruments are now not reset to the grand piano due to trailing
zeroes.
Thanks to waltervn for noticing this.

Changed paths:
    audio/softsynth/eas.cpp



diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp
index c5c60b2..9d6cf97 100644
--- a/audio/softsynth/eas.cpp
+++ b/audio/softsynth/eas.cpp
@@ -304,9 +304,13 @@ void MidiDriver_EAS::close() {
 void MidiDriver_EAS::send(uint32 b) {
 	byte buf[4];
 
-	WRITE_UINT32(buf, b);
+	WRITE_LE_UINT32(buf, b);
 
-	int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, 4);
+	int32 len = 3;
+	if ((buf[0] >> 4) == 0xC || (buf[0] >> 4) == 0xD)
+		len = 2;
+
+	int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, len);
 	if (res)
 		warning("error writing to EAS MIDI stream: %d", res);
 }


Commit: 703af39be5ae936b7047a94689805b1acf4f81eb
    https://github.com/scummvm/scummvm/commit/703af39be5ae936b7047a94689805b1acf4f81eb
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-03-26T03:11:32-07:00

Commit Message:
ANDROID: Add code to dump the EAS stream to a file

Changed paths:
    audio/softsynth/eas.cpp



diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp
index 9d6cf97..5b6bdad 100644
--- a/audio/softsynth/eas.cpp
+++ b/audio/softsynth/eas.cpp
@@ -30,12 +30,15 @@
 
 #include "common/debug.h"
 #include "common/endian.h"
+#include "common/file.h"
 #include "common/config-manager.h"
 #include "audio/audiostream.h"
 #include "audio/mpu401.h"
 #include "audio/musicplugin.h"
 #include "audio/mixer.h"
 
+//#define EAS_DUMPSTREAM
+
 // NOTE:
 // EAS's render function *only* accepts one mix buffer size. it's defined at
 // compile time of the library and can be retrieved via EASLibConfig.bufSize
@@ -140,6 +143,8 @@ private:
 	uint32 _baseTempo;
 	uint _rounds;
 	Audio::SoundHandle _soundHandle;
+
+	Common::DumpFile _dump;
 };
 
 MidiDriver_EAS::MidiDriver_EAS() :
@@ -160,7 +165,8 @@ MidiDriver_EAS::MidiDriver_EAS() :
 	_timerParam(0),
 	_baseTempo(0),
 	_rounds(0),
-	_soundHandle() {
+	_soundHandle(),
+	_dump() {
 }
 
 MidiDriver_EAS::~MidiDriver_EAS() {
@@ -256,6 +262,11 @@ int MidiDriver_EAS::open() {
 			"tempo:%u rounds:%u", _config->voices, _config->channels,
 			_config->rate, _config->bufSize, _baseTempo, _rounds);
 
+#ifdef EAS_DUMPSTREAM
+	if (!_dump.open("/sdcard/eas.dump"))
+		warning("error opening EAS dump file");
+#endif
+
 	g_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType,
 										&_soundHandle, this, -1,
 										Audio::Mixer::kMaxChannelVolume, 0,
@@ -276,6 +287,11 @@ void MidiDriver_EAS::close() {
 
 	g_system->getMixer()->stopHandle(_soundHandle);
 
+#ifdef EAS_DUMPSTREAM
+	if (_dump.isOpen())
+		_dump.close();
+#endif
+
 	// not pretty, but better than a mutex
 	g_system->delayMillis((_baseTempo * _rounds) / 1000);
 
@@ -357,6 +373,11 @@ int MidiDriver_EAS::readBuffer(int16 *buffer, const int numSamples) {
 			return -1;
 		}
 
+#ifdef EAS_DUMPSTREAM
+		if (_dump.isOpen())
+			_dump.write(buffer, c * _config->channels * 2);
+#endif
+
 		buffer += c * _config->channels;
 	}
 






More information about the Scummvm-git-logs mailing list