[Scummvm-cvs-logs] CVS: tools descumm.h,1.6,1.7 descumm-common.cpp,1.6,1.7 descumm.cpp,1.79,1.80 descumm6.cpp,1.119,1.120
Max Horn
fingolfin at users.sourceforge.net
Sat Oct 11 11:25:02 CEST 2003
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv15453
Modified Files:
descumm.h descumm-common.cpp descumm.cpp descumm6.cpp
Log Message:
handling all word reads as 'signed' - this seems to be the proper way (small exception: the screenEffect opcode, which uses a word to pass two bytes (handling this properly could be achieved with some special code, if desired)
Index: descumm.h
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- descumm.h 28 Sep 2003 00:49:33 -0000 1.6
+++ descumm.h 11 Oct 2003 18:23:38 -0000 1.7
@@ -140,8 +140,7 @@
extern char *strecpy(char *buf, const char *src);
extern int get_curoffs();
extern int get_byte();
-extern uint get_word();
-extern int get_signed_word();
+extern int get_word();
extern bool maybeAddIf(uint cur, uint to);
extern bool maybeAddElse(uint cur, uint to);
Index: descumm-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm-common.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- descumm-common.cpp 15 Sep 2003 16:21:48 -0000 1.6
+++ descumm-common.cpp 11 Oct 2003 18:23:38 -0000 1.7
@@ -69,29 +69,18 @@
return (byte)(*cur_pos++);
}
-uint get_word()
+int get_word()
{
int i;
if (scriptVersion == 8) {
- i = TO_LE_32(*((uint32 *)cur_pos));
+ i = (int32)TO_LE_32(*((uint32 *)cur_pos));
cur_pos += 4;
} else {
- i = TO_LE_16(*((uint16 *)cur_pos));
+ i = (int16)TO_LE_16(*((uint16 *)cur_pos));
cur_pos += 2;
}
return i;
-}
-
-int get_signed_word()
-{
- uint i = get_word();
-
- if (scriptVersion == 8) {
- return (int32)i;
- } else {
- return (int16)i;
- }
}
Index: descumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- descumm.cpp 28 Sep 2003 00:49:33 -0000 1.79
+++ descumm.cpp 11 Oct 2003 18:23:38 -0000 1.80
@@ -1401,7 +1401,7 @@
void do_unconditional_jump(char *buf)
{
- int offset = get_signed_word();
+ int offset = get_word();
int cur = get_curoffs();
int to = cur + offset;
@@ -1426,7 +1426,7 @@
void emit_if(char *buf, char *condition)
{
- int offset = get_signed_word();
+ int offset = get_word();
int cur = get_curoffs();
int to = cur + offset;
Index: descumm6.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm6.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- descumm6.cpp 28 Sep 2003 01:14:17 -0000 1.119
+++ descumm6.cpp 11 Oct 2003 18:23:38 -0000 1.120
@@ -1041,7 +1041,7 @@
void jump()
{
- int offset = get_signed_word();
+ int offset = get_word();
int cur = get_curoffs();
int to = cur + offset;
@@ -1071,7 +1071,7 @@
void jumpif(StackEnt * se, bool negate)
{
- int offset = get_signed_word();
+ int offset = get_word();
int cur = get_curoffs();
int to = cur + offset;
char *e = output;
More information about the Scummvm-git-logs
mailing list