Add time command to MAME debugger. Returns current machine time. (#9727)

This commit is contained in:
tedgreen99 2022-05-08 20:12:44 -06:00 committed by GitHub
parent 382b86aa49
commit b66858d124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -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> &params)
}
}
//-------------------------------------------------
// execute_time - execute the time command
//-------------------------------------------------
void debugger_commands::execute_time(const std::vector<std::string> &params)
{
m_console.printf("%s\n", m_machine.time().as_string());
}
/*-------------------------------------------------
execute_comment - add a comment to a line
-------------------------------------------------*/

View File

@ -130,6 +130,7 @@ private:
void execute_resume(const std::vector<std::string> &params);
void execute_next(const std::vector<std::string> &params);
void execute_cpulist(const std::vector<std::string> &params);
void execute_time(const std::vector<std::string> &params);
void execute_comment_add(const std::vector<std::string> &params);
void execute_comment_del(const std::vector<std::string> &params);
void execute_comment_save(const std::vector<std::string> &params);

View File

@ -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"
},
@ -580,6 +581,13 @@ const help_item f_static_help_list[] =
"source break_and_trace.cmd\n"
" 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"