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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Aug 29 09:52:24 CEST 2009


Revision: 43793
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43793&view=rev
Author:   lordhoto
Date:     2009-08-29 07:52:24 +0000 (Sat, 29 Aug 2009)

Log Message:
-----------
Move Amiga SFX tables to kyra.dat.

Modified Paths:
--------------
    scummvm/trunk/dists/engine-data/kyra.dat
    scummvm/trunk/engines/kyra/resource.h
    scummvm/trunk/engines/kyra/sound_amiga.cpp
    scummvm/trunk/engines/kyra/sound_intern.h
    scummvm/trunk/engines/kyra/staticres.cpp
    scummvm/trunk/tools/create_kyradat/amiga.h
    scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
    scummvm/trunk/tools/create_kyradat/create_kyradat.h
    scummvm/trunk/tools/create_kyradat/misc.h

Modified: scummvm/trunk/dists/engine-data/kyra.dat
===================================================================
(Binary files differ)

Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/engines/kyra/resource.h	2009-08-29 07:52:24 UTC (rev 43793)
@@ -174,11 +174,15 @@
 	k1AudioTracks,
 	k1AudioTracksIntro,
 
+	k1CreditsStrings,
+
 	k1TownsSFXwdTable,
 	k1TownsSFXbtTable,
 	k1TownsCDATable,
-	k1CreditsStrings,
 
+	k1AmigaIntroSFXTable,
+	k1AmigaGameSFXTable,
+
 	k2SeqplayPakFiles,
 	k2SeqplayCredits,
 	k2SeqplayCreditsSpecial,
@@ -301,6 +305,7 @@
 
 struct Shape;
 struct Room;
+struct AmigaSfxTable;
 
 class StaticResource {
 public:
@@ -317,6 +322,7 @@
 	const char * const *loadStrings(int id, int &strings);
 	const uint8 *loadRawData(int id, int &size);
 	const Shape *loadShapeTable(int id, int &entries);
+	const AmigaSfxTable *loadAmigaSfxTable(int id, int &entries);
 	const Room *loadRoomTable(int id, int &entries);
 	const uint8 * const *loadPaletteTable(int id, int &entries);
 	const HofSeqData *loadHofSequenceData(int id, int &entries);
@@ -357,6 +363,7 @@
 	bool loadStringTable(const char *filename, void *&ptr, int &size);
 	bool loadRawData(const char *filename, void *&ptr, int &size);
 	bool loadShapeTable(const char *filename, void *&ptr, int &size);
+	bool loadAmigaSfxTable(const char *filename, void *&ptr, int &size);
 	bool loadRoomTable(const char *filename, void *&ptr, int &size);
 	bool loadPaletteTable(const char *filename, void *&ptr, int &size);
 	bool loadHofSequenceData(const char *filename, void *&ptr, int &size);
@@ -375,6 +382,7 @@
 	void freeRawData(void *&ptr, int &size);
 	void freeStringTable(void *&ptr, int &size);
 	void freeShapeTable(void *&ptr, int &size);
+	void freeAmigaSfxTable(void *&ptr, int &size);
 	void freeRoomTable(void *&ptr, int &size);
 	void freePaletteTable(void *&ptr, int &size);
 	void freeHofSequenceData(void *&ptr, int &size);
@@ -400,6 +408,7 @@
 		kShapeList,
 		kRawData,
 		kPaletteTable,
+		kAmigaSfxTable,
 
 		k2SeqData,
 		k2ShpAnimDataV1,

Modified: scummvm/trunk/engines/kyra/sound_amiga.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_amiga.cpp	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/engines/kyra/sound_amiga.cpp	2009-08-29 07:52:24 UTC (rev 43793)
@@ -32,26 +32,6 @@
 #include "sound/mods/maxtrax.h"
 #include "sound/audiostream.h"
 
-namespace {
-
-FORCEINLINE uint8 sfxTableGetNote(const byte* address) {
-	return (uint8)address[0];
-}
-FORCEINLINE uint8 sfxTableGetPatch(const byte* address) {
-	return (uint8)address[1];
-}
-FORCEINLINE uint16 sfxTableGetDuration(const byte* address) {
-	return READ_BE_UINT16(&address[4]);
-}
-FORCEINLINE int8 sfxTableGetVolume(const byte* address) {
-	return (int8)address[6];
-}
-FORCEINLINE int8 sfxTableGetPan(const byte* address) {
-	return (int8)address[7];
-}
-
-} // end of namespace
-
 namespace Kyra {
 
 SoundAmiga::SoundAmiga(KyraEngine_v1 *vm, Audio::Mixer *mixer)
@@ -59,8 +39,10 @@
 	  _driver(0),
 	  _musicHandle(),
 	  _fileLoaded(kFileNone),
-	  _tableSfxIntro(),
-	  _tableSfxGame() {
+	  _tableSfxIntro(0),
+	  _tableSfxGame(0),
+	  _tableSfxIntro_Size(0),
+	  _tableSfxGame_Size(0) {
 }
 
 SoundAmiga::~SoundAmiga() {
@@ -68,14 +50,12 @@
 	delete _driver;
 }
 
-extern const byte LoKAmigaSfxIntro[];
-extern const byte LoKAmigaSfxGame[];
-
 bool SoundAmiga::init() {
 	_driver = new Audio::MaxTrax(_mixer->getOutputRate(), true);
-	_tableSfxIntro = LoKAmigaSfxIntro;
-	_tableSfxGame = LoKAmigaSfxGame;
 
+	_tableSfxIntro = _vm->staticres()->loadAmigaSfxTable(k1AmigaIntroSFXTable, _tableSfxIntro_Size);
+	_tableSfxGame = _vm->staticres()->loadAmigaSfxTable(k1AmigaGameSFXTable, _tableSfxGame_Size);
+
 	return _driver != 0 && _tableSfxIntro && _tableSfxGame;
 }
 
@@ -201,16 +181,16 @@
 
 void SoundAmiga::playSoundEffect(uint8 track) {
 	debugC(5, kDebugLevelSound, "SoundAmiga::playSoundEffect(%d)", track);
-	const byte* tableEntry = 0;
+	const AmigaSfxTable *sfx = 0;
 	bool pan = false;
 
 	switch (_fileLoaded) {
 	case kFileFinal:
 	case kFileIntro:
 		// We only allow playing of sound effects, which are included in the table.
-		if (track < 40) {
-			tableEntry = &_tableSfxIntro[track * 8];
-			pan = (sfxTableGetPan(tableEntry) != 0);
+		if (track < _tableSfxIntro_Size) {
+			sfx = &_tableSfxIntro[track];
+			pan = (sfx->pan != 0);
 		}
 		break;
 
@@ -218,18 +198,22 @@
 		if (0x61 <= track && track <= 0x63)
 			playTrack(track - 0x4F);
 
-		assert(track < 120);
-		if (sfxTableGetNote(&_tableSfxGame[track * 8])) { 
-			tableEntry = &_tableSfxGame[track * 8];
-			pan = (sfxTableGetPan(tableEntry) != 0) && (sfxTableGetPan(tableEntry) != 2);
+		if (track >= _tableSfxGame_Size)
+			return;
+
+		if (_tableSfxGame[track].note) { 
+			sfx = &_tableSfxGame[track];
+			pan = (sfx->pan != 0) && (sfx->pan != 2);
 		}
+
 		break;
+
 	default:
-		;
+		return;
 	}
 
-	if (_sfxEnabled && tableEntry) {
-		const bool success = _driver->playNote(sfxTableGetNote(tableEntry), sfxTableGetPatch(tableEntry), sfxTableGetDuration(tableEntry), sfxTableGetVolume(tableEntry), pan);
+	if (_sfxEnabled && sfx) {
+		const bool success = _driver->playNote(sfx->note, sfx->patch, sfx->duration, sfx->volume, pan);
 		if (success && !_mixer->isSoundHandleActive(_musicHandle))
 			_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_musicHandle, _driver, -1, Audio::Mixer::kMaxChannelVolume, 0, false);
 	}

Modified: scummvm/trunk/engines/kyra/sound_intern.h
===================================================================
--- scummvm/trunk/engines/kyra/sound_intern.h	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/engines/kyra/sound_intern.h	2009-08-29 07:52:24 UTC (rev 43793)
@@ -285,6 +285,15 @@
 	static const uint8 _noteTable2[];
 };
 
+// for StaticResource (maybe we can find a nicer way to handle it)
+struct AmigaSfxTable {
+	uint8 note;
+	uint8 patch;
+	uint16 duration;
+	uint8 volume;
+	uint8 pan;
+};
+
 class SoundAmiga : public Sound {
 public:
 	SoundAmiga(KyraEngine_v1 *vm, Audio::Mixer *mixer);
@@ -309,8 +318,12 @@
 	Audio::MaxTrax *_driver;
 	Audio::SoundHandle _musicHandle;
 	enum FileType { kFileNone = -1, kFileIntro = 0, kFileGame = 1, kFileFinal = 2 } _fileLoaded;
-	const byte *_tableSfxIntro;
-	const byte *_tableSfxGame;
+
+	const AmigaSfxTable *_tableSfxIntro;
+	int _tableSfxIntro_Size;
+
+	const AmigaSfxTable *_tableSfxGame;
+	int _tableSfxGame_Size;
 };
 
 } // end of namespace Kyra

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2009-08-29 07:52:24 UTC (rev 43793)
@@ -41,10 +41,11 @@
 #include "kyra/gui_lol.h"
 #include "kyra/gui_hof.h"
 #include "kyra/gui_mr.h"
+#include "kyra/sound_intern.h"
 
 namespace Kyra {
 
-#define RESFILE_VERSION 51
+#define RESFILE_VERSION 52
 
 namespace {
 bool checkKyraDat(Common::SeekableReadStream *file) {
@@ -219,6 +220,7 @@
 		{ kStringList, proc(loadStringTable), proc(freeStringTable) },
 		{ StaticResource::kRoomList, proc(loadRoomTable), proc(freeRoomTable) },
 		{ kShapeList, proc(loadShapeTable), proc(freeShapeTable) },
+		{ kAmigaSfxTable, proc(loadAmigaSfxTable), proc(freeAmigaSfxTable) },
 		{ kRawData, proc(loadRawData), proc(freeRawData) },
 		{ kPaletteTable, proc(loadPaletteTable), proc(freePaletteTable) },
 
@@ -322,8 +324,14 @@
 		{ k1TownsSFXwdTable, kRawData, "SFXWDTABLE" },
 		{ k1TownsSFXbtTable, kRawData, "SFXBTTABLE" },
 		{ k1TownsCDATable, kRawData, "CDATABLE" },
+
+		// CREDITS (used in FM-TOWNS and AMIGA)
 		{ k1CreditsStrings, kRawData, "CREDITS" },
 
+		// AMIGA specific
+		{ k1AmigaIntroSFXTable, kAmigaSfxTable, "SFXINTRO" },
+		{ k1AmigaGameSFXTable, kAmigaSfxTable, "SFXGAME" },
+
 		{ 0, 0, 0 }
 	};
 
@@ -507,6 +515,10 @@
 	return (const Shape *)getData(id, kShapeList, entries);
 }
 
+const AmigaSfxTable *StaticResource::loadAmigaSfxTable(int id, int &entries) {
+	return (const AmigaSfxTable *)getData(id, kAmigaSfxTable, entries);
+}
+
 const Room *StaticResource::loadRoomTable(int id, int &entries) {
 	return (const Room *)getData(id, StaticResource::kRoomList, entries);
 }
@@ -774,6 +786,29 @@
 	return true;
 }
 
+bool StaticResource::loadAmigaSfxTable(const char *filename, void *&ptr, int &size) {
+	Common::SeekableReadStream *file = getFile(filename);
+	if (!file)
+		return false;
+
+	size = file->readUint32BE();
+	AmigaSfxTable *loadTo = new AmigaSfxTable[size];
+	assert(loadTo);
+
+	for (int i = 0; i < size; ++i) {
+		loadTo[i].note = file->readByte();
+		loadTo[i].patch = file->readByte();
+		loadTo[i].duration = file->readUint16BE();
+		loadTo[i].volume = file->readByte();
+		loadTo[i].pan = file->readByte();
+	}
+
+	delete file;
+	ptr = loadTo;
+
+	return true;
+}
+
 bool StaticResource::loadRoomTable(const char *filename, void *&ptr, int &size) {
 	Common::SeekableReadStream *file = getFile(filename);
 	if (!file)
@@ -1205,6 +1240,13 @@
 	size = 0;
 }
 
+void StaticResource::freeAmigaSfxTable(void *&ptr, int &size) {
+	AmigaSfxTable *data = (AmigaSfxTable *)ptr;
+	delete[] data;
+	ptr = 0;
+	size = 0;
+}
+
 void StaticResource::freeRoomTable(void *&ptr, int &size) {
 	Room *data = (Room *)ptr;
 	delete[] data;
@@ -3400,172 +3442,5 @@
 
 #endif // ENABLE_LOL
 
-// TODO: fileoffset = 0x32D5C, len = 40 * 8
-extern const byte LoKAmigaSfxIntro[] = {
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x6E, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x6E, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x6E, 0x00,
-	0x3C, 0x13, 0x00, 0x00, 0x1B, 0x91, 0x6E, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x16, 0x00, 0x00, 0x26, 0x77, 0x6E, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x17, 0x00, 0x00, 0x11, 0x98, 0x6E, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x6E, 0x00,
-	0x3C, 0x18, 0x00, 0x00, 0x22, 0xD1, 0x6E, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x6E, 0x00,
-	0x45, 0x03, 0x00, 0x00, 0x02, 0x24, 0x6E, 0x00,
-	0x3C, 0x16, 0x00, 0x00, 0x26, 0x77, 0x6E, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-// TODO: fileoffset = 0x2C55E, len = 120 * 8
-extern const byte LoKAmigaSfxGame[] = {
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x13, 0x00, 0x00, 0x01, 0x56, 0x78, 0x02,
-	0x3C, 0x14, 0x00, 0x00, 0x27, 0x2C, 0x78, 0x02,
-	0x3C, 0x15, 0x00, 0x00, 0x1B, 0x91, 0x78, 0x02,
-	0x3C, 0x16, 0x00, 0x00, 0x1E, 0x97, 0x78, 0x02,
-	0x3C, 0x17, 0x00, 0x00, 0x12, 0x2B, 0x78, 0x02,
-	0x3C, 0x16, 0x00, 0x00, 0x1E, 0x97, 0x78, 0x02,
-	0x45, 0x03, 0x00, 0x00, 0x02, 0x24, 0x78, 0x02,
-	0x3C, 0x16, 0x00, 0x00, 0x1E, 0x97, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x2C, 0x04, 0x00, 0x00, 0x09, 0x10, 0x78, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x3C, 0x1A, 0x00, 0x00, 0x3A, 0xEB, 0x78, 0x02,
-	0x25, 0x1B, 0x00, 0x00, 0x13, 0x8B, 0x78, 0x02,
-	0x18, 0x03, 0x00, 0x00, 0x0F, 0x52, 0x78, 0x02,
-	0x3E, 0x1C, 0x00, 0x00, 0x06, 0x22, 0x78, 0x02,
-	0x3B, 0x1C, 0x00, 0x00, 0x07, 0x54, 0x78, 0x02,
-	0x16, 0x03, 0x00, 0x00, 0x20, 0x6F, 0x78, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x3C, 0x1D, 0x00, 0x00, 0x09, 0xEA, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x14, 0x00, 0x00, 0x27, 0x2C, 0x78, 0x02,
-	0x3C, 0x1E, 0x00, 0x00, 0x03, 0x6E, 0x78, 0x02,
-	0x3C, 0x17, 0x00, 0x00, 0x12, 0x2B, 0x78, 0x02,
-	0x4E, 0x0B, 0x00, 0x00, 0x09, 0x91, 0x78, 0x02,
-	0x47, 0x1B, 0x00, 0x00, 0x02, 0xBC, 0x78, 0x02,
-	0x4C, 0x1B, 0x00, 0x00, 0x02, 0x11, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x13, 0x00, 0x00, 0x01, 0x56, 0x78, 0x02,
-	0x3C, 0x13, 0x00, 0x00, 0x01, 0x56, 0x78, 0x02,
-	0x3C, 0x1F, 0x00, 0x00, 0x0E, 0x9E, 0x78, 0x02,
-	0x3C, 0x20, 0x00, 0x00, 0x01, 0x0C, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x3C, 0x21, 0x00, 0x00, 0x0F, 0x7C, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x2A, 0x0B, 0x00, 0x00, 0x4C, 0x47, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x1B, 0x00, 0x00, 0x05, 0x28, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x2C, 0x04, 0x00, 0x00, 0x09, 0x10, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x22, 0x00, 0x00, 0x0A, 0xEE, 0x78, 0x02,
-	0x3C, 0x16, 0x00, 0x00, 0x1E, 0x97, 0x78, 0x02,
-	0x3C, 0x15, 0x00, 0x00, 0x1B, 0x91, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x14, 0x00, 0x00, 0x27, 0x2C, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x22, 0x00, 0x00, 0x0A, 0xEE, 0x78, 0x02,
-	0x3C, 0x14, 0x00, 0x00, 0x27, 0x2C, 0x78, 0x02,
-	0x32, 0x23, 0x00, 0x00, 0x14, 0x19, 0x9C, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x17, 0x1C, 0x78, 0x02,
-	0x3C, 0x14, 0x00, 0x00, 0x27, 0x2C, 0x78, 0x02,
-	0x3E, 0x1C, 0x00, 0x00, 0x06, 0x22, 0x78, 0x02,
-	0x43, 0x13, 0x00, 0x00, 0x02, 0x01, 0x78, 0x02,
-	0x3C, 0x24, 0x00, 0x00, 0x12, 0x43, 0x5A, 0x02,
-	0x3E, 0x20, 0x00, 0x00, 0x00, 0xEE, 0x78, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x29, 0x04, 0x00, 0x00, 0x19, 0xEA, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x20, 0x00, 0x00, 0x01, 0x0C, 0x78, 0x02,
-	0x3C, 0x25, 0x00, 0x00, 0x30, 0xB6, 0x78, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x16, 0x00, 0x00, 0x1E, 0x97, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x1A, 0x00, 0x00, 0x3A, 0xEB, 0x78, 0x02,
-	0x1B, 0x04, 0x00, 0x00, 0x39, 0xF3, 0x78, 0x02,
-	0x30, 0x23, 0x00, 0x00, 0x16, 0x99, 0x50, 0x02,
-	0x3C, 0x15, 0x00, 0x00, 0x1B, 0x91, 0x78, 0x02,
-	0x29, 0x06, 0x00, 0x00, 0x19, 0xEA, 0x50, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x1A, 0x00, 0x00, 0x3A, 0xEB, 0x78, 0x02,
-	0x3C, 0x19, 0x00, 0x00, 0x25, 0x2C, 0x78, 0x02,
-	0x3C, 0x26, 0x00, 0x00, 0x07, 0x13, 0x78, 0x02,
-	0x3C, 0x26, 0x00, 0x00, 0x07, 0x13, 0x78, 0x02,
-	0x3C, 0x14, 0x00, 0x00, 0x27, 0x2C, 0x78, 0x02,
-	0x30, 0x23, 0x00, 0x00, 0x16, 0x99, 0x50, 0x02,
-	0x30, 0x23, 0x00, 0x00, 0x16, 0x99, 0x50, 0x02,
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x3C, 0x13, 0x00, 0x00, 0x01, 0x56, 0x78, 0x02
-};
-
 } // End of namespace Kyra
+

Modified: scummvm/trunk/tools/create_kyradat/amiga.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/amiga.h	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/tools/create_kyradat/amiga.h	2009-08-29 07:52:24 UTC (rev 43793)
@@ -48,6 +48,8 @@
 	{ kNewGameString, 0x00031164, 0x0003117A },
 	{ kConfigStrings, 0x00015ACA, 0x00015AF8 },
 	{ kCreditsStrings, 0x0000777C, 0x00007C48 },
+	{ kAmigaIntroSFXTable, 0x00032D5C, 0x00032E9C },
+	{ kAmigaGameSFXTable, 0x0002C55E, 0x0002C91E },
 	{ -1, 0, 0 }
 };
 

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2009-08-29 07:52:24 UTC (rev 43793)
@@ -31,7 +31,7 @@
 #include "md5.h"
 
 enum {
-	kKyraDatVersion = 51,
+	kKyraDatVersion = 52,
 	kIndexSize = 12
 };
 
@@ -61,21 +61,22 @@
 	GAME_DUMMY_ENTRY
 };
 
-bool extractRaw(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractRooms(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractShapes(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractHofShapeAnimDataV1(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractHofShapeAnimDataV2(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractRaw(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractRooms(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractShapes(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractAmigaSfx(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractHofShapeAnimDataV1(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractHofShapeAnimDataV2(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
 
-bool extractStringsWoSuffix(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractRaw16(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractRaw32(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
-bool extractLolButtonDefs(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractStringsWoSuffix(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractRaw16(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractRaw32(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
+bool extractLolButtonDefs(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch);
 
 int extractHofSeqData_checkString(const void *ptr, uint8 checkSize);
 int extractHofSeqData_isSequence(const void *ptr, const Game *g, uint32 maxCheckSize);
@@ -90,6 +91,7 @@
 	{ kTypeRoomList, extractRooms, createFilename },
 	{ kTypeShapeList, extractShapes, createFilename },
 	{ kTypeRawData, extractRaw, createFilename },
+	{ kTypeAmigaSfxTable, extractAmigaSfx, createFilename },
 
 	{ k2TypeSeqData, extractHofSeqData, createFilename },
 	{ k2TypeShpDataV1, extractHofShapeAnimDataV1, createFilename },
@@ -214,13 +216,16 @@
 	{ kPaletteList31, kTypeRawData, "PALTABLE31.PAL" },
 	{ kPaletteList32, kTypeRawData, "PALTABLE32.PAL" },
 	{ kPaletteList33, kTypeRawData, "PALTABLE33.PAL" },
+	{ kCreditsStrings, kTypeRawData, "CREDITS" },
 
 	// FM-TOWNS specific
 	{ kKyra1TownsSFXwdTable, kTypeRawData, "SFXWDTABLE" },
 	{ kKyra1TownsSFXbtTable, kTypeRawData, "SFXBTTABLE" },
 	{ kKyra1TownsCDATable, kTypeRawData, "CDATABLE" },
-	{ kCreditsStrings, kTypeRawData, "CREDITS" },
 
+	// AMIGA specific
+	{ kAmigaIntroSFXTable, kTypeAmigaSfxTable, "SFXINTRO" },
+	{ kAmigaGameSFXTable, kTypeAmigaSfxTable, "SFXGAME" },
 
 	// HAND OF FATE
 
@@ -692,6 +697,25 @@
 	return out.addFile(filename, buffer, size + 1 * 4);
 }
 
+bool extractAmigaSfx(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+	const uint32 entries = size / 8;
+	byte *buffer = new byte[entries * 6 + 1 * 4];
+
+	byte *output = buffer;
+	WRITE_BE_UINT32(output, entries); output += 4;
+
+	for (uint32 i = 0; i < entries; ++i) {
+		*output++ = *data++;	// Note
+		*output++ = *data++;	// Patch
+		data += 2;				// Unused
+		WRITE_BE_UINT16(output, READ_BE_UINT16(data)); output += 2; data += 2; // Duration
+		*output++ = *data++;	// Volume
+		*output++ = *data++;	// Pan
+	}
+
+	return out.addFile(filename, buffer, entries * 6 + 1 * 4);
+}
+
 bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
 	int numSequences = 0;
 	int numNestedSequences = 0;

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.h	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.h	2009-08-29 07:52:24 UTC (rev 43793)
@@ -141,6 +141,9 @@
 	kKyra1TownsCDATable,
 	kCreditsStrings,
 
+	kAmigaIntroSFXTable,
+	kAmigaGameSFXTable,
+
 	k2SeqplayPakFiles,
 	k2SeqplayStrings,
 	k2SeqplaySfxFiles,
@@ -346,6 +349,7 @@
 	kTypeRoomList,
 	kTypeShapeList,
 	kTypeRawData,
+	kTypeAmigaSfxTable,
 
 	k2TypeSeqData,
 	k2TypeShpDataV1,

Modified: scummvm/trunk/tools/create_kyradat/misc.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/misc.h	2009-08-29 07:42:49 UTC (rev 43792)
+++ scummvm/trunk/tools/create_kyradat/misc.h	2009-08-29 07:52:24 UTC (rev 43793)
@@ -369,6 +369,8 @@
 	kNewGameString,
 	kConfigStrings,
 	kCreditsStrings,
+	kAmigaIntroSFXTable,
+	kAmigaGameSFXTable,
 	-1
 };
 


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