From 48e0b47d514220c31e834cc6cdf93c4dccdee0b6 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 17 Dec 2016 10:35:56 -0800 Subject: [PATCH] SCP: Add a way to see the enabled SCP internal devices SHOW DEV -I --- scp.c | 8 +++++++- sim_console.c | 2 +- sim_timer.c | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scp.c b/scp.c index 142e0eb6..f36a507a 100644 --- a/scp.c +++ b/scp.c @@ -1186,7 +1186,7 @@ static const char simh_help[] = "+sh{ow} {-c} br{eak} show breakpoints\n" "+sh{ow} con{figuration} show configuration\n" "+sh{ow} cons{ole} {arg} show console options\n" - "+sh{ow} dev{ices} show devices\n" + "+sh{ow} {-ei} dev{ices} show devices\n" "+sh{ow} fea{tures} show system devices with descriptions\n" "+sh{ow} m{odifiers} show modifiers for all devices\n" "+sh{ow} s{how} show SHOW commands for all devices\n" @@ -4661,6 +4661,12 @@ fprintf (st, "%s simulator configuration%s\n\n", sim_name, only_enabled ? " (ena for (i = 0; (dptr = sim_devices[i]) != NULL; i++) if (!only_enabled || !qdisable (dptr)) show_device (st, dptr, flag); +if (sim_switches & SWMASK ('I')) { + fprintf (st, "\nInternal Devices%s\n\n", only_enabled ? " (enabled devices)" : ""); + for (i = 0; sim_internal_device_count && (dptr = sim_internal_devices[i]); ++i) + if (!only_enabled || !qdisable (dptr)) + show_device (st, dptr, flag); + } return SCPE_OK; } diff --git a/sim_console.c b/sim_console.c index 9f8caf20..8182476c 100644 --- a/sim_console.c +++ b/sim_console.c @@ -403,7 +403,7 @@ t_stat sim_rem_con_data_svc (UNIT *uptr); /* remote console connec t_stat sim_rem_con_reset (DEVICE *dptr); /* remote console reset routine */ UNIT sim_rem_con_unit[2] = { { UDATA (&sim_rem_con_poll_svc, UNIT_IDLE, 0) }, /* remote console connection polling unit */ - { UDATA (&sim_rem_con_data_svc, UNIT_IDLE, 0) }}; /* console data handling unit */ + { UDATA (&sim_rem_con_data_svc, UNIT_IDLE|UNIT_DIS, 0) }}; /* console data handling unit */ DEBTAB sim_rem_con_debug[] = { {"TRC", DBG_TRC}, diff --git a/sim_timer.c b/sim_timer.c index 2b55c5bb..c0703921 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -1013,11 +1013,9 @@ for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { sim_timer_units[tmr].action = &sim_timer_tick_svc; sim_timer_units[tmr].flags = UNIT_DIS | UNIT_IDLE; } -SIM_INTERNAL_UNIT.flags = UNIT_DIS | UNIT_IDLE; +SIM_INTERNAL_UNIT.flags = UNIT_IDLE; sim_register_internal_device (&sim_timer_dev); sim_throttle_unit.action = &sim_throt_svc; -sim_throttle_unit.flags = UNIT_DIS; -sim_register_internal_device (&sim_throttle_dev); sim_register_clock_unit_tmr (&SIM_INTERNAL_UNIT, SIM_INTERNAL_CLK); sim_idle_enab = FALSE; /* init idle off */ sim_idle_rate_ms = sim_os_ms_sleep_init (); /* get OS timer rate */ @@ -1564,6 +1562,7 @@ else { } } } +sim_register_internal_device (&sim_throttle_dev); sim_throt_cps = SIM_INITIAL_IPS; /* Initial value while correct one is determined */ return SCPE_OK; } @@ -2066,7 +2065,7 @@ if (tmr == SIM_NTIMERS) { /* None found? */ sim_calb_tmr = SIM_NTIMERS; sim_debug (DBG_CAL, &sim_timer_dev, "_rtcn_configure_calibrated_clock() - Starting Internal Calibrated Timer at %dHz\n", sim_int_clk_tps); SIM_INTERNAL_UNIT.action = &sim_timer_clock_tick_svc; - SIM_INTERNAL_UNIT.flags = UNIT_DIS | UNIT_IDLE; + SIM_INTERNAL_UNIT.flags = UNIT_IDLE; sim_activate_abs (&SIM_INTERNAL_UNIT, 0); sim_rtcn_init_unit (&SIM_INTERNAL_UNIT, (CLK_INIT*CLK_TPS)/sim_int_clk_tps, SIM_INTERNAL_CLK); } @@ -2334,7 +2333,8 @@ if (NULL == sim_clock_unit[tmr]) sim_clock_cosched_queue[tmr] = QUEUE_LIST_END; sim_clock_unit[tmr] = uptr; uptr->dynflags |= UNIT_TMR_UNIT; -sim_timer_units[tmr].flags = UNIT_DIS | (sim_clock_unit[tmr] ? UNIT_IDLE : 0); +sim_timer_units[tmr].flags = ((tmr == SIM_NTIMERS) ? 0 : UNIT_DIS) | + (sim_clock_unit[tmr] ? UNIT_IDLE : 0); return SCPE_OK; }