aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/create_kyradat/Makefile2
-rw-r--r--tools/create_kyradat/amiga.h57
-rw-r--r--tools/create_kyradat/create_kyradat.cpp50
-rw-r--r--tools/create_kyradat/create_kyradat.h3
-rw-r--r--tools/create_kyradat/misc.h59
5 files changed, 156 insertions, 15 deletions
diff --git a/tools/create_kyradat/Makefile b/tools/create_kyradat/Makefile
index ce4fa5ca91..7319ad0658 100644
--- a/tools/create_kyradat/Makefile
+++ b/tools/create_kyradat/Makefile
@@ -19,7 +19,7 @@ clean:
rm -f $(BIN)
rm -f $(OBJS)
-create_kyradat.o: eng.h esp.h fre.h ger.h misc.h pak.h towns.h util.h md5.h
+create_kyradat.o: amiga.h eng.h esp.h fre.h ger.h misc.h pak.h towns.h util.h md5.h
pak.o: pak.h util.h
%.o: %.cpp
diff --git a/tools/create_kyradat/amiga.h b/tools/create_kyradat/amiga.h
new file mode 100644
index 0000000000..26fcddf614
--- /dev/null
+++ b/tools/create_kyradat/amiga.h
@@ -0,0 +1,57 @@
+const ExtractEntry kyra1AmigaEng[] = {
+ { kKallakWritingSeq, 0x00031D26, 0x0003251A },
+ { kMalcolmTreeSeq, 0x0003251A, 0x0003272E },
+ { kWestwoodLogoSeq, 0x0003272E, 0x0003277B },
+ { kKyrandiaLogoSeq, 0x0003277B, 0x000327D7 },
+ { kKallakMalcolmSeq, 0x000327D7, 0x00032A52 },
+ { kForestSeq, 0x00032A52, 0x00032D30 },
+ { kIntroCPSStrings, 0x0000CAC4, 0x0000CADA },
+ { kIntroWSAStrings, 0x0000CADA, 0x0000CB60 },
+ { kIntroCOLStrings, 0x0000CB60, 0x0000CB8E },
+ { kIntroStrings, 0x0000CB8E, 0x0000D098 },
+ { kRoomList, 0x00032F68, 0x00037E34 },
+ { kRoomFilenames, 0x00012330, 0x00012638 },
+ { kCharacterImageFilenames, 0x0000C814, 0x0000C904 },
+ { kDefaultShapes, 0x00039230, 0x000396BA },
+ { kItemNames, 0x0001A3B8, 0x0001A738 },
+ { kTakenStrings, 0x0000F9F4, 0x0000FAF0 },
+ { kPlacedStrings, 0x0000FAF0, 0x0000FAFA },
+ { kDroppedStrings, 0x000101F2, 0x000101FC },
+ { kNoDropStrings, 0x0000C98E, 0x0000C9D6 },
+ { kAmuleteAnimSeq, 0x0002C980, 0x0002C9AA },
+ { kPutDownString, 0x0000499E, 0x000049C4 },
+ { kWaitAmuletString, 0x000049C4, 0x00004A02 },
+ { kBlackJewelString, 0x00004A02, 0x00004A26 },
+ { kHealingTipString, 0x00004A26, 0x00004A54 },
+ { kPoisonGoneString, 0x00004ABE, 0x00004AEC },
+ { kHealing1Shapes, 0x00039723, 0x000397BD },
+ { kHealing2Shapes, 0x000397BD, 0x0003988F },
+ { kThePoisonStrings, 0x00017768, 0x000177C0 },
+ { kFluteStrings, 0x0000038A, 0x000003C6 },
+ { kPoisonDeathShapes, 0x00039B83, 0x00039C0F },
+ { kFluteShapes, 0x00039A87, 0x00039B83 },
+ { kWinter1Shapes, 0x0003988F, 0x000398C0 },
+ { kWinter2Shapes, 0x000398C0, 0x000399B5 },
+ { kWinter3Shapes, 0x000399B5, 0x000399D1 },
+ { kDrinkShapes, 0x000396BA, 0x00039723 },
+ { kWispShapes, 0x000399D1, 0x00039A87 },
+ { kMagicAnimShapes, 0x00039C0F, 0x00039C32 },
+ { kBranStoneShapes, 0x00039C32, 0x00039CA0 },
+ { kWispJewelStrings, 0x00004A54, 0x00004AAA },
+ { kMagicJewelStrings, 0x00004AAA, 0x00004ABE },
+ { kFlaskFullString, 0x00017B04, 0x00017B9E },
+ { kFullFlaskString, 0x00017B9E, 0x00017BBA },
+ { kOutroReunionSeq, 0x00030A4A, 0x00030F94 },
+ { kOutroHomeString, 0x0000C6FA, 0x0000C6FF },
+ { kVeryCleverString, 0x0000B322, 0x0000B354 },
+ { kGUIStrings, 0x0003844D, 0x0003862C },
+ { kNewGameString, 0x00031164, 0x0003117A },
+ { kConfigStrings, 0x00015ACA, 0x00015AF8 },
+ { kCreditsStrings, 0x0000777C, 0x00007C48 },
+ { -1, 0, 0 }
+};
+
+const Game kyra1AmigaGames[] = {
+ { kKyra1, EN_ANY, kAmigaVersion, "b620564b6b7e0787b053ca9e35bd9f52", kyra1AmigaEng },
+ GAME_DUMMY_ENTRY
+};
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index f4e30a7500..ab2d8783fa 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -25,7 +25,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 16,
+ kKyraDatVersion = 17,
kIndexSize = 12
};
@@ -37,6 +37,7 @@ enum {
#include "fre.h"
#include "ger.h"
#include "towns.h"
+#include "amiga.h"
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);
@@ -309,7 +310,13 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
uint32 targetsize = size + 4;
for (uint32 i = 0; i < size; ++i) {
if (!data[i]) {
- ++entries;
+ if (g->special == kAmigaVersion) {
+ if (!((i + 1) & 0x1))
+ ++entries;
+ } else {
+ ++entries;
+ }
+
if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) {
// prevents creation of empty entries (which we have mostly between all strings in the fm-towns version)
while (!data[++i]) {
@@ -389,6 +396,16 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
}
} while (input < c);
+ } else if (g->special == kAmigaVersion) {
+ // we need to strip some aligment zeros out here
+ int dstPos = 0;
+ for (int i = 0; i < size; ++i) {
+ if (!data[i] && ((i+1) & 0x1))
+ continue;
+ *output++ = data[i];
+ ++dstPos;
+ }
+ targetsize = dstPos + 4;
} else {
memcpy(output, data, size);
}
@@ -398,7 +415,8 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
bool extractRooms(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
// different entry size for the fm-towns version
- const int countRooms = (g->special == kFMTownsVersionE) ? (size / 0x69) : (size / 0x51);
+ const int roomEntrySize = (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) ? (0x69) : ((g->special == kAmigaVersion) ? 0x52 : 0x51);
+ const int countRooms = size / roomEntrySize;
uint8 *buffer = new uint8[countRooms * 9 + 4];
assert(buffer);
@@ -407,14 +425,21 @@ bool extractRooms(PAKFile &out, const Game *g, const byte *data, const uint32 si
WRITE_BE_UINT32(output, countRooms); output += 4;
const byte *src = data;
- for (int i = 0; i < countRooms; ++i) {
- *output++ = *src++;
- WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
- WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
- WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
- WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
- // different entry size for the fm-towns version
- src += (g->special == kFMTownsVersionE) ? 0x60 : (0x51 - 9);
+ if (g->special == kAmigaVersion) {
+ for (int i = 0; i < countRooms; ++i) {
+ *output++ = *src++; assert(*src == 0); ++src;
+ memcpy(output, src, 8); output += 0x8;
+ src += roomEntrySize - 0x2;
+ }
+ } else {
+ for (int i = 0; i < countRooms; ++i) {
+ *output++ = *src++;
+ WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
+ WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
+ WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
+ WRITE_BE_UINT16(output, READ_LE_UINT16(src)); output += 2; src += 2;
+ src += roomEntrySize - 0x9;
+ }
}
return out.addFile(filename, buffer, countRooms * 9 + 4);
@@ -459,6 +484,8 @@ uint32 getFeatures(const Game *g) {
features |= GF_DEMO;
else if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ)
features |= GF_FMTOWNS;
+ else if (g->special == kAmigaVersion)
+ features |= GF_AMIGA;
else
features |= GF_FLOPPY;
@@ -690,6 +717,7 @@ const Game *gameDescs[] = {
kyra1FreGames,
kyra1GerGames,
kyra1TownsGames,
+ kyra1AmigaGames,
0
};
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index 2a75702e01..2f1fce60b8 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -157,7 +157,8 @@ enum kSpecial {
kTalkieVersion = 0,
kDemoVersion = 1,
kFMTownsVersionE = 2,
- kFMTownsVersionJ = 3
+ kFMTownsVersionJ = 3,
+ kAmigaVersion = 4
};
struct SpecialExtension {
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index f4fd212839..c6b1cc4731 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -298,11 +298,65 @@ const int kyra1TownsJapNeed[] = {
-1
};
+const int kyra1AmigaNeed[] = {
+ kKallakWritingSeq,
+ kMalcolmTreeSeq,
+ kWestwoodLogoSeq,
+ kKyrandiaLogoSeq,
+ kKallakMalcolmSeq,
+ kForestSeq,
+ kIntroCPSStrings,
+ kIntroWSAStrings,
+ kIntroCOLStrings,
+ kIntroStrings,
+ kRoomList,
+ kRoomFilenames,
+ kCharacterImageFilenames,
+ kDefaultShapes,
+ kItemNames,
+ kTakenStrings,
+ kPlacedStrings,
+ kDroppedStrings,
+ kNoDropStrings,
+ kAmuleteAnimSeq,
+ kPutDownString,
+ kWaitAmuletString,
+ kBlackJewelString,
+ kHealingTipString,
+ kPoisonGoneString,
+ kHealing1Shapes,
+ kHealing2Shapes,
+ kThePoisonStrings,
+ kFluteStrings,
+ kPoisonDeathShapes,
+ kFluteShapes,
+ kWinter1Shapes,
+ kWinter2Shapes,
+ kWinter3Shapes,
+ kDrinkShapes,
+ kWispShapes,
+ kMagicAnimShapes,
+ kBranStoneShapes,
+ kWispJewelStrings,
+ kMagicJewelStrings,
+ kFlaskFullString,
+ kFullFlaskString,
+ kOutroReunionSeq,
+ kOutroHomeString,
+ kVeryCleverString,
+ kGUIStrings,
+ kNewGameString,
+ kConfigStrings,
+ kCreditsStrings,
+ -1
+};
+
const GameNeed gameNeedTable[] = {
{ kKyra1, -1, kyra1FloppyNeed },
{ kKyra1, kTalkieVersion, kyra1CDNeed },
- { kKyra1, kFMTownsVersionE , kyra1TownsEngNeed},
- { kKyra1, kFMTownsVersionJ, kyra1TownsJapNeed},
+ { kKyra1, kFMTownsVersionE , kyra1TownsEngNeed },
+ { kKyra1, kFMTownsVersionJ, kyra1TownsJapNeed },
+ { kKyra1, kAmigaVersion, kyra1AmigaNeed },
{ kKyra1, kDemoVersion, kyra1DemoNeed },
{ -1, -1, 0 }
};
@@ -312,6 +366,7 @@ const SpecialExtension specialTable[] = {
{ kDemoVersion, "DEM" },
{ kFMTownsVersionE , "TNS" },
{ kFMTownsVersionJ, "TNS" },
+ { kAmigaVersion, "AMG" },
{ -1, 0 }
};