diff --git a/doc/simh.doc b/doc/simh.doc index 6e39cea8..03bb114d 100644 Binary files a/doc/simh.doc and b/doc/simh.doc differ diff --git a/sim_console.c b/sim_console.c index 41558b26..6a0674b7 100644 --- a/sim_console.c +++ b/sim_console.c @@ -182,6 +182,13 @@ int32 sim_del_char = '\b'; /* delete character */ #else int32 sim_del_char = 0177; #endif +t_bool sim_signaled_int_char /* WRU character detected by signal while running */ +#if defined (_WIN32) || defined (_VMS) || defined (__CYGWIN__) + = FALSE; +#else + = TRUE; +#endif +uint32 sim_last_poll_kbd_time; /* time when sim_poll_kbd was called */ extern TMLN *sim_oline; /* global output socket */ static t_stat sim_con_poll_svc (UNIT *uptr); /* console connection poll routine */ @@ -2835,6 +2842,7 @@ t_stat sim_poll_kbd (void) { t_stat c; +sim_last_poll_kbd_time = sim_os_msec (); /* record when this poll happened */ if (sim_send_poll_data (&sim_con_send, &c)) /* injected input characters available? */ return c; if (!sim_rem_master_mode) { diff --git a/sim_console.h b/sim_console.h index 6f27d99c..37a1fe06 100644 --- a/sim_console.h +++ b/sim_console.h @@ -127,12 +127,14 @@ int32 sim_tt_outcvt (int32 c, uint32 mode); t_stat sim_tt_settabs (UNIT *uptr, int32 val, CONST char *cptr, void *desc); t_stat sim_tt_showtabs (FILE *st, UNIT *uptr, int32 val, CONST void *desc); -extern int32 sim_rem_cmd_active_line; /* command in progress on line # */ +extern int32 sim_rem_cmd_active_line; /* command in progress on line # */ -extern int32 sim_int_char; /* interrupt character */ -extern int32 sim_brk_char; /* break character */ -extern int32 sim_tt_pchar; /* printable character mask */ -extern int32 sim_del_char; /* delete character */ +extern int32 sim_int_char; /* interrupt character */ +extern int32 sim_brk_char; /* break character */ +extern int32 sim_tt_pchar; /* printable character mask */ +extern int32 sim_del_char; /* delete character */ +extern t_bool sim_signaled_int_char; /* WRU character detected by signal while running */ +extern uint32 sim_last_poll_kbd_time; /* time when sim_poll_kbd was called */ #ifdef __cplusplus } diff --git a/sim_timer.c b/sim_timer.c index 8c773037..b1207165 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -987,6 +987,11 @@ if (sim_calb_tmr != tmr) { return rtc->currd; } new_rtime = sim_os_msec (); /* wall time */ +if (!sim_signaled_int_char && + ((new_rtime - sim_last_poll_kbd_time) > 500)) { + sim_debug (DBG_CAL, &sim_timer_dev, "sim_rtcn_calb(tmr=%d) gratuitious keyboard poll after %d msecs\n", tmr, (int)(new_rtime - sim_last_poll_kbd_time)); + (void)sim_poll_kbd (); + } ++rtc->calibrations; /* count calibrations */ sim_debug (DBG_TRC, &sim_timer_dev, "sim_rtcn_calb(ticksper=%d, tmr=%d)\n", ticksper, tmr); if (new_rtime < rtc->rtime) { /* time running backwards? */