[Scummvm-cvs-logs] SF.net SVN: scummvm: [26112] scummvm/trunk/tools/create_kyradat

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Mar 12 21:42:28 CET 2007


Revision: 26112
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26112&view=rev
Author:   lordhoto
Date:     2007-03-12 13:42:28 -0700 (Mon, 12 Mar 2007)

Log Message:
-----------
Add support for Amiga static data resources.

Modified Paths:
--------------
    scummvm/trunk/tools/create_kyradat/Makefile
    scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
    scummvm/trunk/tools/create_kyradat/create_kyradat.h
    scummvm/trunk/tools/create_kyradat/misc.h

Added Paths:
-----------
    scummvm/trunk/tools/create_kyradat/amiga.h

Modified: scummvm/trunk/tools/create_kyradat/Makefile
===================================================================
--- scummvm/trunk/tools/create_kyradat/Makefile	2007-03-12 20:41:25 UTC (rev 26111)
+++ scummvm/trunk/tools/create_kyradat/Makefile	2007-03-12 20:42:28 UTC (rev 26112)
@@ -19,7 +19,7 @@
 	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

Added: scummvm/trunk/tools/create_kyradat/amiga.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/amiga.h	                        (rev 0)
+++ scummvm/trunk/tools/create_kyradat/amiga.h	2007-03-12 20:42:28 UTC (rev 26112)
@@ -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
+};


Property changes on: scummvm/trunk/tools/create_kyradat/amiga.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2007-03-12 20:41:25 UTC (rev 26111)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2007-03-12 20:42:28 UTC (rev 26112)
@@ -25,7 +25,7 @@
 #include "md5.h"
 
 enum {
-	kKyraDatVersion = 16,
+	kKyraDatVersion = 17,
 	kIndexSize = 12
 };
 
@@ -37,6 +37,7 @@
 #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 @@
 	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 @@
 			}
 
 		} 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 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 @@
 	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 @@
 		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 @@
 	kyra1FreGames,
 	kyra1GerGames,
 	kyra1TownsGames,
+	kyra1AmigaGames,
 	0
 };
 

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.h	2007-03-12 20:41:25 UTC (rev 26111)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.h	2007-03-12 20:42:28 UTC (rev 26112)
@@ -157,7 +157,8 @@
 	kTalkieVersion = 0,
 	kDemoVersion = 1,
 	kFMTownsVersionE = 2,
-	kFMTownsVersionJ = 3
+	kFMTownsVersionJ = 3,
+	kAmigaVersion = 4
 };
 
 struct SpecialExtension {

Modified: scummvm/trunk/tools/create_kyradat/misc.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/misc.h	2007-03-12 20:41:25 UTC (rev 26111)
+++ scummvm/trunk/tools/create_kyradat/misc.h	2007-03-12 20:42:28 UTC (rev 26112)
@@ -298,11 +298,65 @@
 	-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 @@
 	{ kDemoVersion, "DEM" },
 	{ kFMTownsVersionE , "TNS" },
 	{ kFMTownsVersionJ, "TNS" },
+	{ kAmigaVersion, "AMG" },
 	{ -1, 0 }
 };
 


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