aboutsummaryrefslogtreecommitdiff
path: root/tools/create_kyradat
diff options
context:
space:
mode:
authorJohannes Schickel2008-01-27 02:06:59 +0000
committerJohannes Schickel2008-01-27 02:06:59 +0000
commit00672b32e1c176349d4621b071907b3e82633291 (patch)
tree092b3f8cefe4b6079101dc38888dcb70cd977760 /tools/create_kyradat
parent33a90c1e009cf93e9f135817b8fdb12706811972 (diff)
downloadscummvm-rg350-00672b32e1c176349d4621b071907b3e82633291.tar.gz
scummvm-rg350-00672b32e1c176349d4621b071907b3e82633291.tar.bz2
scummvm-rg350-00672b32e1c176349d4621b071907b3e82633291.zip
Commit patch #1870149 "KYRA: kyradat tool update (hof ingame sfx)". (slightly modified)
svn-id: r30646
Diffstat (limited to 'tools/create_kyradat')
-rw-r--r--tools/create_kyradat/create_kyradat.cpp24
-rw-r--r--tools/create_kyradat/create_kyradat.h3
-rw-r--r--tools/create_kyradat/hof_cd.h3
-rw-r--r--tools/create_kyradat/hof_floppy.h6
-rw-r--r--tools/create_kyradat/hof_towns.h2
-rw-r--r--tools/create_kyradat/misc.h7
6 files changed, 37 insertions, 8 deletions
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 7806da9f22..af002b5935 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -31,7 +31,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 18,
+ kKyraDatVersion = 19,
kIndexSize = 12
};
@@ -199,6 +199,7 @@ const ExtractFilename extractFilenames[] = {
// Sequence Player
{ k2SeqplayPakFiles, kTypeStringList, "S_PAKFILES.TXT" },
{ k2SeqplayCredits, kTypeRawData, "S_CREDITS.TXT" },
+ { k2SeqplayCreditsSpecial, kTypeStringList, "S_CREDITS2.TXT" },
{ k2SeqplayStrings, kTypeLanguageList, "S_STRINGS" },
{ k2SeqplaySfxFiles, kTypeStringList, "S_SFXFILES.TXT" },
{ k2SeqplayTlkFiles, kTypeLanguageList, "S_TLKFILES" },
@@ -210,6 +211,8 @@ const ExtractFilename extractFilenames[] = {
// Ingame
{ k2IngamePakFiles, kTypeStringList, "I_PAKFILES.TXT" },
+ { k2IngameSfxFiles, kTypeStringList, "I_SFXFILES.TXT" },
+ { k2IngameSfxIndex, kTypeRawData, "I_SFXINDEX.TRA" },
{ k2IngameTracks, kTypeStringList, "I_TRACKS.TRA" },
{ k2IngameCDA, kTypeRawData, "I_TRACKS.CDA" },
@@ -372,7 +375,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ ||
g->special == k2TownsFile1E || g->special == k2TownsFile1J ||
- g->special == k2TownsFile2E || g->special == k2TownsFile2J) {
+ g->special == k2TownsFile2E || g->special == k2TownsFile2J || fmtPatch == 5) {
// prevents creation of empty entries (which we have mostly between all strings in the fm-towns version)
while (!data[++i]) {
if (i == size)
@@ -429,7 +432,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
WRITE_BE_UINT32(output, entries); output += 4;
if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ ||
g->special == k2TownsFile1E || g->special == k2TownsFile1J ||
- g->special == k2TownsFile2E || g->special == k2TownsFile2J) {
+ g->special == k2TownsFile2E || g->special == k2TownsFile2J || fmtPatch == 5) {
const byte * c = data + size;
do {
if (fmtPatch == 2 && input - data == 0x3C0 && input[0x10] == 0x32) {
@@ -580,9 +583,9 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
int v = extractHofSeqData_isSequence(ptr, g, endOffs - ptr);
if (cycle == 0 && v == 1) {
- if (g->special == k2FloppyFile1 && *ptr == 5) {
- // patch for floppy version
- // skips invalid ferb sequence
+ if ((g->special == k2FloppyFile1 && *ptr == 5) || (g->special == k2DemoVersion && (ptr - data == 312))) {
+ // patch for floppy version: skips invalid ferb sequence
+ // patch for demo: skips invalid title sequence
ptr += 54;
continue;
}
@@ -815,12 +818,12 @@ int extractHofSeqData_isControl(const void *ptr, uint32 size) {
// return values: 1 = possible frame control data; 0 = definitely not frame control data
const uint8 *s = (const uint8*)ptr;
- for (uint i = 2; i < size; i += 4) {
+ for (uint32 i = 2; i < size; i += 4) {
if (!s[i])
return 0;
}
- for (uint i = 1; i < size; i += 2) {
+ for (uint32 i = 1; i < size; i += 2) {
if (s[i])
return 0;
}
@@ -1090,6 +1093,11 @@ bool process(PAKFile &out, const Game *g, const byte *data, const uint32 size) {
if (i->id == k2IngamePakFiles)
patch = 4;
}
+
+ if (g->special == k2FloppyFile2 || g->special == k2CDFile2E) {
+ if (i->id == k2IngameSfxFiles)
+ patch = 5;
+ }
if (!tDesc->extract(out, g, data + i->startOff, i->endOff - i->startOff, filename, patch)) {
fprintf(stderr, "ERROR: couldn't extract id %d\n", i->id);
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index d933f21330..85c5f8973d 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -147,12 +147,15 @@ enum kExtractID {
k2SeqplayTlkFiles,
k2SeqplaySeqData,
k2SeqplayCredits,
+ k2SeqplayCreditsSpecial,
k2SeqplayIntroTracks,
k2SeqplayFinaleTracks,
k2SeqplayIntroCDA,
k2SeqplayFinaleCDA,
k2IngamePakFiles,
+ k2IngameSfxFiles,
+ k2IngameSfxIndex,
k2IngameTracks,
k2IngameCDA,
diff --git a/tools/create_kyradat/hof_cd.h b/tools/create_kyradat/hof_cd.h
index 0b6f05c3c8..910bacb474 100644
--- a/tools/create_kyradat/hof_cd.h
+++ b/tools/create_kyradat/hof_cd.h
@@ -1,6 +1,7 @@
const ExtractEntry kyra2File1CDE[] = {
{ k2SeqplayPakFiles, 0x00029FA4, 0x00029FEA },
{ k2SeqplayCredits, 0x00027920, 0x00028408 },
+ { k2SeqplayCreditsSpecial, 0x00029E01, 0x00029E1B },
{ k2SeqplayStrings, 0x0002C566, 0x0002CE7C },
{ k2SeqplaySfxFiles, 0x0002E284, 0x0002E4B8 },
{ k2SeqplayTlkFiles, 0x0002A2AC, 0x0002A349 },
@@ -23,6 +24,8 @@ const ExtractEntry kyra2File1CDG[] = {
};
const ExtractEntry kyra2File2CDE[] = {
+ { k2IngameSfxFiles, 0x0002CB30, 0x0002D221 },
+ { k2IngameSfxIndex, 0x000294F0, 0x00029848 },
{ k2IngameTracks, 0x0002F2FE, 0x0002F37E },
{ -1, 0, 0 }
};
diff --git a/tools/create_kyradat/hof_floppy.h b/tools/create_kyradat/hof_floppy.h
index 0e58ca0d77..c446b513b4 100644
--- a/tools/create_kyradat/hof_floppy.h
+++ b/tools/create_kyradat/hof_floppy.h
@@ -31,18 +31,24 @@ const ExtractEntry kyra2File1G[] = {
const ExtractEntry kyra2File2E[] = {
{ k2IngamePakFiles, 0x0035E4E, 0x00362ED },
+ { k2IngameSfxFiles, 0x00034700, 0x00034DF1 },
+ { k2IngameSfxIndex, 0x0002A710, 0x0002AA68 },
{ k2IngameTracks, 0x0003B2F2, 0x0003B370 },
{ -1, 0, 0 }
};
const ExtractEntry kyra2File2F[] = {
{ k2IngamePakFiles, 0x0003AA9C, 0x0003AB1A },
+ { k2IngameSfxFiles, 0x00033E24, 0x00034515 },
+ { k2IngameSfxIndex, 0x000288B0, 0x00028C08 },
{ k2IngameTracks, 0x0003B2F2, 0x0003B370 },
{ -1, 0, 0 }
};
const ExtractEntry kyra2File2G[] = {
{ k2IngamePakFiles, 0x0035626, 0x0035AC5 },
+ { k2IngameSfxFiles, 0x00033ED8, 0x000345C9 },
+ { k2IngameSfxIndex, 0x000288E0, 0x00028C38 },
{ k2IngameTracks, 0x0003AA8C, 0x0003AB0A },
{ -1, 0, 0 }
};
diff --git a/tools/create_kyradat/hof_towns.h b/tools/create_kyradat/hof_towns.h
index 1acf92095c..5455e153bb 100644
--- a/tools/create_kyradat/hof_towns.h
+++ b/tools/create_kyradat/hof_towns.h
@@ -15,6 +15,8 @@ const ExtractEntry kyra2File1FMTownsJ[] = {
const ExtractEntry kyra2File2FMTownsE[] = {
{ k2IngamePakFiles, 0x00000540, 0x0000065C },
+ { k2IngameSfxFiles, 0x00003E3C, 0x000047A3 },
+ { k2IngameSfxIndex, 0x00013980, 0x00013CD8 },
{ k2IngameCDA, 0x0001808C, 0x000181BC },
{ -1, 0, 0 }
};
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index 118bc1a28e..c6949440d5 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -359,6 +359,7 @@ const int kyra1AmigaNeed[] = {
const int kyra2CDFile1EngNeed[] = {
k2SeqplayPakFiles,
k2SeqplayCredits,
+ k2SeqplayCreditsSpecial,
k2SeqplayStrings,
k2SeqplaySfxFiles,
k2SeqplaySeqData,
@@ -378,6 +379,8 @@ const int kyra2CDFile1GerNeed[] = {
};
const int kyra2CDFile2EngNeed[] = {
+ k2IngameSfxFiles,
+ k2IngameSfxIndex,
k2IngameTracks,
-1
};
@@ -402,6 +405,8 @@ const int kyra2FloppyFile1Need[] = {
const int kyra2FloppyFile2Need[] = {
k2IngamePakFiles,
+ k2IngameSfxFiles,
+ k2IngameSfxIndex,
k2IngameTracks,
-1
};
@@ -423,6 +428,8 @@ const int kyra2TownsFile1JapNeed[] = {
const int kyra2TownsFile2EngNeed[] = {
k2IngamePakFiles,
+ k2IngameSfxFiles,
+ k2IngameSfxIndex,
k2IngameCDA,
-1
};