[Scummvm-cvs-logs] CVS: tools descumm6.cpp,1.39,1.40
Max Horn
fingolfin at users.sourceforge.net
Sun Dec 22 19:13:03 CET 2002
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv9201
Modified Files:
descumm6.cpp
Log Message:
cleanup
Index: descumm6.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm6.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- descumm6.cpp 23 Dec 2002 03:06:38 -0000 1.39
+++ descumm6.cpp 23 Dec 2002 03:12:56 -0000 1.40
@@ -42,7 +42,7 @@
typedef signed short int16;
typedef signed long int32;
-#define JUMP_OPCODE 0x73
+int g_jump_opcode = 0x66;
uint32 inline SWAP_32(uint32 a)
{
@@ -1174,7 +1174,7 @@
if ((uint) k >= (uint) size_of_code)
return false; /* Invalid jump */
- if (org_pos[k] != JUMP_OPCODE)
+ if (org_pos[k] != g_jump_opcode)
return false; /* Invalid jump */
k = to + *((short *)(org_pos + k + 1));
@@ -1192,14 +1192,15 @@
void jump()
{
- int cur = get_curoffs() + ((scriptVersion == 8) ? 4 : 2);
- int to = cur + get_signed_word();
+ int offset = get_signed_word();
+ int cur = get_curoffs();
+ int to = cur + offset;
if (!dontOutputElse && maybeAddElse(cur, to)) {
pendingElse = true;
pendingElseTo = to;
pendingElseOffs = cur - 1;
- pendingElseOpcode = JUMP_OPCODE;
+ pendingElseOpcode = g_jump_opcode;
pendingElseIndent = num_block_stack;
} else {
sprintf(output, "jump %x", to);
@@ -1208,8 +1209,8 @@
void jumpif(StackEnt * se, bool when)
{
- int cur = get_curoffs() + ((scriptVersion == 8) ? 4 : 2);
int offset = get_signed_word();
+ int cur = get_curoffs();
int to = cur + offset;
char *e = output;
@@ -2226,11 +2227,17 @@
case 'h':
haltOnError = 1;
break;
+ case '6':
+ scriptVersion = 6;
+ g_jump_opcode = 0x73;
+ break;
case '7':
scriptVersion = 7;
+ g_jump_opcode = 0x73;
break;
case '8':
scriptVersion = 8;
+ g_jump_opcode = 0x66;
break;
default:
ShowHelpAndExit();
More information about the Scummvm-git-logs
mailing list