aboutsummaryrefslogtreecommitdiff
path: root/debug.cpp
diff options
context:
space:
mode:
authorJames Brown2002-03-06 10:03:00 +0000
committerJames Brown2002-03-06 10:03:00 +0000
commit17270d2ccdaa2a0c584b354cbe0efa4a65be1d04 (patch)
tree161ded9f607a551cdbbb6f8049a72f48efd6ce7b /debug.cpp
parent474c9e333b81280e2c450f07e81eb1cc19ea89b5 (diff)
downloadscummvm-rg350-17270d2ccdaa2a0c584b354cbe0efa4a65be1d04.tar.gz
scummvm-rg350-17270d2ccdaa2a0c584b354cbe0efa4a65be1d04.tar.bz2
scummvm-rg350-17270d2ccdaa2a0c584b354cbe0efa4a65be1d04.zip
Fixed some more Sam and Max bugs. Is now playable to BumpusVille.
Added two new debug commands, one to read and set variables, the other to set a 'watch' on variables. svn-id: r3662
Diffstat (limited to 'debug.cpp')
-rw-r--r--debug.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/debug.cpp b/debug.cpp
index 7e44d9609e..00baf1dad7 100644
--- a/debug.cpp
+++ b/debug.cpp
@@ -40,7 +40,9 @@ enum {
CMD_ACTOR,
CMD_SCRIPTS,
CMD_LOAD_ROOM,
- CMD_DUMPBOX,
+ CMD_DUMPBOX,
+ CMD_VAR,
+ CMD_WATCH,
CMD_EXIT
};
@@ -117,6 +119,31 @@ bool ScummDebugger::do_command() {
}
}
return true;
+ case CMD_VAR:
+ if (!_parameters[0]) {
+ printf("Enter a variable\n");
+ } else {
+ char *tok = strtok(_parameters, " ");
+ int var = atoi(tok);
+ tok = strtok(NULL, "");
+ if (tok)
+ _s->writeVar(var, atoi(tok));
+
+ printf("Var[%d] = %d\n", var, _s->readVar(var));
+ }
+ return true;
+ case CMD_WATCH:
+ if (!_parameters[0]) {
+ printf("Clearing all watches..\n");
+ _s->_varwatch = -1;
+ } else {
+ _s->_varwatch = atoi(_parameters);
+ if (_s->_varwatch == 0)
+ printf("Watching all variables\n");
+ else
+ printf("Watching vars[%d]\n", _s->_varwatch);
+ }
+ return true;
case CMD_EXIT:
exit(1);
@@ -161,7 +188,9 @@ static const DebuggerCommands debugger_commands[] = {
{ "a", 1, CMD_ACTOR },
{ "s", 1, CMD_SCRIPTS },
{ "r", 1, CMD_LOAD_ROOM },
- { "b", 1, CMD_DUMPBOX},
+ { "b", 1, CMD_DUMPBOX},
+ { "v", 1, CMD_VAR},
+ { "w", 1, CMD_WATCH},
{ "e", 1, CMD_EXIT },
{ 0, 0, 0 },
};