diff --git a/HP2100/hp2100_baci.c b/HP2100/hp2100_baci.c index ef2f6392..8b08dd8e 100644 --- a/HP2100/hp2100_baci.c +++ b/HP2100/hp2100_baci.c @@ -1,6 +1,6 @@ /* hp2100_baci.c: HP 12966A buffered asynchronous communications interface simulator - Copyright (c) 2007-2012, J. David Bryan + Copyright (c) 2007-2013, J. David Bryan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ BACI 12966A BACI card + 10-Jan-13 MP Added DEV_MUX and additional DEVICE field values 10-Feb-12 JDB Deprecated DEVNO in favor of SC Removed DEV_NET to allow restoration of listening port 28-Mar-11 JDB Tidied up signal handling @@ -510,7 +511,8 @@ DEVICE baci_dev = { NULL, /* logical device name */ NULL, /* help routine */ NULL, /* help attach routine*/ - (void*)&baci_desc }; /* help context */ + (void *) &baci_desc /* help context */ + }; /* I/O signal handler. diff --git a/HP2100/hp2100_cpu.h b/HP2100/hp2100_cpu.h index f3231930..b131511f 100644 --- a/HP2100/hp2100_cpu.h +++ b/HP2100/hp2100_cpu.h @@ -24,6 +24,7 @@ in this Software without prior written authorization from Robert M Supnik. 18-Mar-13 JDB Added declarations for the MP abort handler and CPU registers + 14-Mar-13 MP Changed guard macro name to avoid reserved namespace 03-Jan-10 RMS Changed declarations of mp_control, mp_mefvv, for VMS compiler 15-Jul-08 JDB Rearranged declarations with hp2100_cpu.c and hp2100_defs.h 26-Jun-08 JDB Added mp_control to CPU state externals diff --git a/HP2100/hp2100_cpu1.h b/HP2100/hp2100_cpu1.h index c5cbaecf..539fa83b 100644 --- a/HP2100/hp2100_cpu1.h +++ b/HP2100/hp2100_cpu1.h @@ -1,6 +1,6 @@ /* hp2100_cpu1.h: HP 2100/1000 firmware dispatcher definitions - Copyright (c) 2006-2008, J. David Bryan + Copyright (c) 2006-2013, J. David Bryan 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,8 @@ be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the author. + 18-Mar-13 JDB Added externs for microcode helper functions + 14-Mar-13 MP Changed guard macro name to avoid reserved namespace 11-Sep-08 JDB Moved microcode function prototypes here 30-Apr-08 JDB Corrected OP_AFF to OP_AAFF for SIGNAL/1000 Removed unused operand patterns diff --git a/HP2100/hp2100_defs.h b/HP2100/hp2100_defs.h index 7bb482b2..95d117ae 100644 --- a/HP2100/hp2100_defs.h +++ b/HP2100/hp2100_defs.h @@ -24,6 +24,8 @@ in this Software without prior written authorization from Robert M Supnik. 18-Mar-13 JDB Added "-Wdangling-else" to the suppression pragmas + Removed redundant extern declarations + 14-Mar-13 MP Changed guard macro name to avoid reserved namespace 14-Dec-12 JDB Added "-Wbitwise-op-parentheses" to the suppression pragmas 12-May-12 JDB Added pragmas to suppress logical operator precedence warnings 10-Feb-12 JDB Added hp_setsc, hp_showsc functions to support SC modifier diff --git a/HP2100/hp2100_fp.h b/HP2100/hp2100_fp.h index ad99ddae..09a3fc72 100644 --- a/HP2100/hp2100_fp.h +++ b/HP2100/hp2100_fp.h @@ -1,6 +1,6 @@ /* hp2100_fp.h: HP 2100/21MX floating point definitions - Copyright (c) 2002-2006, Robert M. Supnik + Copyright (c) 2002-2013, 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. + 14-Mar-13 MP Changed guard macro name to avoid reserved namespace 01-Dec-06 JDB Reworked FFP helpers for 1000-F support, deleted f_pwr2 26-Sep-06 JDB Moved from hp2100_fp.c to simplify extensions */ diff --git a/HP2100/hp2100_fp1.h b/HP2100/hp2100_fp1.h index e983d536..57914ca9 100644 --- a/HP2100/hp2100_fp1.h +++ b/HP2100/hp2100_fp1.h @@ -1,6 +1,6 @@ /* hp2100_fp1.h: HP 2100/1000 multiple-precision floating point definitions - Copyright (c) 2005-2006, J. David Bryan + Copyright (c) 2005-2013, J. David Bryan 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 @@ in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the author. + 14-Mar-13 MP Changed guard macro name to avoid reserved namespace 16-Oct-06 JDB Generalized FP calling sequences for F-Series 12-Oct-06 JDB Altered x_trun for F-Series FFP compatibility */ diff --git a/HP2100/hp2100_ipl.c b/HP2100/hp2100_ipl.c index 5a5c8cad..3d59ab0b 100644 --- a/HP2100/hp2100_ipl.c +++ b/HP2100/hp2100_ipl.c @@ -25,6 +25,7 @@ IPLI, IPLO 12875A interprocessor link + 12-Dec-12 MP Revised ipl_attach for new socket API 25-Oct-12 JDB Removed DEV_NET to allow restoration of listening ports 09-May-12 JDB Separated assignments from conditional expressions 10-Feb-12 JDB Deprecated DEVNO in favor of SC @@ -126,7 +127,8 @@ DEBTAB ipl_deb [] = { { "CMDS", DEB_CMDS }, { "CPU", DEB_CPU }, { "XFER", DEB_XFER }, - { NULL, 0 } }; + { NULL, 0 } + }; /* Common structures */ @@ -571,36 +573,49 @@ return SCPE_OK; t_stat ipl_attach (UNIT *uptr, char *cptr) { SOCKET newsock; -uint32 i, t, oldf; -char host[CBUFSIZE], port[CBUFSIZE], hostport[2*CBUFSIZE+3]; +uint32 i, t; +char host [CBUFSIZE], port [CBUFSIZE], hostport [2 * CBUFSIZE + 3]; char *tptr = NULL; t_stat r; +t_bool is_active; + +is_active = (uptr->flags & UNIT_ACTV) == UNIT_ACTV; /* is the connection active? */ + +if (uptr->flags & UNIT_ATT) /* if IPL is currently attached, */ + ipl_detach (uptr); /* detach it first */ + +if ((sim_switches & SWMASK ('C')) || /* connecting? */ + ((sim_switches & SIM_SW_REST) && is_active)) { /* or restoring an active connection? */ + r = sim_parse_addr (cptr, host, /* parse the host and port */ + sizeof (host), "localhost", /* from the parameter string */ + port, sizeof (port), + NULL, NULL); + + if ((r != SCPE_OK) || (port [0] == '\0')) /* parse error or missing port number? */ + return SCPE_ARG; /* complain to the user */ + + sprintf(hostport, "%s%s%s%s%s", strchr(host, ':') ? "[" : "", host, strchr(host, ':') ? "]" : "", host [0] ? ":" : "", port); + + newsock = sim_connect_sock (hostport, NULL, NULL); + + if (newsock == INVALID_SOCKET) + return SCPE_IOERR; + + printf ("Connecting to %s\n", hostport); + + if (sim_log) + fprintf (sim_log, "Connecting to %s\n", hostport); + + uptr->flags = uptr->flags | UNIT_ACTV; + uptr->LSOCKET = 0; + uptr->DSOCKET = newsock; + } -oldf = uptr->flags; -if (oldf & UNIT_ATT) - ipl_detach (uptr); -if ((sim_switches & SWMASK ('C')) || - ((sim_switches & SIM_SW_REST) && (oldf & UNIT_ACTV))) { - r = sim_parse_addr (cptr, host, sizeof(host), "localhost", port, sizeof(port), NULL, NULL); - if ((r != SCPE_OK) || (port[0] == '\0')) - return SCPE_ARG; - sprintf(hostport, "%s%s%s%s%s", strchr(host, ':') ? "[" : "", host, strchr(host, ':') ? "]" : "", host[0] ? ":" : "", port); - newsock = sim_connect_sock (hostport, NULL, NULL); - if (newsock == INVALID_SOCKET) - return SCPE_IOERR; - printf ("Connecting to %s\n", hostport); - if (sim_log) - fprintf (sim_log, - "Connecting to %s\n", hostport); - uptr->flags = uptr->flags | UNIT_ACTV; - uptr->LSOCKET = 0; - uptr->DSOCKET = newsock; - } else { r = sim_parse_addr (cptr, host, sizeof(host), NULL, port, sizeof(port), NULL, NULL); if (r != SCPE_OK) return SCPE_ARG; - sprintf(hostport, "%s%s%s%s%s", strchr(host, ':') ? "[" : "", host, strchr(host, ':') ? "]" : "", host[0] ? ":" : "", port); + sprintf(hostport, "%s%s%s%s%s", strchr(host, ':') ? "[" : "", host, strchr(host, ':') ? "]" : "", host [0] ? ":" : "", port); newsock = sim_master_sock (hostport, &r); if (r != SCPE_OK) return r; diff --git a/HP2100/hp2100_mpx.c b/HP2100/hp2100_mpx.c index 786f58a4..e3e20559 100644 --- a/HP2100/hp2100_mpx.c +++ b/HP2100/hp2100_mpx.c @@ -1,6 +1,6 @@ /* hp2100_mpx.c: HP 12792C eight-channel asynchronous multiplexer simulator - Copyright (c) 2008-2012, J. David Bryan + Copyright (c) 2008-2013, J. David Bryan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ MPX 12792C 8-channel multiplexer card + 10-Jan-13 MP Added DEV_MUX and additional DEVICE field values 28-Dec-12 JDB Allow direct attach to the poll unit only when restoring 10-Feb-12 JDB Deprecated DEVNO in favor of SC Removed DEV_NET to allow restoration of listening port @@ -752,7 +753,8 @@ DEVICE mpx_dev = { NULL, /* logical device name */ NULL, /* help routine */ NULL, /* help attach routine*/ - (void*)&mpx_desc }; /* help context */ + (void *) &mpx_desc /* help context */ + }; /* I/O signal handler. diff --git a/HP2100/hp2100_ms.c b/HP2100/hp2100_ms.c index ba160875..e88ce0a7 100644 --- a/HP2100/hp2100_ms.c +++ b/HP2100/hp2100_ms.c @@ -1,6 +1,6 @@ /* hp2100_ms.c: HP 2100 13181A/13183A magnetic tape simulator - Copyright (c) 1993-2012, Robert M. Supnik + Copyright (c) 1993-2013, 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"), @@ -26,6 +26,7 @@ MS 13181A 7970B 800bpi nine track magnetic tape 13183A 7970E 1600bpi nine track magnetic tape + 10-Jan-13 MP Added DEV_TAPE to DEVICE flags 09-May-12 JDB Separated assignments from conditional expressions 10-Feb-12 JDB Deprecated DEVNO in favor of SC Added CNTLR_TYPE cast to ms_settype diff --git a/HP2100/hp2100_mt.c b/HP2100/hp2100_mt.c index f8fa9fd6..7fe15a81 100644 --- a/HP2100/hp2100_mt.c +++ b/HP2100/hp2100_mt.c @@ -1,6 +1,6 @@ /* hp2100_mt.c: HP 2100 12559A magnetic tape simulator - Copyright (c) 1993-2012, Robert M. Supnik + Copyright (c) 1993-2013, 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"), @@ -25,6 +25,7 @@ MT 12559A 3030 nine track magnetic tape + 10-Jan-13 MP Added DEV_TAPE to DEVICE flags 09-May-12 JDB Separated assignments from conditional expressions 25-Mar-12 JDB Removed redundant MTAB_VUN from "format" MTAB entry 10-Feb-12 JDB Deprecated DEVNO in favor of SC diff --git a/HP2100/hp2100_mux.c b/HP2100/hp2100_mux.c index 6d13cec8..521f9a1d 100644 --- a/HP2100/hp2100_mux.c +++ b/HP2100/hp2100_mux.c @@ -1,6 +1,6 @@ /* hp2100_mux.c: HP 2100 12920A terminal multiplexor simulator - Copyright (c) 2002-2012, Robert M Supnik + Copyright (c) 2002-2013, 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"), @@ -25,6 +25,7 @@ MUX,MUXL,MUXM 12920A terminal multiplexor + 10-Jan-13 MP Added DEV_MUX and additional DEVICE field values 10-Feb-12 JDB Deprecated DEVNO in favor of SC Removed DEV_NET to allow restoration of listening port 28-Mar-11 JDB Tidied up signal handling @@ -441,7 +442,8 @@ DEVICE muxl_dev = { NULL, /* logical device name */ NULL, /* help routine */ NULL, /* help attach routine*/ - NULL }; /* help context */ + NULL /* help context */ + }; /* MUXU data structures @@ -522,7 +524,8 @@ DEVICE muxu_dev = { NULL, /* logical device name */ NULL, /* help routine */ NULL, /* help attach routine*/ - (void*)&mux_desc }; /* help context */ + (void *) &mux_desc /* help context */ + }; /* MUXC data structures. @@ -584,7 +587,8 @@ DEVICE muxc_dev = { NULL, /* logical device name */ NULL, /* help routine */ NULL, /* help attach routine*/ - NULL }; /* help context */ + NULL /* help context */ + }; /* Lower data card I/O signal handler. diff --git a/HP2100/hp_disclib.c b/HP2100/hp_disclib.c index 2a0d3ce2..5011cfe2 100644 --- a/HP2100/hp_disclib.c +++ b/HP2100/hp_disclib.c @@ -1,6 +1,6 @@ /* hp_disclib.c: HP MAC/ICD disc controller simulator library - Copyright (c) 2011-2012, J. David Bryan + Copyright (c) 2011-2014, J. David Bryan Copyright (c) 2004-2011, Robert M. Supnik Permission is hereby granted, free of charge, to any person obtaining a @@ -24,6 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. + 27-Oct-14 JDB Corrected the relative movement calculation in start_seek 20-Dec-12 JDB sim_is_active() now returns t_bool 24-Oct-12 JDB Changed CNTLR_OPCODE to title case to avoid name clash 07-May-12 JDB Corrected end-of-track delay time logic @@ -2216,7 +2217,7 @@ if (target_cylinder >= drive_props [model].cylinders) { /* is the cylinder out o } else { /* the cylinder value is OK */ - delta = abs (uptr->CYL - target_cylinder); /* calculate the relative movement */ + delta = abs (uptr->CYL - (int32) target_cylinder); /* calculate the relative movement */ uptr->CYL = target_cylinder; /* and move the positioner */ if ((cvptr->head >= drive_props [model].heads) /* if the head */