[Scummvm-cvs-logs] CVS: tools descumm.h,1.16,1.17 descumm-tool.cpp,1.11,1.12 descumm-common.cpp,1.14,1.15

Max Horn fingolfin at users.sourceforge.net
Fri Jun 17 11:52:52 CEST 2005


Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7865

Modified Files:
	descumm.h descumm-tool.cpp descumm-common.cpp 
Log Message:
Really fix jump analysis for files bigger than 64K

Index: descumm.h
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- descumm.h	17 Jun 2005 18:45:25 -0000	1.16
+++ descumm.h	17 Jun 2005 18:52:06 -0000	1.17
@@ -25,6 +25,16 @@
 
 #include "util.h"
 
+
+// 200kb limit on the input file (we just read it all at once into memory).
+// Should be no problem, the biggest scripts I have seen were in COMI and
+// went up to 180kb (script-457).
+#define MAX_FILE_SIZE (200 * 1024)
+
+
+#define BLOCK_STACK_SIZE	256
+
+
 typedef unsigned int uint;
 
 //

Index: descumm-tool.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm-tool.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- descumm-tool.cpp	4 Jun 2005 21:00:50 -0000	1.11
+++ descumm-tool.cpp	17 Jun 2005 18:52:06 -0000	1.12
@@ -22,11 +22,6 @@
 
 #include "descumm.h"
 
-// 200kb limit on the input file (we just read it all at once into memory).
-// Should be no problem, the biggest scripts I have seen were in COMI and
-// went up to 180kb (script-457).
-#define MAX_FILE_SIZE (200 * 1024)
-
 void ShowHelpAndExit()
 {
 	printf("SCUMM Script decompiler\n"

Index: descumm-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm-common.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- descumm-common.cpp	1 Jan 2005 10:33:30 -0000	1.14
+++ descumm-common.cpp	17 Jun 2005 18:52:06 -0000	1.15
@@ -160,11 +160,10 @@
 BlockStack *pushBlockStackItem()
 {
 	if (!block_stack)
-		block_stack = (BlockStack *) malloc(256 * sizeof(BlockStack));
+		block_stack = (BlockStack *) malloc(BLOCK_STACK_SIZE * sizeof(BlockStack));
 
-	if (num_block_stack >= 256) {
-		printf("block_stack full!\n");
-		exit(0);
+	if (num_block_stack >= BLOCK_STACK_SIZE) {
+		error("block_stack full");
 	}
 	return &block_stack[num_block_stack++];
 }
@@ -175,7 +174,7 @@
 	int i;
 	BlockStack *p;
 	
-	if (((to | cur) >> 16) || (to <= cur))
+	if (((to | cur) >> 24) || (to <= cur))
 		return false; // Invalid jump
 	
 	for (i = 0, p = block_stack; i < num_block_stack; i++, p++) {





More information about the Scummvm-git-logs mailing list