aboutsummaryrefslogtreecommitdiff
path: root/scumm/debugger.cpp
diff options
context:
space:
mode:
authorJonathan Gray2003-01-18 16:04:28 +0000
committerJonathan Gray2003-01-18 16:04:28 +0000
commitc982b4f00b922c6c9629e2f532ed7ed62767b5b2 (patch)
treed6ce040c7bc2cc46d8cc64fa05ed34770aa515d8 /scumm/debugger.cpp
parentc1ce0e1eceb12ecac8ec0f8bdb247e5b6d44a126 (diff)
downloadscummvm-rg350-c982b4f00b922c6c9629e2f532ed7ed62767b5b2.tar.gz
scummvm-rg350-c982b4f00b922c6c9629e2f532ed7ed62767b5b2.tar.bz2
scummvm-rg350-c982b4f00b922c6c9629e2f532ed7ed62767b5b2.zip
add help command to debugger to list commands and vars, we should probably have a help string for each but this is much better than reading the code for now :)
svn-id: r6501
Diffstat (limited to 'scumm/debugger.cpp')
-rw-r--r--scumm/debugger.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index 91c4a0456c..6a6b3756ee 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -66,6 +66,7 @@ void ScummDebugger::attach(Scumm *s)
DCmd_Register("savegame", &ScummDebugger::Cmd_SaveGame);
DCmd_Register("level", &ScummDebugger::Cmd_DebugLevel);
+ DCmd_Register("help", &ScummDebugger::Cmd_Help);
}
}
@@ -359,7 +360,46 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) {
return true;
}
+bool ScummDebugger::Cmd_Help(int argc, const char **argv) {
+ // console normally has 39 line width
+ // wrap around nicely
+ int width = 0, size;
+
+ Debug_Printf("Commands are:\n");
+ for (int i=0 ; i < _dcmd_count ; i++) {
+ size = strlen(_dcmds[i].name) + 1;
+
+ if ((width + size) >= 39) {
+ Debug_Printf("\n");
+ width = size;
+ } else
+ width += size;
+
+ Debug_Printf("%s ", _dcmds[i].name);
+ }
+
+ width = 0;
+
+ Debug_Printf("\n\nVariables are:\n");
+ for (int i=0 ; i < _dvar_count ; i++) {
+ size = strlen(_dvars[i].name) + 1;
+
+ if ((width + size) >= 39) {
+ Debug_Printf("\n");
+ width = size;
+ } else
+ width += size;
+
+ Debug_Printf("%s ", _dvars[i].name);
+ }
+
+ Debug_Printf("\n");
+
+ return true;
+}
+
bool ScummDebugger::Cmd_DebugLevel(int argc, const char **argv) {
+
if (argc == 1) {
if (_s->_debugMode == false)
Debug_Printf("Debugging is not enabled at this time\n");