aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohannes Schickel2009-08-29 07:52:24 +0000
committerJohannes Schickel2009-08-29 07:52:24 +0000
commitadf1df19c0a002123946379b3bfb1f537a66c869 (patch)
treeebd1b97d8bd37260e7471814e3fda92d00486c29 /tools
parent0ae1d719dbf5316b161430ffe2d0e8a1dd1a52d3 (diff)
downloadscummvm-rg350-adf1df19c0a002123946379b3bfb1f537a66c869.tar.gz
scummvm-rg350-adf1df19c0a002123946379b3bfb1f537a66c869.tar.bz2
scummvm-rg350-adf1df19c0a002123946379b3bfb1f537a66c869.zip
Move Amiga SFX tables to kyra.dat.
svn-id: r43793
Diffstat (limited to 'tools')
-rw-r--r--tools/create_kyradat/amiga.h2
-rw-r--r--tools/create_kyradat/create_kyradat.cpp58
-rw-r--r--tools/create_kyradat/create_kyradat.h4
-rw-r--r--tools/create_kyradat/misc.h2
4 files changed, 49 insertions, 17 deletions
diff --git a/tools/create_kyradat/amiga.h b/tools/create_kyradat/amiga.h
index 3b3aa2d5a5..19e1a15139 100644
--- a/tools/create_kyradat/amiga.h
+++ b/tools/create_kyradat/amiga.h
@@ -48,6 +48,8 @@ const ExtractEntry kyra1AmigaEng[] = {
{ kNewGameString, 0x00031164, 0x0003117A },
{ kConfigStrings, 0x00015ACA, 0x00015AF8 },
{ kCreditsStrings, 0x0000777C, 0x00007C48 },
+ { kAmigaIntroSFXTable, 0x00032D5C, 0x00032E9C },
+ { kAmigaGameSFXTable, 0x0002C55E, 0x0002C91E },
{ -1, 0, 0 }
};
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 43e17c80e0..15c17fa981 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -31,7 +31,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 51,
+ kKyraDatVersion = 52,
kIndexSize = 12
};
@@ -61,21 +61,22 @@ const Game kyra1FanTranslations[] = {
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 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 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);
+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 @@ const ExtractType extractTypeTable[] = {
{ kTypeRoomList, extractRooms, createFilename },
{ kTypeShapeList, extractShapes, createFilename },
{ kTypeRawData, extractRaw, createFilename },
+ { kTypeAmigaSfxTable, extractAmigaSfx, createFilename },
{ k2TypeSeqData, extractHofSeqData, createFilename },
{ k2TypeShpDataV1, extractHofShapeAnimDataV1, createFilename },
@@ -214,13 +216,16 @@ const ExtractFilename extractFilenames[] = {
{ 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 @@ bool extractShapes(PAKFile &out, const Game *g, const byte *data, const uint32 s
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;
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index 2a6e0a37c3..5941467aab 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -141,6 +141,9 @@ enum kExtractID {
kKyra1TownsCDATable,
kCreditsStrings,
+ kAmigaIntroSFXTable,
+ kAmigaGameSFXTable,
+
k2SeqplayPakFiles,
k2SeqplayStrings,
k2SeqplaySfxFiles,
@@ -346,6 +349,7 @@ enum kExtractType {
kTypeRoomList,
kTypeShapeList,
kTypeRawData,
+ kTypeAmigaSfxTable,
k2TypeSeqData,
k2TypeShpDataV1,
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index 2a14dab611..5379b8577b 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -369,6 +369,8 @@ const int kyra1AmigaNeed[] = {
kNewGameString,
kConfigStrings,
kCreditsStrings,
+ kAmigaIntroSFXTable,
+ kAmigaGameSFXTable,
-1
};