diff options
author | 2022-05-08 20:12:44 -0600 | |
---|---|---|
committer | 2022-05-08 22:12:44 -0400 | |
commit | b66858d124f490f34c35b241f3d976fcb058055d (patch) | |
tree | a35614d91a0801cbfea6abe021463a004743b0cc | |
parent | 382b86aa49bb53233fa2eb673fc4d25d6e677cd9 (diff) |
Add time command to MAME debugger. Returns current machine time. (#9727)
-rw-r--r-- | src/emu/debug/debugcmd.cpp | 10 | ||||
-rw-r--r-- | src/emu/debug/debugcmd.h | 1 | ||||
-rw-r--r-- | src/emu/debug/debughlp.cpp | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 21d143c7f1d..ff29281ab64 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -245,6 +245,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu m_console.register_command("suspend", CMDFLAG_NONE, 0, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_suspend, this, _1)); m_console.register_command("resume", CMDFLAG_NONE, 0, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_resume, this, _1)); m_console.register_command("cpulist", CMDFLAG_NONE, 0, 0, std::bind(&debugger_commands::execute_cpulist, this, _1)); + m_console.register_command("time", CMDFLAG_NONE, 0, 0, std::bind(&debugger_commands::execute_time, this, _1)); m_console.register_command("comadd", CMDFLAG_NONE, 1, 2, std::bind(&debugger_commands::execute_comment_add, this, _1)); m_console.register_command("//", CMDFLAG_NONE, 1, 2, std::bind(&debugger_commands::execute_comment_add, this, _1)); @@ -1671,6 +1672,15 @@ void debugger_commands::execute_cpulist(const std::vector<std::string> ¶ms) } } +//------------------------------------------------- +// execute_time - execute the time command +//------------------------------------------------- + +void debugger_commands::execute_time(const std::vector<std::string> ¶ms) +{ + m_console.printf("%s\n", m_machine.time().as_string()); +} + /*------------------------------------------------- execute_comment - add a comment to a line -------------------------------------------------*/ diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index 88ae785e643..f93276d5d8d 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -130,6 +130,7 @@ private: void execute_resume(const std::vector<std::string> ¶ms); void execute_next(const std::vector<std::string> ¶ms); void execute_cpulist(const std::vector<std::string> ¶ms); + void execute_time(const std::vector<std::string> ¶ms); void execute_comment_add(const std::vector<std::string> ¶ms); void execute_comment_del(const std::vector<std::string> ¶ms); void execute_comment_save(const std::vector<std::string> ¶ms); diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index 869167e96e8..dd2a506cde8 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -81,6 +81,7 @@ const help_item f_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" + " time -- prints current machine time to the console\n" " cls -- clears the console text buffer\n" " quit -- exits MAME and the debugger\n" }, @@ -581,6 +582,13 @@ const help_item f_static_help_list[] = " Reads in debugger commands from break_and_trace.cmd and executes them.\n" }, { + "time", + "\n" + " time\n" + "\n" + "The time command prints the current machine time to the console.\n" + }, + { "quit", "\n" " quit\n" |