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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Sep 17 01:03:48 CEST 2009


Revision: 44125
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44125&view=rev
Author:   lordhoto
Date:     2009-09-16 23:03:48 +0000 (Wed, 16 Sep 2009)

Log Message:
-----------
Extract "kTypeTownsWDSfxTable" via a special extraction routine instead of a hacky patch level.

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

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2009-09-16 23:03:21 UTC (rev 44124)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2009-09-16 23:03:48 UTC (rev 44125)
@@ -48,6 +48,8 @@
 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 extractWdSfx(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);
@@ -74,6 +76,7 @@
 	{ kTypeShapeList, extractShapes, createFilename },
 	{ kTypeRawData, extractRaw, createFilename },
 	{ kTypeAmigaSfxTable, extractAmigaSfx, createFilename },
+	{ kTypeTownsWDSfxTable, extractWdSfx, createFilename },
 
 	{ k2TypeSeqData, extractHofSeqData, createFilename },
 	{ k2TypeShpDataV1, extractHofShapeAnimDataV1, createFilename },
@@ -202,7 +205,7 @@
 	{ kCreditsStrings, kTypeRawData, "CREDITS" },
 
 	// FM-TOWNS specific
-	{ kKyra1TownsSFXwdTable, kTypeRawData, "SFXWDTABLE" },
+	{ kKyra1TownsSFXwdTable, kTypeTownsWDSfxTable, "SFXWDTABLE" },
 	{ kKyra1TownsSFXbtTable, kTypeRawData, "SFXBTTABLE" },
 	{ kKyra1TownsCDATable, kTypeRawData, "CDATABLE" },
 
@@ -414,23 +417,11 @@
 // extraction
 
 bool extractRaw(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
-	uint8 *buffer = 0;
+	uint8 *buffer = new uint8[size];
+	assert(buffer);
+	memcpy(buffer, data, size);
 
-	if (fmtPatch == 2) {
-		buffer = new uint8[0x12602];
-		assert(buffer);
-		memcpy(buffer, data, 0x7EE5);
-		memcpy(buffer + 0x7EE5, data + 0x7EE7, 0x7FFF);
-		memcpy(buffer + 0xFEE4, data + 0xFEE8, 0x271E);
-
-		return out.addFile(filename, buffer, 0x12602);
-	} else {
-		buffer = new uint8[size];
-		assert(buffer);
-		memcpy(buffer, data, size);
-
-		return out.addFile(filename, buffer, size);
-	}
+	return out.addFile(filename, buffer, size);
 }
 
 bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
@@ -673,6 +664,18 @@
 	return out.addFile(filename, buffer, entries * 6 + 1 * 4);
 }
 
+bool extractWdSfx(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+	const int bufferSize = 0x12602;
+
+	uint8 *buffer = new uint8[0x12602];
+	assert(buffer);
+	memcpy(buffer, data, 0x7EE5);
+	memcpy(buffer + 0x7EE5, data + 0x7EE7, 0x7FFF);
+	memcpy(buffer + 0xFEE4, data + 0xFEE8, 0x271E);
+
+	return out.addFile(filename, buffer, bufferSize);
+}
+
 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-09-16 23:03:21 UTC (rev 44124)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.h	2009-09-16 23:03:48 UTC (rev 44125)
@@ -360,6 +360,7 @@
 	kTypeShapeList,
 	kTypeRawData,
 	kTypeAmigaSfxTable,
+	kTypeTownsWDSfxTable,
 
 	k2TypeSeqData,
 	k2TypeShpDataV1,


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