summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-02-16 14:17:24 +0100
committer hap <happppp@users.noreply.github.com>2021-02-16 14:17:38 +0100
commitbb1e4db26a0ccb93e32dae45ee1e6891f09ba194 (patch)
tree4ee772bb69d52f6824bb0128b6571b7621071291 /src/emu/debug
parent2b7488ed2b03863d22b15a92bce4da39cabc71ff (diff)
debug: add cls command to clear console buffer
Diffstat (limited to 'src/emu/debug')
-rw-r--r--src/emu/debug/debugcmd.cpp11
-rw-r--r--src/emu/debug/debugcmd.h1
-rw-r--r--src/emu/debug/debugcon.h1
-rw-r--r--src/emu/debug/debughlp.cpp1
4 files changed, 13 insertions, 1 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index dc5e2e6539d..432e394cc98 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -161,6 +161,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
m_console.register_command("logerror", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_logerror, this, _1, _2));
m_console.register_command("tracelog", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_tracelog, this, _1, _2));
m_console.register_command("tracesym", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_tracesym, this, _1, _2));
+ m_console.register_command("cls", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_cls, this, _1, _2));
m_console.register_command("quit", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_quit, this, _1, _2));
m_console.register_command("exit", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_quit, this, _1, _2));
m_console.register_command("do", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_do, this, _1, _2));
@@ -897,6 +898,16 @@ void debugger_commands::execute_tracesym(int ref, const std::vector<std::string>
/*-------------------------------------------------
+ execute_cls - execute the cls command
+-------------------------------------------------*/
+
+void debugger_commands::execute_cls(int ref, const std::vector<std::string> &params)
+{
+ text_buffer_clear(m_console.get_console_textbuf());
+}
+
+
+/*-------------------------------------------------
execute_quit - execute the quit command
-------------------------------------------------*/
diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h
index 08f90e54a16..0bda10ac299 100644
--- a/src/emu/debug/debugcmd.h
+++ b/src/emu/debug/debugcmd.h
@@ -107,6 +107,7 @@ private:
void execute_logerror(int ref, const std::vector<std::string> &params);
void execute_tracelog(int ref, const std::vector<std::string> &params);
void execute_tracesym(int ref, const std::vector<std::string> &params);
+ void execute_cls(int ref, const std::vector<std::string> &params);
void execute_quit(int ref, const std::vector<std::string> &params);
void execute_do(int ref, const std::vector<std::string> &params);
void execute_step(int ref, const std::vector<std::string> &params);
diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h
index 8cb548a1081..b03b18b208f 100644
--- a/src/emu/debug/debugcon.h
+++ b/src/emu/debug/debugcon.h
@@ -71,7 +71,6 @@ public:
private:
u16 m_error_class, m_error_offset;
-
};
diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp
index 473de3249ce..74d6b7f29ea 100644
--- a/src/emu/debug/debughlp.cpp
+++ b/src/emu/debug/debughlp.cpp
@@ -101,6 +101,7 @@ static const help_item static_help_list[] =
" stateload[sl] <filename> -- load a state file for the current driver\n"
" snap [<filename>] -- save a screen snapshot.\n"
" source <filename> -- reads commands from <filename> and executes them one by one\n"
+ " cls -- clears the console text buffer\n"
" quit -- exits MAME and the debugger\n"
},
{