[Scummvm-cvs-logs] CVS: tools descumm6.cpp,1.40,1.41
Max Horn
fingolfin at users.sourceforge.net
Mon Dec 23 05:23:01 CET 2002
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv17512
Modified Files:
descumm6.cpp
Log Message:
added 'y' ext varient: select a subop via a list parameter (used by V8 kludge and V6/V7 kernelFunction); print out stack count, useful to see if we pop enough data
Index: descumm6.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm6.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- descumm6.cpp 23 Dec 2002 03:12:56 -0000 1.40
+++ descumm6.cpp 23 Dec 2002 13:22:13 -0000 1.41
@@ -623,9 +623,9 @@
void invalidop(const char *cmd, int op)
{
if (cmd)
- printf("invalid opcode %s:0x%x\n", cmd, op);
+ printf("invalid opcode %s:0x%x (stack count %d)\n", cmd, op, num_stack);
else
- printf("invalid opcode 0x%x\n", op);
+ printf("invalid opcode 0x%x (stack count %d)\n", op, num_stack);
exit(1);
}
@@ -1035,6 +1035,7 @@
while ((cmd = *fmt++) != '|') {
if (cmd == 'x' && !extstr) {
+ /* Sub-op: next byte specifies which one */
extstr = fmt;
fmt += strlen(fmt) + 1;
@@ -1053,6 +1054,32 @@
/* found a command, continue at the beginning */
continue;
}
+ if (cmd == 'y' && !extstr) {
+ /* Sub-op: parameters are in a list, first element of the list specified the command */
+ StackEnt *se;
+ extstr = fmt;
+ fmt += strlen(fmt) + 1;
+
+ args[numArgs++] = se_get_list();
+
+ /* extended thing */
+ se = args[numArgs - 1];
+ se->data--;
+ se = se->list[se->data];
+ extcmd = se->data;
+
+ /* locate our extended item */
+ while ((cmd = *fmt++) != extcmd) {
+ /* scan until we find , or \0 */
+ while ((cmd = *fmt++) != ',') {
+ if (cmd == 0) {
+ invalidop(extstr, extcmd);
+ }
+ }
+ }
+ /* found a command, continue at the beginning */
+ continue;
+ }
if (cmd == 'm' && !prep) {
prep = fmt;
fmt += strlen(fmt) + 1;
@@ -1459,7 +1486,10 @@
break;
case 0xBA:
- ext("|kludge"); // ???
+ ext("y" "kludge\0"
+ "\xB|lockObject,"
+ "\xC|unlockObject"
+ );
break;
case 0xD3:
@@ -2048,6 +2078,7 @@
ext("rpppp|getDistPtPt");
break;
case 0xC8:
+ // TODO - make use of new 'y' ext
ext("rl|kernelFunction");
break;
case 0xC9:
@@ -2325,6 +2356,7 @@
} while (cur_pos < mem + len);
printf("END\n");
+ printf("Stack count: %d\n", num_stack);
free(memorg);
More information about the Scummvm-git-logs
mailing list