[Scummvm-cvs-logs] SF.net SVN: scummvm: [29226] scummvm/trunk

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Oct 15 22:20:50 CEST 2007


Revision: 29226
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29226&view=rev
Author:   peres001
Date:     2007-10-15 13:20:50 -0700 (Mon, 15 Oct 2007)

Log Message:
-----------
* Changed IFF/8SVX audio to use signed data (int8), and modified Parallaction accordingly.
* Implemented proper beep in Parallaction for Amiga.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/sound.cpp
    scummvm/trunk/engines/parallaction/sound.h
    scummvm/trunk/sound/iff.cpp
    scummvm/trunk/sound/iff.h

Modified: scummvm/trunk/engines/parallaction/sound.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/sound.cpp	2007-10-15 19:00:46 UTC (rev 29225)
+++ scummvm/trunk/engines/parallaction/sound.cpp	2007-10-15 20:20:50 UTC (rev 29226)
@@ -318,20 +318,29 @@
 	stopSfx(3);
 }
 
-static byte res_amigaBeep[] = {
-	0, 20, 40, 60, 80, 60, 40, 20, 0, 236, 216, 196, 176, 196, 216, 236
+#define AMIGABEEP_SIZE	16
+#define NUM_REPEATS		60
+
+static int8 res_amigaBeep[AMIGABEEP_SIZE] = {
+	0, 20, 40, 60, 80, 60, 40, 20, 0, -20, -40, -60, -80, -60, -40, -20
 };
 
+
 void AmigaSoundMan::loadChannelData(const char *filename, Channel *ch) {
 	if (!scumm_stricmp("beep", filename)) {
 		ch->header.oneShotHiSamples = 0;
 		ch->header.repeatHiSamples = 0;
 		ch->header.samplesPerHiCycle = 0;
-		ch->header.samplesPerSec = 12000;
-		ch->header.volume = 255;
-		ch->data = res_amigaBeep;
-		ch->dataSize = 16;
-		ch->dispose = false;
+		ch->header.samplesPerSec = 11934;
+		ch->header.volume = 160;
+		ch->data = new int8[AMIGABEEP_SIZE * NUM_REPEATS];
+		int8* odata = ch->data;
+		for (uint i = 0; i < NUM_REPEATS; i++) {
+			memcpy(odata, res_amigaBeep, AMIGABEEP_SIZE);
+			odata += AMIGABEEP_SIZE;
+		}
+		ch->dataSize = AMIGABEEP_SIZE * NUM_REPEATS;
+		ch->dispose = true;
 		return;
 	}
 

Modified: scummvm/trunk/engines/parallaction/sound.h
===================================================================
--- scummvm/trunk/engines/parallaction/sound.h	2007-10-15 19:00:46 UTC (rev 29225)
+++ scummvm/trunk/engines/parallaction/sound.h	2007-10-15 20:20:50 UTC (rev 29226)
@@ -89,7 +89,7 @@
 
 	struct Channel {
 		Audio::Voice8Header	header;
-		byte				*data;
+		int8				*data;
 		uint32				dataSize;
 		bool				dispose;
 		Audio::SoundHandle	handle;

Modified: scummvm/trunk/sound/iff.cpp
===================================================================
--- scummvm/trunk/sound/iff.cpp	2007-10-15 19:00:46 UTC (rev 29225)
+++ scummvm/trunk/sound/iff.cpp	2007-10-15 20:20:50 UTC (rev 29226)
@@ -45,7 +45,7 @@
 	switch (_header.compression) {
 	case 0:
 		_dataSize = chunk.size;
-		_data = (byte*)malloc(_dataSize);
+		_data = (int8*)malloc(_dataSize);
 		chunk.read(_data, _dataSize);
 		break;
 
@@ -57,7 +57,7 @@
 }
 
 
-A8SVXDecoder::A8SVXDecoder(Common::ReadStream &input, Voice8Header &header, byte *&data, uint32 &dataSize) :
+A8SVXDecoder::A8SVXDecoder(Common::ReadStream &input, Voice8Header &header, int8 *&data, uint32 &dataSize) :
 	IFFParser(input), _header(header), _data(data), _dataSize(dataSize) {
 	if (_typeId != ID_8SVX)
 		error("unknown audio format");

Modified: scummvm/trunk/sound/iff.h
===================================================================
--- scummvm/trunk/sound/iff.h	2007-10-15 19:00:46 UTC (rev 29225)
+++ scummvm/trunk/sound/iff.h	2007-10-15 20:20:50 UTC (rev 29226)
@@ -54,7 +54,7 @@
 
 protected:
 	Voice8Header  	&_header;
-	byte* 			&_data;
+	int8* 			&_data;
 	uint32			&_dataSize;
 
 protected:
@@ -62,7 +62,7 @@
 	void readBODY(Common::IFFChunk &chunk);
 
 public:
-	A8SVXDecoder(Common::ReadStream &input, Voice8Header &header, byte *&data, uint32 &dataSize);
+	A8SVXDecoder(Common::ReadStream &input, Voice8Header &header, int8 *&data, uint32 &dataSize);
 	void decode();
 };
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list