[Scummvm-cvs-logs] CVS: tools descumm-common.cpp,1.7,1.8 descumm.cpp,1.84,1.85 descumm6.cpp,1.121,1.122
Max Horn
fingolfin at users.sourceforge.net
Tue Nov 11 05:56:05 CET 2003
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv3010
Modified Files:
descumm-common.cpp descumm.cpp descumm6.cpp
Log Message:
fixed if/else reconstruction code (incorrect offsets were shown)
Index: descumm-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm-common.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- descumm-common.cpp 11 Oct 2003 18:23:38 -0000 1.7
+++ descumm-common.cpp 11 Nov 2003 13:55:39 -0000 1.8
@@ -267,7 +267,8 @@
if (pendingElse) {
char buf[32];
sprintf(buf, alwaysShowOffs ? "} else /*%.4X*/ {" : "} else {", pendingElseTo);
- outputLine(buf, pendingElseOffs, pendingElseOpcode, pendingElseIndent - 1);
+ outputLine(buf, offs_of_line, pendingElseOpcode, pendingElseIndent - 1);
+ offs_of_line = pendingElseOffs;
pendingElse = false;
}
}
Index: descumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- descumm.cpp 10 Nov 2003 08:25:58 -0000 1.84
+++ descumm.cpp 11 Nov 2003 13:55:39 -0000 1.85
@@ -655,7 +655,6 @@
char tmp[256];
- //j = cur_pos - org_pos - 1;
#define NEW_EXPR_MODE 1
#if NEW_EXPR_MODE
buf = strecpy(buf, "Exprmode ");
@@ -723,7 +722,7 @@
output_expr_text(j, buf);
do {
- j = cur_pos - org_pos;
+ j = get_curoffs();
i = get_byte();
if (i == 0xFF)
@@ -1407,7 +1406,7 @@
} else if (!dontOutputElse && maybeAddElse(cur, to)) {
pendingElse = true;
pendingElseTo = to;
- pendingElseOffs = cur - 1;
+ pendingElseOffs = cur;
pendingElseOpcode = g_jump_opcode;
pendingElseIndent = num_block_stack;
buf[0] = 0;
Index: descumm6.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm6.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- descumm6.cpp 10 Nov 2003 08:25:58 -0000 1.121
+++ descumm6.cpp 11 Nov 2003 13:55:39 -0000 1.122
@@ -1049,14 +1049,14 @@
// Sometimes, jumps with offset 1 occur. I used to suppress those.
// But it turns out that's not quite correct in some cases. With this
// code, it can sometimes happens that you get an empty 'else' branch;
- // but in many other cases, an otherwis hidden instruction is revealed,
+ // but in many other cases, an otherwise hidden instruction is revealed,
// 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)) {
pendingElse = true;
pendingElseTo = to;
- pendingElseOffs = cur - 1;
+ pendingElseOffs = cur;
pendingElseOpcode = g_jump_opcode;
pendingElseIndent = num_block_stack;
} else {
More information about the Scummvm-git-logs
mailing list