[Scummvm-cvs-logs] SF.net SVN: scummvm:[42575] scummvm/branches/gsoc2009-mods

nolange at users.sourceforge.net nolange at users.sourceforge.net
Sat Jul 18 02:04:28 CEST 2009


Revision: 42575
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42575&view=rev
Author:   nolange
Date:     2009-07-18 00:04:28 +0000 (Sat, 18 Jul 2009)

Log Message:
-----------
first attempt at enabling soundeffects using an table from the executeable. Doesnt quite work as it should

Modified Paths:
--------------
    scummvm/branches/gsoc2009-mods/dists/msvc9/scummvm-tfmx.vcproj
    scummvm/branches/gsoc2009-mods/engines/kyra/seqplayer.cpp
    scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp
    scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h
    scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp
    scummvm/branches/gsoc2009-mods/tfmx/mxtxplayer.cpp

Modified: scummvm/branches/gsoc2009-mods/dists/msvc9/scummvm-tfmx.vcproj
===================================================================
--- scummvm/branches/gsoc2009-mods/dists/msvc9/scummvm-tfmx.vcproj	2009-07-17 21:23:54 UTC (rev 42574)
+++ scummvm/branches/gsoc2009-mods/dists/msvc9/scummvm-tfmx.vcproj	2009-07-18 00:04:28 UTC (rev 42575)
@@ -192,7 +192,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				LinkLibraryDependencies="false"
+				LinkLibraryDependencies="true"
 				AdditionalDependencies="winmm.lib sdl.lib zlib.lib libmad.lib vorbisfile_static.lib vorbis_static.lib ogg_static.lib"
 				OutputFile="$(OutDir)\$(ProjectName)-tfmx.exe"
 				ProgramDatabaseFile="$(OutDir)/scummvm.pdb"

Modified: scummvm/branches/gsoc2009-mods/engines/kyra/seqplayer.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/kyra/seqplayer.cpp	2009-07-17 21:23:54 UTC (rev 42574)
+++ scummvm/branches/gsoc2009-mods/engines/kyra/seqplayer.cpp	2009-07-18 00:04:28 UTC (rev 42575)
@@ -413,8 +413,6 @@
 
 void SeqPlayer::s1_playEffect() {
 	uint8 track = *_seqData++;
-	if (_vm->gameFlags().platform == Common::kPlatformAmiga)
-		return;
 	_vm->delay(3 * _vm->tickLength());
 	_sound->playSoundEffect(track);
 }
@@ -422,9 +420,6 @@
 void SeqPlayer::s1_playTrack() {
 	uint8 msg = *_seqData++;
 
-	if (_vm->gameFlags().platform == Common::kPlatformAmiga)
-		return;
-
 	if (msg == 1) {
 		_sound->beginFadeOut();
 	} else {

Modified: scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp	2009-07-17 21:23:54 UTC (rev 42574)
+++ scummvm/branches/gsoc2009-mods/engines/kyra/sound_amiga.cpp	2009-07-18 00:04:28 UTC (rev 42575)
@@ -56,7 +56,6 @@
 
 void SoundAmiga::loadSoundFile(uint file) {
 	assert(file < ARRAYSIZE(kFilenameTable));
-
 	if (_fileLoaded == file)
 		return;
 
@@ -96,6 +95,142 @@
 }
 
 void SoundAmiga::playSoundEffect(uint8 track) {
-	assert("Dont call me" == 0);
+	debug("play sfx %d", track);
+	uint16 extVar = 1; // maybe indicates music playing or enabled
+	uint16 extVar2 = 1; // no idea
+	if (0x61 <= track && track <= 0x63 && extVar) {
+		assert(false);//some music-commands
+	}
+	assert(track < ARRAYSIZE(kEffectsTable));
+	const EffectEntry &entry = kEffectsTable[track];
+	if (extVar2 && entry.note) {
+		_driver->playNote(entry.note, entry.patch, entry.duration, entry.volume, entry.pan != 0);
+		if (!_mixer->isSoundHandleActive(_soundChannels[0]))
+			_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundChannels[0], _driver);
+	}
 }
+
+const SoundAmiga::EffectEntry SoundAmiga::kEffectsTable[120] = {
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x01, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0156, 0x3C, 0x13, 120,  1 },
+	{ 0x272C, 0x3C, 0x14, 120,  1 },
+	{ 0x1B91, 0x3C, 0x15, 120,  1 },
+	{ 0x1E97, 0x3C, 0x16, 120,  1 },
+	{ 0x122B, 0x3C, 0x17, 120,  1 },
+	{ 0x1E97, 0x3C, 0x16, 120,  1 },
+	{ 0x0224, 0x45, 0x03, 120,  1 },
+	{ 0x1E97, 0x3C, 0x16, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x0910, 0x2C, 0x04, 120,  1 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x3AEB, 0x3C, 0x1A, 120,  1 },
+	{ 0x138B, 0x25, 0x1B, 120,  1 },
+	{ 0x0F52, 0x18, 0x03, 120,  1 },
+	{ 0x0622, 0x3E, 0x1C, 120,  1 },
+	{ 0x0754, 0x3B, 0x1C, 120,  1 },
+	{ 0x206F, 0x16, 0x03, 120,  1 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x09EA, 0x3C, 0x1D, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x272C, 0x3C, 0x14, 120,  1 },
+	{ 0x036E, 0x3C, 0x1E, 120,  1 },
+	{ 0x122B, 0x3C, 0x17, 120,  1 },
+	{ 0x0991, 0x4E, 0x0B, 120,  1 },
+	{ 0x02BC, 0x47, 0x1B, 120,  1 },
+	{ 0x0211, 0x4C, 0x1B, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0156, 0x3C, 0x13, 120,  1 },
+	{ 0x0156, 0x3C, 0x13, 120,  1 },
+	{ 0x0E9E, 0x3C, 0x1F, 120,  1 },
+	{ 0x010C, 0x3C, 0x20, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x0F7C, 0x3C, 0x21, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x4C47, 0x2A, 0x0B, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0528, 0x3C, 0x1B, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0910, 0x2C, 0x04, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0AEE, 0x3C, 0x22, 120,  1 },
+	{ 0x1E97, 0x3C, 0x16, 120,  1 },
+	{ 0x1B91, 0x3C, 0x15, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x272C, 0x3C, 0x14, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0AEE, 0x3C, 0x22, 120,  1 },
+	{ 0x272C, 0x3C, 0x14, 120,  1 },
+	{ 0x1419, 0x32, 0x23, 156,  1 },
+	{ 0x171C, 0x3C, 0x19, 120,  1 },
+	{ 0x272C, 0x3C, 0x14, 120,  1 },
+	{ 0x0622, 0x3E, 0x1C, 120,  1 },
+	{ 0x0201, 0x43, 0x13, 120,  1 },
+	{ 0x1243, 0x3C, 0x24,  90,  1 },
+	{ 0x00EE, 0x3E, 0x20, 120,  1 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x19EA, 0x29, 0x04, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x010C, 0x3C, 0x20, 120,  1 },
+	{ 0x30B6, 0x3C, 0x25, 120,  1 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x1E97, 0x3C, 0x16, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x3AEB, 0x3C, 0x1A, 120,  1 },
+	{ 0x39F3, 0x1B, 0x04, 120,  1 },
+	{ 0x1699, 0x30, 0x23,  80,  1 },
+	{ 0x1B91, 0x3C, 0x15, 120,  1 },
+	{ 0x19EA, 0x29, 0x06,  80,  1 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x3AEB, 0x3C, 0x1A, 120,  1 },
+	{ 0x252C, 0x3C, 0x19, 120,  1 },
+	{ 0x0713, 0x3C, 0x26, 120,  1 },
+	{ 0x0713, 0x3C, 0x26, 120,  1 },
+	{ 0x272C, 0x3C, 0x14, 120,  1 },
+	{ 0x1699, 0x30, 0x23,  80,  1 },
+	{ 0x1699, 0x30, 0x23,  80,  1 },
+	{ 0x0000, 0x00, 0x00,   0,  0 },
+	{ 0x0156, 0x3C, 0x13, 120,  1 }
+};
+
 } // end of namespace Kyra
\ No newline at end of file

Modified: scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h	2009-07-17 21:23:54 UTC (rev 42574)
+++ scummvm/branches/gsoc2009-mods/engines/kyra/sound_intern.h	2009-07-18 00:04:28 UTC (rev 42575)
@@ -310,6 +310,13 @@
 	uint _fileLoaded;
 
 	static const char *const kFilenameTable[3][2];
+	static const struct EffectEntry {
+		uint16	duration;
+		uint8	note;
+		uint8	patch;
+		int8	volume;
+		int8	pan;
+	} kEffectsTable[120];
 };
 
 } // end of namespace Kyra

Modified: scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp	2009-07-17 21:23:54 UTC (rev 42574)
+++ scummvm/branches/gsoc2009-mods/sound/mods/maxtrax.cpp	2009-07-18 00:04:28 UTC (rev 42575)
@@ -48,7 +48,7 @@
 
 	uint32 colorClock = kPalSystemClock / 2;
 
-	for (int i = 0; i < kNumChannels; ++i)
+	for (int i = 0; i < ARRAYSIZE(_channelCtx); ++i)
 		resetChannel(_channelCtx[i], (i & 1) != 0);
 
 	// init extraChannel
@@ -92,8 +92,8 @@
 			const uint16 stopTime = curEvent->stopTime;
 			ChannelContext &channel = _channelCtx[data & 0x0F];
 
-			outPutEvent(*curEvent);
-			debug("CurTime, EventDelta, NextDelta: %d, %d, %d", millis, eventDelta, eventDelta + curEvent[1].startTime );
+			//outPutEvent(*curEvent);
+			//debug("CurTime, EventDelta, NextDelta: %d, %d, %d", millis, eventDelta, eventDelta + curEvent[1].startTime );
 
 			if (cmd < 0x80) {	// Note
 				const uint16 vol = (data & 0xF0) >> 1;
@@ -307,6 +307,7 @@
 bool MaxTrax::doSong(int songIndex, int advance) {
 	if (songIndex < 0 || songIndex >= _numScores)
 		return false;
+	Common::StackLock lock(_mutex);
 	Paula::pausePlay(true);
 	_playerCtx.musicPlaying = false;
 	_playerCtx.musicLoop = false;
@@ -569,6 +570,7 @@
 }
 
 int MaxTrax::playNote(byte note, byte patch, uint16 duration, uint16 volume, bool rightSide) {
+	Common::StackLock lock(_mutex);
 	assert(patch < ARRAYSIZE(_patch));
 
 	ChannelContext &channel = _channelCtx[kNumChannels];
@@ -586,6 +588,7 @@
 }
 
 bool MaxTrax::load(Common::SeekableReadStream &musicData, bool loadScores, bool loadSamples) {
+	Common::StackLock lock(_mutex);
 	bool res = false;
 	stopMusic();
 	if (loadSamples)

Modified: scummvm/branches/gsoc2009-mods/tfmx/mxtxplayer.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/tfmx/mxtxplayer.cpp	2009-07-17 21:23:54 UTC (rev 42574)
+++ scummvm/branches/gsoc2009-mods/tfmx/mxtxplayer.cpp	2009-07-18 00:04:28 UTC (rev 42575)
@@ -88,7 +88,8 @@
 	}
 
 	if (!hasCmd) {
-
+		player->doSong(0);
+		player->playNote(0x18, 0x03, 0x0F52, 120,  1);
 	}
 
 	int maxsecs = 10 * 60;


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