[Scummvm-cvs-logs] SF.net SVN: scummvm:[53761] scummvm/trunk

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun Oct 24 15:00:47 CEST 2010


Revision: 53761
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53761&view=rev
Author:   athrxx
Date:     2010-10-24 13:00:47 +0000 (Sun, 24 Oct 2010)

Log Message:
-----------
KYRA/PC98: workaround for missing delay opcodes

The sequence data for the forest sequence in the Kyra PC-98 intro has no delay opcodes making it play way too fast on modern systems. This workaround adds the same delay opcodes to the sequence data that the other Kyra versions have.

Modified Paths:
--------------
    scummvm/trunk/dists/engine-data/kyra.dat
    scummvm/trunk/engines/kyra/staticres.cpp
    scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
    scummvm/trunk/tools/create_kyradat/extract.cpp
    scummvm/trunk/tools/create_kyradat/extract.h

Modified: scummvm/trunk/dists/engine-data/kyra.dat
===================================================================
(Binary files differ)

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2010-10-24 01:53:32 UTC (rev 53760)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2010-10-24 13:00:47 UTC (rev 53761)
@@ -42,7 +42,7 @@
 
 namespace Kyra {
 
-#define RESFILE_VERSION 72
+#define RESFILE_VERSION 73
 
 namespace {
 bool checkKyraDat(Common::SeekableReadStream *file) {

Modified: scummvm/trunk/tools/create_kyradat/create_kyradat.cpp
===================================================================
--- scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2010-10-24 01:53:32 UTC (rev 53760)
+++ scummvm/trunk/tools/create_kyradat/create_kyradat.cpp	2010-10-24 13:00:47 UTC (rev 53761)
@@ -45,7 +45,7 @@
 #include <map>
 
 enum {
-	kKyraDatVersion = 72
+	kKyraDatVersion = 73
 };
 
 const ExtractFilename extractFilenames[] = {
@@ -53,7 +53,7 @@
 	{ kIdMap, -1, true },
 
 	// INTRO / OUTRO sequences
-	{ k1ForestSeq, kTypeRawData, false },
+	{ k1ForestSeq, kTypeForestSeqData, false },
 	{ k1KallakWritingSeq, kTypeRawData, false },
 	{ k1KyrandiaLogoSeq, kTypeRawData, false },
 	{ k1KallakMalcolmSeq, kTypeRawData, false },

Modified: scummvm/trunk/tools/create_kyradat/extract.cpp
===================================================================
--- scummvm/trunk/tools/create_kyradat/extract.cpp	2010-10-24 01:53:32 UTC (rev 53760)
+++ scummvm/trunk/tools/create_kyradat/extract.cpp	2010-10-24 13:00:47 UTC (rev 53761)
@@ -36,6 +36,7 @@
 bool extractStrings10(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id);
 bool extractRooms(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id);
 bool extractShapes(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id);
+bool extractKyraForestSeqData(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id);
 bool extractAmigaSfx(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id);
 bool extractWdSfx(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id);
 
@@ -58,6 +59,7 @@
 	{ kTypeRoomList, extractRooms },
 	{ kTypeShapeList, extractShapes },
 	{ kTypeRawData, extractRaw },
+	{ kTypeForestSeqData, extractKyraForestSeqData },
 	{ kTypeAmigaSfxTable, extractAmigaSfx },
 	{ kTypeTownsWDSfxTable, extractWdSfx },
 
@@ -90,6 +92,7 @@
 	{ kTypeRawData, 1 },
 	{ kTypeRoomList, 2 },
 	{ kTypeShapeList, 3 },
+	{ kTypeForestSeqData, 1 },
 	{ kTypeAmigaSfxTable, 4 },
 	{ kTypeTownsWDSfxTable, 1 },
 	{ k2TypeSeqData, 5 },
@@ -376,6 +379,55 @@
 	return out.addFile(filename, buffer, size + 1 * 4);
 }
 
+bool extractKyraForestSeqData(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id) {
+	if (info->platform != kPlatformPC98)
+		return extractRaw(out, info, data, size, filename, id);
+
+	struct PatchEntry {
+		uint16 pos;
+		uint8 val;
+	};
+
+	// This data has been taken from the FM-Towns version
+	static const PatchEntry patchData[] = {
+		{ 0x0019, 0x06 }, { 0x001A, 0x09 }, { 0x001B, 0x00 }, { 0x002E, 0x06 }, { 0x002F, 0x09 }, { 0x0030, 0x00 },
+		{ 0x003D, 0x06 }, { 0x003E, 0x09 }, { 0x003F, 0x00 }, { 0x004C, 0x06 }, { 0x004D, 0x09 }, { 0x004E, 0x00 },
+		{ 0x005B, 0x06 }, { 0x005C, 0x09 }, { 0x005D, 0x00 }, { 0x0064, 0x06 }, { 0x0065, 0x09 }, { 0x0066, 0x00 },
+		{ 0x0079, 0x06 }, { 0x007A, 0x09 }, { 0x007B, 0x00 }, { 0x0088, 0x06 }, { 0x0089, 0x09 }, { 0x008A, 0x00 },
+		{ 0x0097, 0x06 }, { 0x0098, 0x09 }, { 0x0099, 0x00 }, { 0x00A6, 0x06 }, { 0x00A7, 0x09 }, { 0x00A8, 0x00 },
+		{ 0x00AD, 0x06 }, { 0x00AE, 0x09 }, { 0x00AF, 0x00 }, { 0x00B4, 0x06 }, { 0x00B5, 0x09 }, { 0x00B6, 0x00 },
+		{ 0x00C3, 0x06 }, { 0x00C4, 0x09 }, { 0x00C5, 0x00 }, { 0x00CA, 0x06 }, { 0x00CB, 0x09 }, { 0x00CC, 0x00 },
+		{ 0x00D1, 0x06 }, { 0x00D2, 0x09 }, { 0x00D3, 0x00 }, { 0x00E0, 0x06 }, { 0x00E1, 0x09 }, { 0x00E2, 0x00 },
+		{ 0x00E7, 0x06 }, { 0x00E8, 0x09 }, { 0x00E9, 0x00 }, { 0x00EE, 0x06 }, { 0x00EF, 0x09 }, { 0x00F0, 0x00 },
+		{ 0x00FD, 0x06 }, { 0x00FE, 0x09 }, { 0x00FF, 0x00 }, { 0x010A, 0x06 }, { 0x010B, 0x09 }, { 0x010C, 0x00 },
+		{ 0x011D, 0x06 }, { 0x011E, 0x09 }, { 0x011F, 0x00 }, { 0x012C, 0x06 }, { 0x012D, 0x09 }, { 0x012E, 0x00 },
+		{ 0x013D, 0x06 }, { 0x013E, 0x09 }, { 0x013F, 0x00 }, { 0x0148, 0x06 }, { 0x0149, 0x09 }, { 0x014A, 0x00 },
+		{ 0x0153, 0x06 }, { 0x0154, 0x09 }, { 0x0155, 0x00 }, { 0x015E, 0x06 }, { 0x015F, 0x09 }, { 0x0160, 0x00 },
+		{ 0x0169, 0x06 }, { 0x016A, 0x09 }, { 0x016B, 0x00 }, { 0x016C, 0x06 }, { 0x016D, 0x12 }, { 0x016E, 0x00 },
+		{ 0x017B, 0x06 }, { 0x017C, 0x09 }, { 0x017D, 0x00 }, { 0x0188, 0x06 }, { 0x0189, 0x09 }, { 0x018A, 0x00 },
+		{ 0x0190, 0x13 }, { 0x0000, 0x00 }
+	};
+
+	uint32 outsize = size + (ARRAYSIZE(patchData) - 1);
+	uint8 *buffer = new uint8[outsize];
+	assert(buffer);
+
+	const uint8 *src = data;
+	uint8 *dst = buffer;
+	const PatchEntry *patchPos = patchData;
+	
+	while (dst < (buffer + outsize)) {
+		if ((dst - buffer) == patchPos->pos) {
+			*dst++ = patchPos->val;
+			patchPos++;
+		} else {
+			*dst++ = *src++;
+		}
+	}
+
+	return out.addFile(filename, buffer, outsize);
+}
+
 bool extractAmigaSfx(PAKFile &out, const ExtractInformation *info, const byte *data, const uint32 size, const char *filename, int id) {
 	const uint32 entries = size / 8;
 	byte *buffer = new byte[entries * 6 + 1 * 4];

Modified: scummvm/trunk/tools/create_kyradat/extract.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/extract.h	2010-10-24 01:53:32 UTC (rev 53760)
+++ scummvm/trunk/tools/create_kyradat/extract.h	2010-10-24 13:00:47 UTC (rev 53761)
@@ -35,6 +35,7 @@
 	kTypeRoomList,
 	kTypeShapeList,
 	kTypeRawData,
+	kTypeForestSeqData,
 	kTypeAmigaSfxTable,
 	kTypeTownsWDSfxTable,
 


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