diff options
author | Ludvig Strigeus | 2001-10-26 17:34:50 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2001-10-26 17:34:50 +0000 |
commit | 056dd5b15d8e8fef995afb20ebcade91dee70bf9 (patch) | |
tree | 13939a6bc6c37756402fec2ffd1e4468bccb4a09 /debug.cpp | |
parent | f9daf35824dff14fbea17af81180e589ec145a32 (diff) | |
download | scummvm-rg350-056dd5b15d8e8fef995afb20ebcade91dee70bf9.tar.gz scummvm-rg350-056dd5b15d8e8fef995afb20ebcade91dee70bf9.tar.bz2 scummvm-rg350-056dd5b15d8e8fef995afb20ebcade91dee70bf9.zip |
bug fixes, code cleanup
svn-id: r3446
Diffstat (limited to 'debug.cpp')
-rw-r--r-- | debug.cpp | 54 |
1 files changed, 52 insertions, 2 deletions
@@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.3 2001/10/26 17:34:50 strigeus + * bug fixes, code cleanup + * * Revision 1.2 2001/10/23 19:56:57 strigeus * fixed spelling error * @@ -36,6 +39,8 @@ enum { CMD_HELP, CMD_QUIT, CMD_GO, + CMD_ACTOR, + CMD_SCRIPTS, }; void ScummDebugger::attach(Scumm *s) { @@ -57,7 +62,7 @@ bool ScummDebugger::do_command() { printf("Debugger commands:\n" "help -> display this help text\n" "quit -> quit the debugger\n" - "step -> increase one frame\n" + "go [numframes] -> increase frame\n" ); return true; @@ -71,7 +76,15 @@ bool ScummDebugger::do_command() { else _go_amount = atoi(_parameters); return false; - + case CMD_ACTOR: + if (!_parameters[0]) + printActors(-1); + else + printActors(atoi(_parameters)); + return true; + case CMD_SCRIPTS: + printScripts(); + return true; } } @@ -108,6 +121,8 @@ static const DebuggerCommands debugger_commands[] = { { "h", 1, CMD_HELP }, { "q", 1, CMD_QUIT }, { "g", 1, CMD_GO }, + { "a", 1, CMD_ACTOR }, + { "s", 1, CMD_SCRIPTS }, { 0, 0, 0 }, }; @@ -143,4 +158,39 @@ int ScummDebugger::get_command() { if (*s==32) { *s=0; break; } printf("Invalid command '%s'. Type 'help' for a list of available commands.\n", _cmd_buffer); } while (1); +} + +void ScummDebugger::printActors(int act) { + int i; + Actor *a; + + if (act==-1) { + printf("+--------------------------------------------------------------+\n"); + printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|\n"); + printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+\n"); + for(i=1; i<13; i++) { + a = &_s->actor[i]; + if (a->visible) + printf("|%2d|%4d|%3d %3d|%4d|%3d|%5d|%3d|%3d|%2d|%5d|%5d|%3d|%3d|\n", + i,a->room,a->x,a->y,a->elevation,a->costume,a->width,a->walkbox,a->moving,a->neverZClip,a->animIndex,a->scalex,a->speedx,a->facing); + } + printf("+--------------------------------------------------------------+\n"); + } +} + +void ScummDebugger::printScripts() { + int i; + ScriptSlot *ss; + + printf("+---------------------------------+\n"); + printf("|# |num|sta|typ|un1|un2|fc|cut|un5|\n"); + printf("+--+---+---+---+---+---+--+---+---+\n"); + for(i=0; i<25; i++) { + ss = &_s->vm.slot[i]; + if (ss->number) { + printf("|%2d|%3d|%3d|%3d|%3d|%3d|%2d|%3d|%3d|\n", + i, ss->number, ss->status, ss->type, ss->unk1, ss->unk2, ss->freezeCount, ss->cutsceneOverride, ss->unk5); + } + } + printf("+---------------------------------+\n"); }
\ No newline at end of file |