[Scummvm-cvs-logs] SF.net SVN: scummvm: [24767] scummvm/trunk/engines/cine

sev at users.sourceforge.net sev at users.sourceforge.net
Thu Nov 23 07:47:42 CET 2006


Revision: 24767
          http://svn.sourceforge.net/scummvm/?rev=24767&view=rev
Author:   sev
Date:     2006-11-22 22:47:41 -0800 (Wed, 22 Nov 2006)

Log Message:
-----------
Dump global scripts too.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/part.cpp
    scummvm/trunk/engines/cine/part.h
    scummvm/trunk/engines/cine/prc.cpp

Modified: scummvm/trunk/engines/cine/part.cpp
===================================================================
--- scummvm/trunk/engines/cine/part.cpp	2006-11-23 06:45:21 UTC (rev 24766)
+++ scummvm/trunk/engines/cine/part.cpp	2006-11-23 06:47:41 UTC (rev 24767)
@@ -437,4 +437,24 @@
 	return dataPtr;
 }
 
+void dumpBundle(const char *fileName) {
+	char tmpPart[15];
+
+	strcpy(tmpPart, currentPartName);
+
+	loadPart(fileName);
+	for (int i = 0; i < numElementInPart; i++) {
+		byte *data = readBundleFile(i);
+
+		Common::File out;
+
+		debug(0, "%s", partBuffer[i].partName);
+		out.open(Common::String("dumps/") + partBuffer[i].partName, Common::File::kFileWriteMode);
+		out.write(data, partBuffer[i].unpackedSize);
+		out.close();
+	}
+
+	loadPart(tmpPart);
+}
+
 } // End of namespace Cine

Modified: scummvm/trunk/engines/cine/part.h
===================================================================
--- scummvm/trunk/engines/cine/part.h	2006-11-23 06:45:21 UTC (rev 24766)
+++ scummvm/trunk/engines/cine/part.h	2006-11-23 06:47:41 UTC (rev 24767)
@@ -67,6 +67,8 @@
 byte *readBundleFile(int16 foundFileIdx);
 byte *readFile(const char *filename);
 
+void dumpBundle(const char *filename);
+
 } // End of namespace Cine
 
 #endif

Modified: scummvm/trunk/engines/cine/prc.cpp
===================================================================
--- scummvm/trunk/engines/cine/prc.cpp	2006-11-23 06:45:21 UTC (rev 24766)
+++ scummvm/trunk/engines/cine/prc.cpp	2006-11-23 06:47:41 UTC (rev 24767)
@@ -83,11 +83,13 @@
 	} else {
 		scriptPtr = readBundleFile(findFileInBundle(pPrcName));
 	}
+
 	assert(scriptPtr);
 
 	setMouseCursor(MOUSE_CURSOR_DISK);
 
-	numScripts = READ_BE_UINT16(scriptPtr); scriptPtr += 2;
+	numScripts = READ_BE_UINT16(scriptPtr);	
+	scriptPtr += 2;
 	assert(numScripts <= NUM_MAX_SCRIPT);
 
 	for (i = 0; i < numScripts; i++) {
@@ -104,6 +106,23 @@
 			computeScriptStack(scriptTable[i].ptr, scriptTable[i].stack, size);
 		}
 	}
+
+#ifdef DUMP_SCRIPTS
+
+	{
+		uint16 s;
+		char buffer[256];
+
+		for (s = 0; s < numScripts; s++) {
+			if (scriptTable[s].size) {
+				sprintf(buffer, "%s_%03d.txt", pPrcName, s);
+
+				decompileScript(scriptTable[s].ptr, scriptTable[s].stack, scriptTable[s].size, s);
+				dumpScript(buffer);
+			}
+		}
+	}
+#endif
 }
 
 } // End of namespace Cine


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