From b8b9dcffaa86c6cb988f35b48070b84577c10b53 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 28 May 2016 13:33:07 -0700 Subject: [PATCH] SCP: Added shutdown flag for detach_all --- scp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scp.c b/scp.c index ad849d14..4ea21905 100644 --- a/scp.c +++ b/scp.c @@ -1,6 +1,6 @@ /* scp.c: simulator control program - Copyright (c) 1993-2015, Robert M Supnik + Copyright (c) 1993-2016, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -23,6 +23,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Robert M Supnik. + 08-Mar-16 RMS Added shutdown flag for detach_all 28-Mar-15 RMS Added sim_printf from GitHub master (Mark Pizzolato) 28-Dec-14 JDB [4.0] Moved sim_load and sim_emax declarations to scp.h 14-Dec-14 JDB [4.0] Added sim_activate_time @@ -1149,8 +1150,8 @@ while (*cptr != 0) { /* do all mods */ } else if (!mptr->desc) /* value desc? */ break; -// else if (mptr->mask & MTAB_VAL) { /* take a value? */ -// if (!cvptr) return SCPE_MISVAL; /* none? error */ +// else if (mptr->mask & MTAB_VAL) { /* take a value? */ +// if (!cvptr) return SCPE_MISVAL; /* none? error */ // r = dep_reg (0, cvptr, (REG *) mptr->desc, 0); // if (r != SCPE_OK) return r; // } @@ -2103,7 +2104,7 @@ if (strcmp (gbuf, "ALL") == 0) dptr = find_unit (gbuf, &uptr); /* locate unit */ if (dptr == NULL) /* found dev? */ return SCPE_NXDEV; -if (uptr == NULL) /* valid unit? */ +if (uptr == NULL) /* valid unit? */ return SCPE_NXUN; return scp_detach_unit (dptr, uptr); /* detach */ } @@ -2130,6 +2131,8 @@ t_stat r; if ((start < 0) || (start > 1)) return SCPE_IERR; +if (shutdown) + sim_switches = sim_switches | SIM_SW_SHUT; /* flag shutdown */ for (i = start; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */ for (j = 0; j < dptr->numunits; j++) { /* loop thru units */ uptr = (dptr->units) + j;