From ad3dc29d5dba9ecd20b80b20b709b4f2870cef08 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 6 Dec 2015 05:34:27 -0800 Subject: [PATCH] SCP: Added flag indicating to device simulations that an event dispatch is active --- scp.c | 3 +++ scp.h | 1 + 2 files changed, 4 insertions(+) diff --git a/scp.c b/scp.c index 7031dd9a..66c0fa94 100644 --- a/scp.c +++ b/scp.c @@ -471,6 +471,7 @@ DEVICE **sim_internal_devices = NULL; uint32 sim_internal_device_count = 0; int32 sim_opt_out = 0; int32 sim_is_running = 0; +t_bool sim_processing_event = FALSE; uint32 sim_brk_summ = 0; uint32 sim_brk_types = 0; uint32 sim_brk_dflt = 0; @@ -8327,6 +8328,7 @@ if (sim_clock_queue == QUEUE_LIST_END) { /* queue empty? */ sim_debug (SIM_DBG_EVENT, sim_dflt_dev, "Queue Empty New Interval = %d\n", sim_interval); return SCPE_OK; } +sim_processing_event = TRUE; do { uptr = sim_clock_queue; /* get first */ sim_clock_queue = uptr->next; /* remove first */ @@ -8357,6 +8359,7 @@ else if ((reason == SCPE_OK) && stop_cpu) reason = SCPE_STOP; +sim_processing_event = FALSE; return reason; } diff --git a/scp.h b/scp.h index b76ee0e5..e1159b70 100644 --- a/scp.h +++ b/scp.h @@ -245,6 +245,7 @@ extern int32 sim_deb_switches; /* debug display flags * extern struct timespec sim_deb_basetime; /* debug base time for relative time output */ extern UNIT *sim_clock_queue; extern int32 sim_is_running; +extern t_bool sim_processing_event; /* Called from sim_process_event */ extern char *sim_prompt; /* prompt string */ extern const char *sim_savename; /* Simulator Name used in Save/Restore files */ extern t_value *sim_eval;