SCP: Cleanup output produced by SHOW CONSOLE command

This commit is contained in:
Mark Pizzolato 2017-05-27 20:25:50 -07:00
parent 4053a6f481
commit df627b0cb1
2 changed files with 26 additions and 23 deletions

12
scp.c
View file

@ -10536,8 +10536,8 @@ if (exp->buf_size) {
}
if (exp->after)
fprintf (st, " Halt After: %d instructions\n", exp->after);
if (exp->dptr && exp->dbit)
fprintf (st, "Debugging via: SET %s DEBUG%s%s\n", sim_dname(exp->dptr), exp->dptr->debflags ? "=" : "", exp->dptr->debflags ? get_dbg_verb (exp->dbit, exp->dptr) : "");
if (exp->dptr && (exp->dbit & exp->dptr->dctrl))
fprintf (st, " Expect Debugging via: SET %s DEBUG%s%s\n", sim_dname(exp->dptr), exp->dptr->debflags ? "=" : "", exp->dptr->debflags ? get_dbg_verb (exp->dbit, exp->dptr) : "");
fprintf (st, " Match Rules:\n");
if (!*match)
return sim_exp_showall (st, exp);
@ -10778,18 +10778,18 @@ if (snd->extoff < snd->insoff) {
else
fprintf (st, " No Pending Input Data\n");
if ((snd->next_time - sim_gtime()) > 0) {
if ((snd->next_time - sim_gtime()) > (sim_timer_inst_per_sec()/1000000.0))
if (((snd->next_time - sim_gtime()) > (sim_timer_inst_per_sec()/1000000.0)) && ((sim_timer_inst_per_sec()/1000000.0) > 0.0))
fprintf (st, " Minimum of %d instructions (%d microseconds) before sending first character\n", (int)(snd->next_time - sim_gtime()),
(int)((snd->next_time - sim_gtime())/(sim_timer_inst_per_sec()/1000000.0)));
else
fprintf (st, " Minimum of %d instructions before sending first character\n", (int)(snd->next_time - sim_gtime()));
}
if (snd->delay > (sim_timer_inst_per_sec()/1000000.0))
if ((snd->delay > (sim_timer_inst_per_sec()/1000000.0)) && ((sim_timer_inst_per_sec()/1000000.0) > 0.0))
fprintf (st, " Minimum of %d instructions (%d microseconds) between characters\n", (int)snd->delay, (int)(snd->delay/(sim_timer_inst_per_sec()/1000000.0)));
else
fprintf (st, " Minimum of %d instructions between characters\n", (int)snd->delay);
if (snd->dptr && snd->dbit)
fprintf (st, "Debugging via: SET %s DEBUG%s%s\n", sim_dname(snd->dptr), snd->dptr->debflags ? "=" : "", snd->dptr->debflags ? get_dbg_verb (snd->dbit, snd->dptr) : "");
if (snd->dptr && (snd->dbit & snd->dptr->dctrl))
fprintf (st, " Send Debugging via: SET %s DEBUG%s%s\n", sim_dname(snd->dptr), snd->dptr->debflags ? "=" : "", snd->dptr->debflags ? get_dbg_verb (snd->dbit, snd->dptr) : "");
return SCPE_OK;
}

View file

@ -340,10 +340,10 @@ static SHTAB show_con_tab[] = {
{ "DEBUG", &sim_show_cons_debug, 0 },
{ "BUFFERED", &sim_show_cons_buff, 0 },
{ "EXPECT", &sim_show_cons_expect, 0 },
{ "HALT", &sim_show_cons_expect, 0 },
{ "HALT", &sim_show_cons_expect, -1 },
{ "INPUT", &sim_show_cons_send_input, 0 },
{ "RESPONSE", &sim_show_cons_send_input, 0 },
{ "DELAY", &sim_show_cons_expect, 0 },
{ "RESPONSE", &sim_show_cons_send_input, -1 },
{ "DELAY", &sim_show_cons_expect, -1 },
{ NULL, NULL, 0 }
};
@ -411,6 +411,7 @@ int32 i;
if (*cptr == 0) { /* show all */
for (i = 0; show_con_tab[i].name; i++)
if (show_con_tab[i].arg != -1)
show_con_tab[i].action (st, dptr, uptr, show_con_tab[i].arg, cptr);
return SCPE_OK;
}
@ -2432,6 +2433,7 @@ return tmxr_close_master (&sim_con_tmxr); /* close master socket *
t_stat sim_show_cons_expect (FILE *st, DEVICE *dunused, UNIT *uunused, int32 flag, CONST char *cptr)
{
fprintf (st, "Console Expect processing:\n");
return sim_exp_show (st, &sim_con_expect, cptr);
}
@ -2627,6 +2629,7 @@ return &sim_con_expect;
t_stat sim_show_cons_send_input (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, CONST char *cptr)
{
fprintf (st, "Console Send processing:\n");
return sim_show_send_input (st, &sim_con_send);
}