diff options
author | Jonathan Gray | 2003-04-23 05:05:20 +0000 |
---|---|---|
committer | Jonathan Gray | 2003-04-23 05:05:20 +0000 |
commit | 8d39d6ddb14f9403033ef897ce64e9586036ceb9 (patch) | |
tree | 84be63fdf43a94a4d868166c9ad7cbecf23ff1e4 /scumm/debugger.cpp | |
parent | 91fcad01e5a1b6f46927473085f7adc6aabe4d8d (diff) | |
download | scummvm-rg350-8d39d6ddb14f9403033ef897ce64e9586036ceb9.tar.gz scummvm-rg350-8d39d6ddb14f9403033ef897ce64e9586036ceb9.tar.bz2 scummvm-rg350-8d39d6ddb14f9403033ef897ce64e9586036ceb9.zip |
add script command to debugger and convert old printscripts function to new debugger
svn-id: r7082
Diffstat (limited to 'scumm/debugger.cpp')
-rw-r--r-- | scumm/debugger.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index d35d94a997..ac71033331 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -85,6 +85,8 @@ void ScummDebugger::attach(Scumm *s, char *entry) { DCmd_Register("room", &ScummDebugger::Cmd_Room); DCmd_Register("objects", &ScummDebugger::Cmd_PrintObjects); DCmd_Register("object", &ScummDebugger::Cmd_Object); + DCmd_Register("script", &ScummDebugger::Cmd_Script); + DCmd_Register("scripts", &ScummDebugger::Cmd_PrintScript); DCmd_Register("loadgame", &ScummDebugger::Cmd_LoadGame); DCmd_Register("savegame", &ScummDebugger::Cmd_SaveGame); @@ -395,6 +397,49 @@ bool ScummDebugger::Cmd_Hide(int argc, const char **argv) { return true; } +bool ScummDebugger::Cmd_Script(int argc, const char** argv) { + int scriptnum; + + if (argc < 2) { + Debug_Printf("Syntax: script <scriptnum> <command>\n"); + return true; + } + + scriptnum = atoi(argv[1]); + + if (scriptnum >= _s->_maxScripts) { + Debug_Printf("Script number %d is out of range (range: 1 - %d)\n", scriptnum, _s->_maxScripts); + return true; + } + + if ((!strcmp(argv[2], "kill")) || (!strcmp(argv[2], "stop"))) { + _s->stopScriptNr(scriptnum); + } else { + Debug_Printf("Unknown script command '%s'\n", argv[2]); + } + + return true; +} + +bool ScummDebugger::Cmd_PrintScript(int argc, const char **argv) { + int i; + ScriptSlot *ss; + Debug_Printf("+-----------------------------+\n"); + Debug_Printf("|# |num|sta|typ|un1|un2|fc|cut|\n"); + Debug_Printf("+--+---+---+---+---+--+---+---+\n"); + for (i=0; i < 25; i++) { + ss = &(_s->vm.slot[i]); + if (ss->number) { + Debug_Printf("|%2d|%3d|%3d|%3d|%3d|%3d|%2d|%3d|\n", + i, ss->number, ss->status, ss->where, ss->unk1, ss->unk2, + ss->freezeCount, ss->cutsceneOverride); + } + } + Debug_Printf("+-----------------------------+\n"); + + return true; +} + bool ScummDebugger::Cmd_Actor(int argc, const char **argv) { Actor *a; int actnum; |