[Scummvm-cvs-logs] SF.net SVN: scummvm: [24605] tools/trunk/descumm.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Nov 4 18:35:32 CET 2006


Revision: 24605
          http://svn.sourceforge.net/scummvm/?rev=24605&view=rev
Author:   fingolfin
Date:     2006-11-04 09:35:27 -0800 (Sat, 04 Nov 2006)

Log Message:
-----------
Some tweaks to the descumm tool

Modified Paths:
--------------
    tools/trunk/descumm.cpp

Modified: tools/trunk/descumm.cpp
===================================================================
--- tools/trunk/descumm.cpp	2006-11-04 17:05:16 UTC (rev 24604)
+++ tools/trunk/descumm.cpp	2006-11-04 17:35:27 UTC (rev 24605)
@@ -99,7 +99,7 @@
 const char *var_names0[] = {
 	/* 0 */
 	"VAR_EGO",
-	NULL,
+	"VAR_RESULT",
 	"VAR_CAMERA_POS_X",
 	"VAR_HAVE_MSG",
 	/* 4 */
@@ -117,7 +117,7 @@
 const char *var_names2[] = {
 	/* 0 */
 	"VAR_EGO",
-	NULL,
+	"VAR_RESULT",
 	"VAR_CAMERA_POS_X",
 	"VAR_HAVE_MSG",
 	/* 4 */
@@ -1046,10 +1046,7 @@
 
 void do_resource(char *buf, byte opco)
 {
-	// FIXME:
-	// 1) This is out of date compared to script_v5.cp
-	// 2) the token's should all get a prefix, so that we don't mix up the
-	//    "real" loadRoom with the one here.
+	// FIXME:  This is out of date compared to script_v5.cp
 	char opcode = get_byte();
 	int sub_op;
 	if (scriptVersion != 5)
@@ -1057,6 +1054,8 @@
 	else
 		sub_op = opcode & 0x1F;
 
+	buf += sprintf(buf, "Resource.");
+
 	switch (sub_op) {
 	case 0x1:
 		do_tok(buf, "loadScript", ((opcode & 0x80) ? A1V : A1B));
@@ -1946,14 +1945,21 @@
 		break;
 	case 0x4A:
 	case 0xCA:
-		// chainScript
 		do_tok(buf, "chainScript", ((opcode & 0x80) ? A1V : A1B));
 		break;
 
 	case 0x60:
 	case 0xE0:
-		//cursorCommand
-		do_tok(buf, "cursorCommand", ((opcode & 0x80) ? A1V : A1W));
+		//do_tok(buf, "cursorCommand", ((opcode & 0x80) ? A1V : A1W));
+		if (opcode & 0x80) {
+			char tmp[256];
+			get_var(tmp);
+			buf += sprintf(buf, "cursorCommand(Hi(%s), Lo(%s))", tmp, tmp);
+		} else {
+			int val = get_word();
+			buf += sprintf(buf, "cursorCommand(%d, %d)", (val >> 8) & 0xFF, val & 0xFF);
+		}
+
 		break;
 	case 0x40:
 		sprintf(buf, "cutscene");
@@ -2385,7 +2391,7 @@
 				i--;
 			}
 
-			strcpy(buf, "];");
+			strcpy(buf, "]);");
 
 		}
 		break;
@@ -3578,7 +3584,7 @@
 				i--;
 			}
 
-			strcpy(buf, "];");
+			strcpy(buf, "]);");
 
 		}
 		break;


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