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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Dec 27 01:25:04 CET 2006


Revision: 24932
          http://scummvm.svn.sourceforge.net/scummvm/?rev=24932&view=rev
Author:   fingolfin
Date:     2006-12-26 16:25:01 -0800 (Tue, 26 Dec 2006)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    tools/trunk/descumm-common.cpp
    tools/trunk/descumm-tool.cpp
    tools/trunk/descumm.cpp
    tools/trunk/descumm.h
    tools/trunk/descumm6.cpp

Modified: tools/trunk/descumm-common.cpp
===================================================================
--- tools/trunk/descumm-common.cpp	2006-12-26 20:57:29 UTC (rev 24931)
+++ tools/trunk/descumm-common.cpp	2006-12-27 00:25:01 UTC (rev 24932)
@@ -34,23 +34,12 @@
 
 int g_jump_opcode;
 
-bool alwaysShowOffs = false;
-bool dontOutputIfs = false;
-bool dontOutputElse = false;
-bool dontOutputElseif = false;
-bool dontOutputWhile = false;
-bool dontOutputBreaks = false;
-bool dontShowOpcode = false;
-bool dontShowOffsets = false;
-bool haltOnError;
+Options g_options;
 
-byte scriptVersion;
-byte heVersion;
-
-byte *cur_pos, *org_pos;
+byte *g_scriptCurPos, *g_scriptStart;
 int offs_of_line;
 
-uint size_of_code;
+uint g_scriptSize;
 
 
 ///////////////////////////////////////////////////////////////////////////
@@ -63,24 +52,24 @@
 
 int get_curoffs()
 {
-	return cur_pos - org_pos;
+	return g_scriptCurPos - g_scriptStart;
 }
 
 int get_byte()
 {
-	return (byte)(*cur_pos++);
+	return (byte)(*g_scriptCurPos++);
 }
 
 int get_word()
 {
 	int i;
 
-	if (scriptVersion == 8) {
-		i = (int32)READ_LE_UINT32(cur_pos);
-		cur_pos += 4;
+	if (g_options.scriptVersion == 8) {
+		i = (int32)READ_LE_UINT32(g_scriptCurPos);
+		g_scriptCurPos += 4;
 	} else {
-		i = (int16)READ_LE_UINT16(cur_pos);
-		cur_pos += 2;
+		i = (int16)READ_LE_UINT16(g_scriptCurPos);
+		g_scriptCurPos += 2;
 	}
 	return i;
 }
@@ -89,8 +78,8 @@
 {
 	int i;
 
-	i = (int32)READ_LE_UINT32(cur_pos);
-	cur_pos += 4;
+	i = (int32)READ_LE_UINT32(g_scriptCurPos);
+	g_scriptCurPos += 4;
 	return i;
 }
 
@@ -104,12 +93,12 @@
 		assert(indent >= 0);
 
 		// Show the offset
-		if (!dontShowOffsets) {
+		if (!g_options.dontShowOffsets) {
 			printf("[%.4X] ", curoffs);
 		}
 		
 		// Show the opcode value
-		if (!dontShowOpcode) {
+		if (!g_options.dontShowOpcode) {
 			if (opcode != -1)
 				printf("(%.2X) ", opcode);
 			else
@@ -143,12 +132,12 @@
 	
 	// Try to determine if this is a while loop. For this, first check if we 
 	// jump right behind a regular jump, then whether that jump is targeting us.
-	if (scriptVersion == 8) {
-		p.isWhile = (*(byte*)(org_pos+to-5) == g_jump_opcode);
-		i = (int32)READ_LE_UINT32(org_pos+to-4);
+	if (g_options.scriptVersion == 8) {
+		p.isWhile = (*(byte*)(g_scriptStart+to-5) == g_jump_opcode);
+		i = (int32)READ_LE_UINT32(g_scriptStart+to-4);
 	} else {
-		p.isWhile = (*(byte*)(org_pos+to-3) == g_jump_opcode);
-		i = (int16)READ_LE_UINT16(org_pos+to-2);
+		p.isWhile = (*(byte*)(g_scriptStart+to-3) == g_jump_opcode);
+		i = (int16)READ_LE_UINT16(g_scriptStart+to-2);
 	}
 	
 	p.isWhile = p.isWhile && (offs_of_line == (int)to + i);
@@ -200,22 +189,22 @@
 	if (g_blockStack.top().isWhile)
 		return false;
 
-	if (scriptVersion == 8)
+	if (g_options.scriptVersion == 8)
 		k = to - 5;
 	else
 		k = to - 3;
 
-	if (k >= size_of_code)
+	if (k >= g_scriptSize)
 		return false;								/* Invalid jump */
 
 	if (elseto != to) {
-		if (org_pos[k] != g_jump_opcode)
+		if (g_scriptStart[k] != g_jump_opcode)
 			return false;							/* Invalid jump */
 	
-		if (scriptVersion == 8)
-			k = to + READ_LE_UINT32(org_pos + k + 1);
+		if (g_options.scriptVersion == 8)
+			k = to + READ_LE_UINT32(g_scriptStart + k + 1);
 		else
-			k = to + READ_LE_UINT16(org_pos + k + 1);
+			k = to + READ_LE_UINT16(g_scriptStart + k + 1);
 	
 		if (k != elseto)
 			return false;							/* Not an ifelse */
@@ -249,7 +238,7 @@
 void writePendingElse() {
 	if (pendingElse) {
 		char buf[32];
-		sprintf(buf, alwaysShowOffs ? "} else /*%.4X*/ {" : "} else {", pendingElseTo);
+		sprintf(buf, g_options.alwaysShowOffs ? "} else /*%.4X*/ {" : "} else {", pendingElseTo);
 		outputLine(buf, offs_of_line, pendingElseOpcode, pendingElseIndent - 1);
 		offs_of_line = pendingElseOffs;
 		pendingElse = false;

Modified: tools/trunk/descumm-tool.cpp
===================================================================
--- tools/trunk/descumm-tool.cpp	2006-12-26 20:57:29 UTC (rev 24931)
+++ tools/trunk/descumm-tool.cpp	2006-12-27 00:25:01 UTC (rev 24932)
@@ -64,7 +64,7 @@
 	int offset = 15;
 	int minOffset = 255;
 
-	if (scriptVersion == 0)
+	if (g_options.scriptVersion == 0)
 		offset = 14;
 	p += offset;
 
@@ -82,7 +82,7 @@
 int skipVerbHeader_V34(byte *p)
 {
 	byte code;
-	int offset = GF_UNBLOCKED ? 17 : 19;
+	int offset = g_options.GF_UNBLOCKED ? 17 : 19;
 	int minOffset = 255;
 	p += offset;
 	
@@ -147,94 +147,94 @@
 				switch (tolower(*s)) {
 
 				case '0':
-					scriptVersion = 0;
+					g_options.scriptVersion = 0;
 					g_jump_opcode = 0x18;
-					GF_UNBLOCKED = true;
+					g_options.GF_UNBLOCKED = true;
 					break;
 				case '1':
-					scriptVersion = 1;
+					g_options.scriptVersion = 1;
 					g_jump_opcode = 0x18;
-					GF_UNBLOCKED = true;
+					g_options.GF_UNBLOCKED = true;
 					break;
 				case '2':
-					scriptVersion = 2;
+					g_options.scriptVersion = 2;
 					g_jump_opcode = 0x18;
-					GF_UNBLOCKED = true;
+					g_options.GF_UNBLOCKED = true;
 					break;
 				case '3':
-					scriptVersion = 3;
+					g_options.scriptVersion = 3;
 					g_jump_opcode = 0x18;
 					break;
 				case '4':
-					scriptVersion = 4;
+					g_options.scriptVersion = 4;
 					g_jump_opcode = 0x18;
 					break;
 				case '5':
-					scriptVersion = 5;
+					g_options.scriptVersion = 5;
 					g_jump_opcode = 0x18;
 					break;
 				case 'n':
-					IndyFlag = 1; // Indy3
-					scriptVersion = 3;
+					g_options.IndyFlag = 1; // Indy3
+					g_options.scriptVersion = 3;
 					g_jump_opcode = 0x18;
 					break;
 				case 'z':
-					ZakFlag = 1; // Zak
-					scriptVersion = 3;
+					g_options.ZakFlag = 1; // Zak
+					g_options.scriptVersion = 3;
 					g_jump_opcode = 0x18;
 					break;
 				case 'u':
-					GF_UNBLOCKED = true;
+					g_options.GF_UNBLOCKED = true;
 					break;
 
 				case 'p':
-					HumongousFlag = true;
+					g_options.HumongousFlag = true;
 					// Fall through
 				case '6':
-					scriptVersion = 6;
+					g_options.scriptVersion = 6;
 					g_jump_opcode = 0x73;
 					break;
 				case '7':
-					scriptVersion = 7;
+					g_options.scriptVersion = 7;
 					g_jump_opcode = 0x73;
 					break;
 				case '8':
-					scriptVersion = 8;
+					g_options.scriptVersion = 8;
 					g_jump_opcode = 0x66;
 					break;
 
 				case '9':
-					heVersion = 72;
-					scriptVersion = 6;
+					g_options.heVersion = 72;
+					g_options.scriptVersion = 6;
 					g_jump_opcode = 0x73;
 					break;
 
 				case 'o':
-					alwaysShowOffs = true;
+					g_options.alwaysShowOffs = true;
 					break;
 				case 'i':
-					dontOutputIfs = true;
+					g_options.dontOutputIfs = true;
 					break;
 				case 'e':
-					dontOutputElse = true;
+					g_options.dontOutputElse = true;
 					break;
 				case 'f':
-					dontOutputElseif = true;
+					g_options.dontOutputElseif = true;
 					break;
 				case 'w':
-					dontOutputWhile = true;
+					g_options.dontOutputWhile = true;
 					break;
 				case 'b':
-					dontOutputBreaks = true;
+					g_options.dontOutputBreaks = true;
 					break;
 				case 'c':
-					dontShowOpcode = true;
+					g_options.dontShowOpcode = true;
 					break;
 				case 'x':
-					dontShowOffsets = true;
+					g_options.dontShowOffsets = true;
 					break;
 				case 'h':
-					haltOnError = true;
+					g_options.haltOnError = true;
 					break;
 				default:
 					ShowHelpAndExit();
@@ -256,12 +256,12 @@
 	byte *memorg;
 	char *filename;
 
-	scriptVersion = 0xff;
-	heVersion = 0;
+	memset(&g_options, 0, sizeof(g_options));
+	g_options.scriptVersion = 0xff;
 	
 	// Parse the arguments
 	filename = parseCommandLine(argc, argv);
-	if (!filename || scriptVersion == 0xff)
+	if (!filename || g_options.scriptVersion == 0xff)
 		ShowHelpAndExit();
 
 	in = fopen(filename, "rb");
@@ -272,113 +272,114 @@
 
 	// Read the file into memory
 	memorg = (byte *)malloc(MAX_FILE_SIZE);
-	size_of_code = fread(memorg, 1, MAX_FILE_SIZE, in);
+	g_scriptSize = fread(memorg, 1, MAX_FILE_SIZE, in);
 	fclose(in);
 
 	offs_of_line = 0;
-	org_pos = memorg;
+	g_scriptStart = memorg;
+	g_scriptCurPos = g_scriptStart;
 
-	if (GF_UNBLOCKED) {
-		if (size_of_code < 4) {
+	if (g_options.GF_UNBLOCKED) {
+		if (g_scriptSize < 4) {
 			error("File too small to be a script");
 		}
 		// Hack to detect verb script: first 4 bytes should be file length
-		if (READ_LE_UINT32(org_pos) == size_of_code) {
-			if (scriptVersion <= 2)
-				offs_of_line = skipVerbHeader_V12(org_pos);
+		if (READ_LE_UINT32(g_scriptStart) == g_scriptSize) {
+			if (g_options.scriptVersion <= 2)
+				offs_of_line = skipVerbHeader_V12(g_scriptStart);
 			else
-				offs_of_line = skipVerbHeader_V34(org_pos);
+				offs_of_line = skipVerbHeader_V34(g_scriptStart);
 		} else {
-			org_pos += 4;
+			g_scriptStart += 4;
 		}
-	} else if (scriptVersion >= 5) {
-		if (size_of_code < (scriptVersion == 5 ? 8 : 9)) {
+	} else if (g_options.scriptVersion >= 5) {
+		if (g_scriptSize < (g_options.scriptVersion == 5 ? 8 : 9)) {
 			error("File too small to be a script");
 		}
 	
-		switch (READ_BE_UINT32(org_pos)) {
+		switch (READ_BE_UINT32(g_scriptStart)) {
 		case 'LSC2':
-			if (size_of_code <= 12) {
+			if (g_scriptSize <= 12) {
 				printf("File too small to be a local script\n");
 			}
-			printf("Script# %d\n", READ_LE_UINT32(org_pos+8));
-			org_pos += 12;
+			printf("Script# %d\n", READ_LE_UINT32(g_scriptStart+8));
+			g_scriptStart += 12;
 			break;											/* Local script */
 		case 'LSCR':
-			if (scriptVersion == 8) {
-				if (size_of_code <= 12) {
+			if (g_options.scriptVersion == 8) {
+				if (g_scriptSize <= 12) {
 					printf("File too small to be a local script\n");
 				}
-				printf("Script# %d\n", READ_LE_UINT32(org_pos+8));
-				org_pos += 12;
-			} else if (scriptVersion == 7) {
-				if (size_of_code <= 10) {
+				printf("Script# %d\n", READ_LE_UINT32(g_scriptStart+8));
+				g_scriptStart += 12;
+			} else if (g_options.scriptVersion == 7) {
+				if (g_scriptSize <= 10) {
 					printf("File too small to be a local script\n");
 				}
-				printf("Script# %d\n", READ_LE_UINT16(org_pos+8));
-				org_pos += 10;
+				printf("Script# %d\n", READ_LE_UINT16(g_scriptStart+8));
+				g_scriptStart += 10;
 			} else {
-				if (size_of_code <= 9) {
+				if (g_scriptSize <= 9) {
 					printf("File too small to be a local script\n");
  				}
-				printf("Script# %d\n", (byte)org_pos[8]);
-				org_pos += 9;
+				printf("Script# %d\n", (byte)g_scriptStart[8]);
+				g_scriptStart += 9;
 			}
 			break;											/* Local script */
 		case 'SCRP':
-			org_pos += 8;
+			g_scriptStart += 8;
 			break;											/* Script */
 		case 'ENCD':
-			org_pos += 8;
+			g_scriptStart += 8;
 			break;											/* Entry code */
 		case 'EXCD':
-			org_pos += 8;
+			g_scriptStart += 8;
 			break;											/* Exit code */
 		case 'VERB':
-			if (scriptVersion == 8) {
-				org_pos += 8;
-				offs_of_line = skipVerbHeader_V8(org_pos);
+			if (g_options.scriptVersion == 8) {
+				g_scriptStart += 8;
+				offs_of_line = skipVerbHeader_V8(g_scriptStart);
 			} else
-				offs_of_line = skipVerbHeader_V567(org_pos);
+				offs_of_line = skipVerbHeader_V567(g_scriptStart);
 			break;											/* Verb */
 		default:
 			error("Unknown script type");
 		}
 	} else {
-		if (size_of_code < 6) {
+		if (g_scriptSize < 6) {
 			error("File too small to be a script");
 		}
-		switch (READ_BE_UINT16(org_pos + 4)) {
+		switch (READ_BE_UINT16(g_scriptStart + 4)) {
 		case 'LS':
-			printf("Script# %d\n", (byte)org_pos[6]);
-			org_pos += 7;
+			printf("Script# %d\n", (byte)g_scriptStart[6]);
+			g_scriptStart += 7;
 			break;			/* Local script */
 		case 'SC':
-			org_pos += 6;
+			g_scriptStart += 6;
 			break;			/* Script */
 		case 'EN':
-			org_pos += 6;
+			g_scriptStart += 6;
 			break;			/* Entry code */
 		case 'EX':
-			org_pos += 6;
+			g_scriptStart += 6;
 			break;			/* Exit code */
 		case 'OC':
-			offs_of_line = skipVerbHeader_V34(org_pos);
+			offs_of_line = skipVerbHeader_V34(g_scriptStart);
 			break;			/* Verb */
 		default:
 			error("Unknown script type");
 		}
 	}
 
-	cur_pos = org_pos + offs_of_line;
+	g_scriptCurPos = g_scriptStart + offs_of_line;
 
 	offs_of_line = get_curoffs();
-	while (cur_pos < size_of_code + memorg) {
-		byte opcode = *cur_pos;
+	while (g_scriptCurPos < g_scriptSize + memorg) {
+		byte opcode = *g_scriptCurPos;
 		int j = g_blockStack.size();
 		char outputLineBuffer[8192] = "";
 
-		switch (scriptVersion) {
+		switch (g_options.scriptVersion) {
 		case 0:
 			next_line_V0(outputLineBuffer);
 			break;
@@ -392,7 +393,7 @@
 			next_line_V345(outputLineBuffer);
 			break;
 		case 6:
-			if (heVersion)
+			if (g_options.heVersion)
 				next_line_HE_V72(outputLineBuffer);
 			else
 				next_line_V67(outputLineBuffer);
@@ -424,7 +425,7 @@
 	printf("END\n");
 	
 /*
-	if (scriptVersion >= 6 && num_stack != 0) {
+	if (g_options.scriptVersion >= 6 && num_stack != 0) {
 		printf("Stack count: %d\n", num_stack);
 		if (num_stack > 0) {
 			printf("Stack contents:\n");

Modified: tools/trunk/descumm.cpp
===================================================================
--- tools/trunk/descumm.cpp	2006-12-26 20:57:29 UTC (rev 24931)
+++ tools/trunk/descumm.cpp	2006-12-27 00:25:01 UTC (rev 24932)
@@ -96,11 +96,6 @@
 
 
 
-bool ZakFlag = false;
-bool IndyFlag = false;
-bool GF_UNBLOCKED = false;
-
-
 void emit_if(char *buf, char *condition);
 
 
@@ -452,7 +447,7 @@
 		else
 			s = "Bit";
 	} else if (i & 0x4000) {
-		i &= IndyFlag ? 0xF : 0xFFF;
+		i &= g_options.IndyFlag ? 0xF : 0xFFF;
 		if (i > 0x10)
 			s = "??Local??";
 		else
@@ -465,7 +460,7 @@
 			s = "Var";
 	}
 
-	if (haltOnError && (s[0] == '?')) {
+	if (g_options.haltOnError && (s[0] == '?')) {
 		error("%s out of range, was %d", s, i);
 	}
 
@@ -477,37 +472,37 @@
 {
 	int i;
 
-	if (scriptVersion <= 2)
+	if (g_options.scriptVersion <= 2)
 		i = get_byte();
 	else
 		i = (uint16)get_word();
 		
 	assert(i >= 0);
 
-	if (scriptVersion >= 5 && 
+	if (g_options.scriptVersion >= 5 && 
 			i < ARRAYSIZE(var_names5) && var_names5[i]) {
 		buf += sprintf(buf, var_names5[i]);
 		return buf;
-	} else if (scriptVersion >= 4 && 
+	} else if (g_options.scriptVersion >= 4 && 
 			i < ARRAYSIZE(var_names4) && var_names4[i]) {
 		buf += sprintf(buf, var_names4[i]);
 		return buf;
-	} else if (scriptVersion >= 3 && 
+	} else if (g_options.scriptVersion >= 3 && 
 			i < ARRAYSIZE(var_names3) && var_names3[i]) {
 		buf += sprintf(buf, var_names3[i]);
 		return buf;
-	} else if (scriptVersion >= 1 &&
+	} else if (g_options.scriptVersion >= 1 &&
 			i < ARRAYSIZE(var_names2) && var_names2[i]) {
 		buf += sprintf(buf, var_names2[i]);
 		return buf;
-	} else if (scriptVersion == 0 &&
+	} else if (g_options.scriptVersion == 0 &&
 			i < ARRAYSIZE(var_names0) && var_names0[i]) {
 		buf += sprintf(buf, var_names0[i]);
 		return buf;
-	} else if (scriptVersion <= 2 && ZakFlag && (i == 234 || i == 235)) {
+	} else if (g_options.scriptVersion <= 2 && g_options.ZakFlag && (i == 234 || i == 235)) {
 		buf += sprintf(buf, (i == 234) ? "ZERO" : "ONE");
 		return buf;
-	} else if ((i & 0x8000) && (GF_UNBLOCKED || ZakFlag))
+	} else if ((i & 0x8000) && (g_options.GF_UNBLOCKED || g_options.ZakFlag))
 		buf += sprintf(buf, "Var[%d Bit %d", (i & 0x0FFF) >> 4, i & 0x000F);
 	else
 		buf += sprintf(buf, "%s[%d", get_num_string(i), i & 0xFFF);
@@ -562,7 +557,7 @@
 		j++;
 		if (j > 16) {
 			printf("ERROR: too many variables in argument list!\n");
-			if (haltOnError)
+			if (g_options.haltOnError)
 				exit(1);
 			break;
 		}
@@ -597,7 +592,7 @@
 			buf = putascii(buf, i);
 
 			// Workaround for a script bug in Indy3
-			if (i == 46 && scriptVersion == 3 && IndyFlag)
+			if (i == 46 && g_options.scriptVersion == 3 && g_options.IndyFlag)
 				continue;
 
 			if (i != 1 && i != 2 && i != 3 && i != 8) {
@@ -720,7 +715,7 @@
 			buf += sprintf(buf, "Sound(%s)", arg);
 			break;
 		case 2:
-			if (scriptVersion == 1)
+			if (g_options.scriptVersion == 1)
 				buf += sprintf(buf, "Color(%s)", arg);
 			else
 				buf += sprintf(buf, "Color(%d, %s)", get_byte(), arg);
@@ -760,7 +755,7 @@
 		first = 0;
 
 		// FIXME - this really should be a check for GF_SMALL_HEADER instead!
-		if (scriptVersion < 5)
+		if (g_options.scriptVersion < 5)
 			opcode = (opcode & 0xE0) | convertTable[(opcode & 0x1F) - 1];
 
 		switch (opcode & 0x1F) {
@@ -818,7 +813,7 @@
 			buf = do_tok(buf, "Width", ((opcode & 0x80) ? A1V : A1B));
 			break;
 		case 0x11:
-			if (scriptVersion == 5)
+			if (g_options.scriptVersion == 5)
 				buf = do_tok(buf, "Scale", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B));
 			else
 				buf = do_tok(buf, "Scale", ((opcode & 0x80) ? A1V : A1B));
@@ -942,7 +937,7 @@
 
 		case 0x6:
 			buf2 = strecpy(buf, "<");
-			if (scriptVersion <= 2)
+			if (g_options.scriptVersion <= 2)
 				next_line_V12(buf2);
 			else
 				next_line_V345(buf2);
@@ -989,8 +984,8 @@
 			strcpy(buf, "DIV");
 			break;
 		case 0x6:
-			sprintf(buf, "CALL (%.2X) ", *cur_pos);
-			if (scriptVersion <= 2)
+			sprintf(buf, "CALL (%.2X) ", *g_scriptCurPos);
+			if (g_options.scriptVersion <= 2)
 				next_line_V12(strchr(buf, 0));
 			else
 				next_line_V345(strchr(buf, 0));
@@ -1060,7 +1055,7 @@
 {
 	char opcode = get_byte();
 	int subop;
-	if (scriptVersion != 5)
+	if (g_options.scriptVersion != 5)
 		subop = opcode & 0x3F;	// FIXME - actually this should only be done for Zak256
 	else
 		subop = opcode & 0x1F;
@@ -1273,10 +1268,10 @@
 	char	a[256];
 	char	b[256];
 	
-	if (scriptVersion <= 2) {
+	if (g_options.scriptVersion <= 2) {
 		get_var_or_byte(a, (opcode & 0x80));
 		get_var_or_byte(b, (opcode & 0x40));
-	} else if (scriptVersion == 3) {
+	} else if (g_options.scriptVersion == 3) {
 		get_var_or_word(a, (opcode & 0x80));
 		get_var_or_word(b, (opcode & 0x40));
 	}
@@ -1284,7 +1279,7 @@
 	opcode = get_byte();
 	switch (opcode & 0x1F) {
 	case 0x01:
-		if (scriptVersion > 3) {
+		if (g_options.scriptVersion > 3) {
 			get_var_or_word(a, (opcode & 0x80));
 			get_var_or_word(b, (opcode & 0x40));
 		}
@@ -1295,7 +1290,7 @@
 		buf = strecpy(buf, ")");
 		break;
 	case 0x02:
-		if (scriptVersion > 3) {
+		if (g_options.scriptVersion > 3) {
 			get_var_or_word(a, (opcode & 0x80));
 			get_var_or_word(b, (opcode & 0x40));
 		}
@@ -1306,7 +1301,7 @@
 		buf = strecpy(buf, ")");
 		break;
 	case 0x03:
-		if (scriptVersion > 3) {
+		if (g_options.scriptVersion > 3) {
 			get_var_or_word(a, (opcode & 0x80));
 			get_var_or_word(b, (opcode & 0x40));
 		}
@@ -1317,7 +1312,7 @@
 		buf = strecpy(buf, ")");
 		break;
 	case 0x04:
-		if (scriptVersion > 3) {
+		if (g_options.scriptVersion > 3) {
 			get_var_or_word(a, (opcode & 0x80));
 			get_var_or_word(b, (opcode & 0x40));
 		}
@@ -1384,7 +1379,7 @@
 		break;
 
 	case 0x0E:
-		if (scriptVersion == 3)
+		if (g_options.scriptVersion == 3)
 			do_tok(buf, "LoadCharset", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B));
 		else
 			do_tok(buf, "CursorCommand", A1LIST);
@@ -1522,7 +1517,7 @@
 			buf = do_tok(buf, "Center", 0);
 			break;
 		case 0x6:
-			if (GF_UNBLOCKED)
+			if (g_options.GF_UNBLOCKED)
 				buf = do_tok(buf, "Height", ((opcode & 0x80) ? A1V: A1W));
 			else
 				buf = do_tok(buf, "Left", 0);
@@ -1558,7 +1553,7 @@
 
 	if (offset == 0) {
 		sprintf(buf, "/* goto %.4X; */", to);
-	} else if (!dontOutputElse && maybeAddElse(cur, to)) {
+	} else if (!g_options.dontOutputElse && maybeAddElse(cur, to)) {
 		pendingElse = true;
 		pendingElseTo = to;
 		pendingElseOffs = cur;
@@ -1566,7 +1561,7 @@
 		pendingElseIndent = g_blockStack.size();
 		buf[0] = 0;
 	} else {
-		if (!g_blockStack.empty() && !dontOutputWhile) {
+		if (!g_blockStack.empty() && !g_options.dontOutputWhile) {
 			Block p = g_blockStack.top();
 			if (p.isWhile && cur == (int)p.to)
 				return;		// A 'while' ends here.
@@ -1581,24 +1576,24 @@
 	int cur = get_curoffs();
 	int to = cur + offset;
 
-	if (!dontOutputElseif && pendingElse) {
+	if (!g_options.dontOutputElseif && pendingElse) {
 		if (maybeAddElseIf(cur, pendingElseTo, to)) {
 			pendingElse = false;
 			haveElse = true;
 			buf = strecpy(buf, "} else if (");
 			buf = strecpy(buf, condition);
-			sprintf(buf, alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
+			sprintf(buf, g_options.alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
 			return;
 		}
 	}
 
-	if (!dontOutputIfs && maybeAddIf(cur, to)) {
-		if (!dontOutputWhile && g_blockStack.top().isWhile) {
+	if (!g_options.dontOutputIfs && maybeAddIf(cur, to)) {
+		if (!g_options.dontOutputWhile && g_blockStack.top().isWhile) {
 			buf = strecpy(buf, "while (");
 		} else
 			buf = strecpy(buf, "if (");
 		buf = strecpy(buf, condition);
-		sprintf(buf, alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
+		sprintf(buf, g_options.alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
 		return;
 	}
 
@@ -1652,7 +1647,7 @@
 	if (opcode == 0x28 || opcode == 0xA8) {
 		get_var(tmp2);
 	} else {
-		if (scriptVersion == 0)
+		if (g_options.scriptVersion == 0)
 			get_var_or_byte(tmp2, opcode & 0x80);
 		else
 			get_var_or_word(tmp2, opcode & 0x80);
@@ -1680,7 +1675,7 @@
 	int state = 0;
 
 	var[0] = 0;
-	if (scriptVersion == 0) {
+	if (g_options.scriptVersion == 0) {
 		if (opcode & 0x40)
 			sprintf(var, "activeObject");
 		else
@@ -1689,7 +1684,7 @@
 		get_var_or_word(var, opcode & 0x80);
 	}
 
-	if (scriptVersion > 2) {
+	if (g_options.scriptVersion > 2) {
 		switch (opcode & 0x2F) {
 		case 0x0f:
 			neg = 0;
@@ -1704,7 +1699,7 @@
 
 		get_var_or_byte(tmp2, opcode & 0x40);
 	} else {
-		if (scriptVersion == 0) {
+		if (g_options.scriptVersion == 0) {
 			switch (opcode) {
 			case 0x7f:
 			case 0xbf:
@@ -1789,7 +1784,7 @@
 		}
 	}
 
-	if (scriptVersion > 2)
+	if (g_options.scriptVersion > 2)
 		sprintf(tmp, "getState(%s)%s%s", var, neg ? " != " : " == ", tmp2);
 	else
 		sprintf(tmp, "%sgetState%02d(%s)", neg ? "!" : "", state, var);
@@ -1800,7 +1795,7 @@
 {
 	const char *s;
 
-	if ((scriptVersion <= 2)
+	if ((g_options.scriptVersion <= 2)
 		&& ((opcode & 0x7F) == 0x0A
 		 || (opcode & 0x7F) == 0x2A
 		 || (opcode & 0x7F) == 0x6A)) {
@@ -1850,11 +1845,11 @@
 	buf = strecpy(buf, s);
 
 
-	if ((scriptVersion <= 2) && (opcode & 0x7F) == 0x2C) { /* assignVarByte */
+	if ((g_options.scriptVersion <= 2) && (opcode & 0x7F) == 0x2C) { /* assignVarByte */
 		sprintf(buf, "%d", get_byte());
 		buf = strchr(buf, 0);
 	} else if ((opcode & 0x7F) != 0x46) {	/* increment or decrement */
-		if (scriptVersion == 0)
+		if (g_options.scriptVersion == 0)
 			buf = get_var_or_byte(buf, opcode & 0x80);
 		else
 			buf = get_var_or_word(buf, opcode & 0x80);
@@ -1999,12 +1994,12 @@
 	case 0xD9:
 	case 0xF9:{
 			buf = strecpy(buf, "doSentence(");
-			if (!(opcode & 0x80) && *cur_pos == 0xFC) {
+			if (!(opcode & 0x80) && *g_scriptCurPos == 0xFC) {
 				strcpy(buf, "STOP)");
-				cur_pos++;
-			} else if (!(opcode & 0x80) && *cur_pos == 0xFB) {
+				g_scriptCurPos++;
+			} else if (!(opcode & 0x80) && *g_scriptCurPos == 0xFB) {
 				strcpy(buf, "RESET)");
-				cur_pos++;
+				g_scriptCurPos++;
 			} else {
 				do_tok(buf, "",
 							 ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1B) |
@@ -3067,7 +3062,7 @@
 	case 0x45:
 	case 0x85:
 	case 0xC5:
-		if (scriptVersion == 5) {
+		if (g_options.scriptVersion == 5) {
 			buf = do_tok(buf, "drawObject", ((opcode & 0x80) ? A1V : A1W) | ANOLASTPAREN);
 			opcode = get_byte();
 			switch (opcode & 0x1F) {
@@ -3094,7 +3089,7 @@
 	case 0x65:
 	case 0xA5:
 	case 0xE5:
-		if (scriptVersion == 5) {
+		if (g_options.scriptVersion == 5) {
 			do_tok(buf, "pickupObject", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2B));
 		} else {
 			buf = do_tok(buf, "drawObject",
@@ -3158,7 +3153,7 @@
 
 	case 0x0F:
 	case 0x8F:
-		if (scriptVersion == 5) {
+		if (g_options.scriptVersion == 5) {
 			do_tok(buf, "getObjectState", AVARSTORE | ((opcode & 0x80) ? A1V : A1W));
 			break;
 		}
@@ -3278,14 +3273,14 @@
 
 	case 0x3B:
 	case 0xBB:
-		if (IndyFlag)
+		if (g_options.IndyFlag)
 			do_tok(buf, "waitForActor", ((opcode & 0x80) ? A1V : A1B));
 		else
 			do_tok(buf, "getActorScale", AVARSTORE | ((opcode & 0x80) ? A1V : A1B));
 		break;
 
 	case 0xAE:{
-			if (IndyFlag)
+			if (g_options.IndyFlag)
 				opcode = 2;
 			else
 				opcode = get_byte();
@@ -3345,9 +3340,9 @@
 	case 0xF9:{
 			buf = strecpy(buf, "doSentence(");
 			// FIXME: this is not exactly what ScummVM does...
-			if (!(opcode & 0x80) && (*cur_pos == 0xFE)) {
+			if (!(opcode & 0x80) && (*g_scriptCurPos == 0xFE)) {
 				strcpy(buf, "STOP)");
-				cur_pos++;
+				g_scriptCurPos++;
 			} else {
 				do_tok(buf, "",
 							 ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1B) |
@@ -3439,7 +3434,7 @@
 
 	case 0x02:
 	case 0x82:
-		if (ZakFlag)
+		if (g_options.ZakFlag)
 			do_tok(buf, "startMusic", AVARSTORE | ((opcode & 0x80) ? A1V : A1B));
 		else
 			do_tok(buf, "startMusic", ((opcode & 0x80) ? A1V : A1B));
@@ -3453,7 +3448,7 @@
 	case 0x73:
 	case 0xB3:
 	case 0xF3:
-		if (scriptVersion == 5)
+		if (g_options.scriptVersion == 5)
 			do_room_ops(buf);
 		else
 			do_room_ops_old(buf, opcode);
@@ -3501,7 +3496,7 @@
 		break;
 
 	case 0x4C:
-		if (scriptVersion <= 3)
+		if (g_options.scriptVersion <= 3)
 			do_tok(buf, "waitForSentence", 0);
 		else
 			do_tok(buf, "soundKludge", A1LIST);
@@ -3523,7 +3518,7 @@
 
 	case 0x43:
 	case 0xC3:
-		if (IndyFlag)
+		if (g_options.IndyFlag)
 			do_tok(buf, "getActorX", AVARSTORE | ((opcode & 0x80) ? A1V : A1B));
 		else
 			do_tok(buf, "getActorX", AVARSTORE | ((opcode & 0x80) ? A1V : A1W));
@@ -3531,7 +3526,7 @@
 
 	case 0x23:
 	case 0xA3:
-		if (IndyFlag)
+		if (g_options.IndyFlag)
 			do_tok(buf, "getActorY", AVARSTORE | ((opcode & 0x80) ? A1V : A1B));
 		else
 			do_tok(buf, "getActorY", AVARSTORE | ((opcode & 0x80) ? A1V : A1W));
@@ -3619,7 +3614,7 @@
 
 	case 0x30:
 	case 0xB0:
-		if (scriptVersion == 3)
+		if (g_options.scriptVersion == 3)
 			do_tok(buf, "setBoxFlags", ((opcode & 0x80) ? A1V : A1B) | A2B);
 		else
 			do_matrix_ops(buf, opcode);
@@ -3645,7 +3640,7 @@
 
 	case 0x22:
 	case 0xA2:
-		if (scriptVersion == 5)
+		if (g_options.scriptVersion == 5)
 			do_tok(buf, "getAnimCounter", AVARSTORE | ((opcode & 0x80) ? A1V : A1B));
 		else
 			do_tok(buf, "saveLoadGame", AVARSTORE | ((opcode & 0x80) ? A1V : A1B));
@@ -3721,7 +3716,7 @@
 		break;
 
 	default:
-		if (haltOnError) {
+		if (g_options.haltOnError) {
 			error("Unknown opcode %.2X", opcode);
 		}
 		sprintf(buf, "ERROR: Unknown opcode %.2X!", opcode);

Modified: tools/trunk/descumm.h
===================================================================
--- tools/trunk/descumm.h	2006-12-26 20:57:29 UTC (rev 24931)
+++ tools/trunk/descumm.h	2006-12-27 00:25:01 UTC (rev 24932)
@@ -91,7 +91,7 @@
 
 
 //
-// Jump decoding auxillaries (used by the code which tries to translate jumps
+// Jump decoding auxiliaries (used by the code which tries to translate jumps
 // back into if / else / while / etc. constructs).
 //
 extern bool pendingElse, haveElse;
@@ -106,41 +106,55 @@
 extern int g_jump_opcode;
 
 //
-// Command line options
+// Command line gptions
 //
-extern bool alwaysShowOffs;
-extern bool dontOutputIfs;
-extern bool dontOutputElse;
-extern bool dontOutputElseif;
-extern bool dontOutputWhile;
-extern bool dontOutputBreaks;
-extern bool dontShowOpcode;
-extern bool dontShowOffsets;
-extern bool haltOnError;
+struct Options {
+	bool alwaysShowOffs;
+	bool dontOutputIfs;
+	bool dontOutputElse;
+	bool dontOutputElseif;
+	bool dontOutputWhile;
+	bool dontOutputBreaks;
+	bool dontShowOpcode;
+	bool dontShowOffsets;
+	bool haltOnError;
+	
+	bool HumongousFlag;
+	bool ZakFlag;
+	bool IndyFlag;
+	bool GF_UNBLOCKED;
+		
+	//
+	// The SCUMM version used for the script we are descumming.
+	//
+	byte scriptVersion;
+	byte heVersion;
+};
 
-extern bool HumongousFlag;
-extern bool ZakFlag;
-extern bool IndyFlag;
-extern bool GF_UNBLOCKED;
 
+extern Options g_options;
+
 //
-// The SCUMM version used for the script we are descumming.
+// Start and length of the script code (w/o header)
 //
-extern byte scriptVersion;
-extern byte heVersion;
+extern byte *g_scriptStart;
+extern uint g_scriptSize;
 
 //
-// Various positions / offsets
+// Pointer to the current byte, i.e. the byte to be
+// read next.
 //
-extern byte *cur_pos, *org_pos;
+extern byte *g_scriptCurPos;
+
+
+// The variable offs_of_line indicates the offset associated to
+// the next line to be printed; in other words, it is the offset of
+// the first bytecode op which is part of the current line (recall
+// that a single line can correspond to multiple ops, e.g. several
+// push-ops plus one op using all those pushed values).
 extern int offs_of_line;
 
 //
-// Total size of the currently loaded script
-//
-extern uint size_of_code;
-
-//
 // Common
 //
 

Modified: tools/trunk/descumm6.cpp
===================================================================
--- tools/trunk/descumm6.cpp	2006-12-26 20:57:29 UTC (rev 24931)
+++ tools/trunk/descumm6.cpp	2006-12-27 00:25:01 UTC (rev 24932)
@@ -120,7 +120,6 @@
 #define MAX_STACK_SIZE	256
 static StackEnt *stack[MAX_STACK_SIZE];
 static int num_stack = 0;
-bool HumongousFlag = false;
 
 const char *var_names72[] = {
 	/* 0 */
@@ -744,15 +743,15 @@
 
 const char *getVarName(uint var)
 {
-	if (heVersion == 72) {
+	if (g_options.heVersion == 72) {
 		if (var >= sizeof(var_names72) / sizeof(var_names72[0]))
 			return NULL;
 		return var_names72[var];
-	} else if (scriptVersion == 8) {
+	} else if (g_options.scriptVersion == 8) {
 		if (var >= sizeof(var_names8) / sizeof(var_names8[0]))
 			return NULL;
 		return var_names8[var];
-	} else if (scriptVersion == 7) {
+	} else if (g_options.scriptVersion == 7) {
 		if (var >= sizeof(var_names7) / sizeof(var_names7[0]))
 			return NULL;
 		return var_names7[var];
@@ -855,7 +854,7 @@
 		where += sprintf(where, "%ld", se->data);
 		break;
 	case seVar:
-		if (scriptVersion == 8) {
+		if (g_options.scriptVersion == 8) {
 			if (!(se->data & 0xF0000000)) {
 				var = se->data & 0xFFFFFFF;
 				if ((s = getVarName(var)) != NULL)
@@ -887,10 +886,10 @@
 		break;
 	case seArray:
 		if (se->left) {
-			if(scriptVersion == 8 && !(se->data & 0xF0000000) &&
+			if(g_options.scriptVersion == 8 && !(se->data & 0xF0000000) &&
 			   (s = getVarName(se->data & 0xFFFFFFF)) != NULL)
 				where += sprintf(where, "%s[",s);
-			else if(scriptVersion < 8 && !(se->data & 0xF000) &&
+			else if(g_options.scriptVersion < 8 && !(se->data & 0xF000) &&
 				(s = getVarName(se->data & 0xFFF)) != NULL)
 				where += sprintf(where, "%s[",s);
 			else
@@ -900,10 +899,10 @@
 			where = se_astext(se->right, where);
 			where = strecpy(where, "]");
 		} else {
-			if(scriptVersion == 8 && !(se->data & 0xF0000000) &&
+			if(g_options.scriptVersion == 8 && !(se->data & 0xF0000000) &&
 			   (s = getVarName(se->data & 0xFFFFFFF)) != NULL)
 				where += sprintf(where, "%s[",s);
-			else if(scriptVersion < 8 && !(se->data & 0xF000) &&
+			else if(g_options.scriptVersion < 8 && !(se->data & 0xF000) &&
 				(s = getVarName(se->data & 0xFFF)) != NULL)
 				where += sprintf(where, "%s[",s);
 			else
@@ -955,7 +954,7 @@
 	if (num_stack == 0) {
 		printf("ERROR: No items on stack to pop!\n");
 
-		if (!haltOnError)
+		if (!g_options.haltOnError)
 			return se_complex("**** INVALID DATA ****");
  		exit(1);
 	}
@@ -1083,7 +1082,7 @@
 				break;
 			case 10:
 				e += sprintf(e, ":sound:");
-				cur_pos += 14;
+				g_scriptCurPos += 14;
 				break;
 			case 14:
 				e += sprintf(e, ":setfont=%d:", get_word());
@@ -1267,10 +1266,10 @@
 			args[numArgs++] = pop();
 		} else if (cmd == 'z') {	// = popRoomAndObj()
 			args[numArgs++] = pop();
-			if (scriptVersion < 7 && heVersion == 0)
+			if (g_options.scriptVersion < 7 && g_options.heVersion == 0)
 				args[numArgs++] = pop();
 		} else if (cmd == 'h') {
-			if (heVersion == 72)
+			if (g_options.heVersion == 72)
 				args[numArgs++] = se_get_string_he();
 		} else if (cmd == 's') {
 			args[numArgs++] = se_get_string();
@@ -1326,18 +1325,18 @@
 		// or an instruction is placed into an else branch instead of being
 		// (incorrectly) placed inside the body of the 'if' itself.
 		sprintf(output, "/* jump %x; */", to);
-	} else if (!dontOutputElse && maybeAddElse(cur, to)) {
+	} else if (!g_options.dontOutputElse && maybeAddElse(cur, to)) {
 		pendingElse = true;
 		pendingElseTo = to;
 		pendingElseOffs = cur;
 		pendingElseOpcode = g_jump_opcode;
 		pendingElseIndent = g_blockStack.size();
 	} else {
-		if (!g_blockStack.empty() && !dontOutputWhile) {
+		if (!g_blockStack.empty() && !g_options.dontOutputWhile) {
 			Block p = g_blockStack.top();
 			if (p.isWhile && cur == (int)p.to)
 				return;		// A 'while' ends here.
-			if (!dontOutputBreaks && maybeAddBreak(cur, to)) {
+			if (!g_options.dontOutputBreaks && maybeAddBreak(cur, to)) {
 				sprintf(output, "break");
 				return;
 		  }
@@ -1353,24 +1352,24 @@
 	int to = cur + offset;
 	char *e = output;
 
-	if (!dontOutputElseif && pendingElse) {
+	if (!g_options.dontOutputElseif && pendingElse) {
 		if (maybeAddElseIf(cur, pendingElseTo, to)) {
 			pendingElse = false;
 			haveElse = true;
 			e = strecpy(e, "} else if (");
 			e = se_astext(se, e, false);
-			sprintf(e, alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
+			sprintf(e, g_options.alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
 			return;
 		}
 	}
 
-	if (!dontOutputIfs && maybeAddIf(cur, to)) {
-		if (!dontOutputWhile && g_blockStack.top().isWhile)
+	if (!g_options.dontOutputIfs && maybeAddIf(cur, to)) {
+		if (!g_options.dontOutputWhile && g_blockStack.top().isWhile)
 			e = strecpy(e, negate ? "until (" : "while (");
 		else
 			e = strecpy(e, negate ? "unless (" : "if (");
 		e = se_astext(se, e, false);
-		sprintf(e, alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
+		sprintf(e, g_options.alwaysShowOffs ? ") /*%.4X*/ {" : ") {", to);
 		return;
 	}
 
@@ -3065,13 +3064,13 @@
 		ext(output, "ppp|drawObjectAt");
 		break;
 	case 0x63:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			invalidop(NULL, code);
 		else
 			ext(output, "ppppp|drawBlastObject");
 		break;
 	case 0x64:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			invalidop(NULL, code);
 		else
 			ext(output, "pppp|setBlastObjectWindow");
@@ -3135,7 +3134,7 @@
 		jump(output);
 		break;
 	case 0x74:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "pp|startSound");
 		else
 			ext(output, "p|startSound");
@@ -3150,7 +3149,7 @@
 		ext(output, "p|stopObjectScript");
 		break;
 	case 0x78:
-		if (scriptVersion < 7)
+		if (g_options.scriptVersion < 7)
 			ext(output, "p|panCameraTo");
 		else
 			ext(output, "pp|panCameraTo");
@@ -3159,7 +3158,7 @@
 		ext(output, "p|actorFollowCamera");
 		break;
 	case 0x7A:
-		if (scriptVersion < 7)
+		if (g_options.scriptVersion < 7)
 			ext(output, "p|setCameraAt");
 		else
 			ext(output, "pp|setCameraAt");
@@ -3252,13 +3251,13 @@
 		ext(output, "pl|setBoxFlags");
 		break;
 	case 0x9A:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			invalidop(NULL, code);
 		else
 			ext(output, "|createBoxMatrix");
 		break;
 	case 0x9B:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "resourceRoutines\0"
 					"\x64p|loadScript,"
 					"\x65p|loadSound,"
@@ -3313,7 +3312,7 @@
 					"\x77z|loadFlObject");
 		break;
 	case 0x9C:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "roomOps\0"
 					"\xACpp|roomScroll,"
 					"\xAEpp|setScreen,"
@@ -3350,7 +3349,7 @@
 					"\xDCpp|copyPalColor");
 		break;
 	case 0x9D:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "actorOps\0"
 					"\xC5p|setCurActor,"
 					"\x4Cp|setCostume,"
@@ -3423,7 +3422,7 @@
 					"\xEBp|setTalkScript");
 		break;
 	case 0x9E:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "verbOps\0"
 					"\xC4p|setCurVerb,"
 					"\x7Cp|loadImg,"
@@ -3533,7 +3532,7 @@
 		ext(output, "rlp|isAnyOf");
 		break;
 	case 0xAE:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "systemOps\0"
 					 "\x9E|restart,"
 					 "\xA0|confirmShutDown,"
@@ -3562,25 +3561,25 @@
 		ext(output, "|stopSentence");
 		break;
 	case 0xB4:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			PRINT_V7HE("printLine");
 		else
 			PRINT_V67("printLine");
 		break;
 	case 0xB5:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			PRINT_V7HE("printCursor");
 		else
 			PRINT_V67("printCursor");
 		break;
 	case 0xB6:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			PRINT_V7HE("printDebug");
 		else
 			PRINT_V67("printDebug");
 		break;
 	case 0xB7:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			PRINT_V7HE("printSystem");
 		else
 			PRINT_V67("printSystem");
@@ -3600,7 +3599,7 @@
 				"\xFF|end");
 		break;
 	case 0xB9:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			PRINT_V7HE("printEgo");
 		else
 			PRINT_V67("printEgo");
@@ -3621,7 +3620,7 @@
 				"\xCCv|nukeArray");
 		break;
 	case 0xBD:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "|stopObjectCode");
 		else
 			invalidop(NULL, code);
@@ -3662,11 +3661,11 @@
 		ext(output, "rpppp|getDistPtPt");
 		break;
 	case 0xC8:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 				ext(output, "ry" "kernelGetFunctions\0"
 					"\x1|virtScreenSave"
 					);
-		else if (scriptVersion == 7) 
+		else if (g_options.scriptVersion == 7) 
 				ext(output, "ry" "kernelGetFunctions\0"
 					"\x73|getWalkBoxAt,"
 					"\x74|isPointInBox,"
@@ -3687,11 +3686,11 @@
 					);
 		break;
 	case 0xC9:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 				ext(output, "ry" "kernelSetFunctions\0"
 					"\x1|virtScreenLoad"
 					);
-		else if (scriptVersion == 7) 
+		else if (g_options.scriptVersion == 7) 
 			ext(output, "y" "kernelSetFunctions\0"
 					"\x4|grabCursor,"
 					"\x6|startVideo,"
@@ -3781,25 +3780,25 @@
 		ext(output, "rp|isRoomScriptRunning");
 		break;
 	case 0xD9:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "p|closeFile");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xDA:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rsp|openFile");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xDB:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rpp|readFile");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xDC:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 
 			ext(output, "ppp|writeFile");
 		else
@@ -3810,19 +3809,19 @@
 		ext(output, "rp|findAllObjects");
 		break;
 	case 0xDE:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "s|deleteFile");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xDF:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "ss|renameFile");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xE0:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "soundOps\0" 
 				"\xDEp|setMusicVolume,"
 				"\xDF|dummy,"
@@ -3834,7 +3833,7 @@
 		ext(output, "rpp|getPixel");
 		break;
 	case 0xE2:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "p|localizeArrayToScript");
 		else
 			invalidop(NULL, code);
@@ -3846,13 +3845,13 @@
 		ext(output, "p|setBotSet");
 		break;
 	case 0xE9:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "ppp|seekFilePos");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xEA:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "redimArray\0"
 					"\xC7ppw|int,"
 					"\xCAppw|byte");
@@ -3860,67 +3859,67 @@
 			invalidop(NULL, code);
 		break;
 	case 0xEB:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rp|readFilePos");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xEC:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			invalidop(NULL, code);
 		else
 			ext(output, "rp|getActorLayer");
 		break;
 	case 0xED:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rppp|getStringWidth");
 		else
 			ext(output, "rp|getObjectNewDir");
 		break;
 	case 0xEE:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rp|stringLen");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xEF:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rppp|appendString");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xF3:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rsp|readINI");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xF4:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rsp|writeINI");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xF5:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rppp|getStringLenForWidth");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xF6:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rpppp|getCharIndexInString");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xF9:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "s|setFilePath");
 		else
 			invalidop(NULL, code);
 		break;
 	case 0xFA:
-		if (HumongousFlag) {
+		if (g_options.HumongousFlag) {
 			ext(output, "x" "setSystemMessage\0"
 					"\xF0s|unk1,"
 					"\xF1s|versionMsg,"
@@ -3930,7 +3929,7 @@
 			invalidop(NULL, code);
 		break;
 	case 0xFB:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "x" "polygonOps\0"
 					"\xF6ppppppppp|polygonStore,"
 					"\xF7pp|polygonErase,"
@@ -3940,7 +3939,7 @@
 			invalidop(NULL, code);
 		break;
 	case 0xFC:
-		if (HumongousFlag)
+		if (g_options.HumongousFlag)
 			ext(output, "rpp|polygonHit");
 		else
 			invalidop(NULL, code);


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