From 32bf2629b1d5601a7bcfee0ae44570154337feea Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 16 Nov 2016 20:35:35 -0800 Subject: [PATCH] VAX8600: Changed console input polling Polling is now done at least every 500ms even if the prior input character hasn't been processed yet. This allows ^E to provide a way to exit a simulator which otherwise isn't reading from the console port. --- VAX/vax860_stddev.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/VAX/vax860_stddev.c b/VAX/vax860_stddev.c index c656349e..d6a1c1da 100644 --- a/VAX/vax860_stddev.c +++ b/VAX/vax860_stddev.c @@ -193,6 +193,7 @@ RLDS_VCK+RLDS_DSE) /* errors bits */ int32 tti_csr = 0; /* control/status */ +uint32 tti_buftime; /* time input character arrived */ int32 tti_buf = 0; /* buffer */ int32 tti_int = 0; /* interrupt */ int32 tto_csr = 0; /* control/status */ @@ -590,13 +591,16 @@ switch (line) { case ID_CT: /* console terminal */ sim_clock_coschedule (uptr, tmxr_poll); /* continue poll */ - if ((tti_csr & CSR_DONE) == 0) { /* prev data taken? */ - if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ - return c; - if (c & SCPE_BREAK) /* break? */ - tti_buf = 0; - else tti_buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); - } + if ((tti_csr & CSR_DONE) && /* input still pending and < 500ms? */ + ((sim_os_msec () - tti_buftime) < 500)) + return SCPE_OK; + if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ + return c; + if (c & SCPE_BREAK) /* break? */ + tti_buf = 0; + else + tti_buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); + tti_buftime = sim_os_msec (); break; case ID_LC: /* logical console */