diff --git a/PDP10/ka10_cpu.c b/PDP10/ka10_cpu.c index 29ff1e1..24e0829 100644 --- a/PDP10/ka10_cpu.c +++ b/PDP10/ka10_cpu.c @@ -534,6 +534,7 @@ int opflags[] = { void set_interrupt(int dev, int lvl) { + lvl &= 07; if (lvl) { dev_irq[dev>>2] = 0200 >> lvl; pi_pending = 1; @@ -2952,6 +2953,9 @@ cpu_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) #else fprintf(st, "KI10 CPU\n\n"); #endif + fprintf(st, "To stop the cpu use the command:\n\n"); + fprintf(st, " sim> SET CTY STOP\n\n"); + fprintf(st, "This will write a 1 to location %03o, causing TOPS10 to stop\n", CTY_SWITCH); fprint_set_help(st, dptr); fprint_show_help(st, dptr); return SCPE_OK; diff --git a/PDP10/ka10_cty.c b/PDP10/ka10_cty.c index fb312cc..7c195f2 100644 --- a/PDP10/ka10_cty.c +++ b/PDP10/ka10_cty.c @@ -48,7 +48,7 @@ const char *cty_description (DEVICE *dptr); #define KEY_RDY 0040 #define KEY_BSY 0100 #define KEY_TST 04000 -#define CTY_DEVNUM 0120 +#define CTY_DEVNUM 0120 t_stat cty_devio(uint32 dev, uint64 *data); @@ -179,6 +179,9 @@ t_stat tty_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc) t_stat cty_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) { +fprintf (st, "To stop the cpu use the command:\n\n"); +fprintf (st, " sim> SET CTY STOP\n\n"); +fprintf (st, "This will write a 1 to location %03o, causing TOPS10 to stop\n\n", CTY_SWITCH); fprintf (st, "The additional terminals can be set to one of four modes: UC, 7P, 7B, or 8B.\n\n"); fprintf (st, " mode input characters output characters\n\n"); fprintf (st, " UC lower case converted lower case converted to upper case,\n"); diff --git a/PDP10/ka10_dc.c b/PDP10/ka10_dc.c index ec40f71..1702579 100644 --- a/PDP10/ka10_dc.c +++ b/PDP10/ka10_dc.c @@ -37,7 +37,8 @@ #define DC_DEVNUM 0240 -#define DC10_LINES 8 +#define DC10_LINES 8 +#define DC10_MLINES 32 #define STATUS u3 @@ -57,7 +58,7 @@ /* DC10E flags */ #define CTS 0000004 /* Clear to send */ -#define RES_DET 0000002 /* Restrian detect RTS? */ +#define RES_DET 0000002 /* Ring detect */ #define DLO 0000040 /* (ACU) Data line occupied */ #define PND 0000020 /* (ACU) Present next digit */ #define ACR 0000010 /* (ACU) Abandon Call and retry */ @@ -67,12 +68,17 @@ #define OFF_HOOK 0000100 /* Off Hook (CD) */ #define CAUSE_PI 0000200 /* Cause PI */ -uint8 dcix_buf[DC10_LINES] = { 0 }; /* Input buffers */ -uint8 dcox_buf[DC10_LINES] = { 0 }; /* Output buffers */ -TMLN dc_ldsc[DC10_LINES] = { 0 }; /* Line descriptors */ -TMXR dc_desc = { DC10_LINES, 0, 0, dc_ldsc }; -uint32 tx_enable, rx_rdy; /* Flags */ -uint32 rx_conn; /* Connection flags */ +t_uint64 dc_l_status; /* Line status */ +int dc_l_count = 0; /* Scan counter */ +int dc_modem = DC10_MLINES; /* Modem base address */ +uint8 dcix_buf[DC10_MLINES] = { 0 }; /* Input buffers */ +uint8 dcox_buf[DC10_MLINES] = { 0 }; /* Output buffers */ +TMLN dc_ldsc[DC10_MLINES] = { 0 }; /* Line descriptors */ +TMXR dc_desc = { DC10_LINES, 0, 0, dc_ldsc }; +uint32 tx_enable, rx_rdy; /* Flags */ +uint32 dc_enable; /* Enable line */ +uint32 dc_ring; /* Connection pending */ +uint32 rx_conn; /* Connection flags */ extern int32 tmxr_poll; DEVICE dc_dev; @@ -80,6 +86,12 @@ t_stat dc_devio(uint32 dev, uint64 *data); t_stat dc_svc (UNIT *uptr); t_stat dc_doscan (UNIT *uptr); t_stat dc_reset (DEVICE *dptr); +t_stat dc_set_modem (UNIT *uptr, int32 val, CONST char *cptr, void *desc); +t_stat dc_show_modem (FILE *st, UNIT *uptr, int32 val, CONST void *desc); +t_stat dc_setnl (UNIT *uptr, int32 val, CONST char *cptr, void *desc); +t_stat dc_set_log (UNIT *uptr, int32 val, CONST char *cptr, void *desc); +t_stat dc_set_nolog (UNIT *uptr, int32 val, CONST char *cptr, void *desc); +t_stat dc_show_log (FILE *st, UNIT *uptr, int32 val, CONST void *desc); t_stat dc_attach (UNIT *uptr, CONST char *cptr); t_stat dc_detach (UNIT *uptr); t_stat dc_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, @@ -110,14 +122,24 @@ MTAB dc_mod[] = { { TT_MODE, TT_MODE_7B, "7b", "7B", NULL }, { TT_MODE, TT_MODE_8B, "8b", "8B", NULL }, { TT_MODE, TT_MODE_7P, "7p", "7P", NULL }, - { UNIT_ATT, UNIT_ATT, "summary", NULL, - NULL, &tmxr_show_summ, (void *) &dc_desc }, - { MTAB_XTD | MTAB_VDV, 1, NULL, "DISCONNECT", - &tmxr_dscln, NULL, (void *) &dc_desc }, - { MTAB_XTD | MTAB_VDV | MTAB_NMO, 1, "CONNECTIONS", NULL, - NULL, &tmxr_show_cstat, (void *) &dc_desc }, - { MTAB_XTD | MTAB_VDV | MTAB_NMO, 0, "STATISTICS", NULL, - NULL, &tmxr_show_cstat, (void *) &dc_desc }, + { MTAB_XTD|MTAB_VDV|MTAB_VALR, 1, NULL, "DISCONNECT", + &tmxr_dscln, NULL, &dc_desc, "Disconnect a specific line" }, + { UNIT_ATT, UNIT_ATT, "SUMMARY", NULL, + NULL, &tmxr_show_summ, (void *) &dc_desc, "Display a summary of line states" }, + { MTAB_XTD|MTAB_VDV|MTAB_NMO, 1, "CONNECTIONS", NULL, + NULL, &tmxr_show_cstat, (void *) &dc_desc, "Display current connections" }, + { MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "STATISTICS", NULL, + NULL, &tmxr_show_cstat, (void *) &dc_desc, "Display multiplexer statistics" }, + { MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "LINES", "LINES=n", + &dc_setnl, &tmxr_show_lines, (void *) &dc_desc, "Set number of lines" }, + { MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "MODEM", "MODEM=n", + &dc_set_modem, &dc_show_modem, (void *)&dc_modem, "Set modem offset" }, + { MTAB_XTD|MTAB_VDV|MTAB_NC, 0, NULL, "LOG=n=file", + &dc_set_log, NULL, (void *)&dc_desc }, + { MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, NULL, "NOLOG", + &dc_set_nolog, NULL, (void *)&dc_desc, "Disable logging on designated line" }, + { MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "LOG", NULL, + NULL, &dc_show_log, (void *)&dc_desc, "Display logging for all lines" }, { 0 } }; @@ -126,7 +148,7 @@ DEVICE dc_dev = { 1, 10, 31, 1, 8, 8, &tmxr_ex, &tmxr_dep, &dc_reset, NULL, &dc_attach, &dc_detach, - &dc_dib, DEV_NET | DEV_DISABLE, 0, NULL, + &dc_dib, DEV_NET | DEV_DISABLE | DEV_DEBUG, 0, dev_debug, NULL, NULL, &dc_help, NULL, NULL, &dc_description }; @@ -140,82 +162,133 @@ t_stat dc_devio(uint32 dev, uint64 *data) { switch(dev & 3) { case CONI: + /* Check if we might have any interrupts pending */ + if ((uptr->STATUS & (RCV_PI|XMT_PI)) == 0) + dc_doscan(uptr); *data = uptr->STATUS & (PI_CHN|RCV_PI|XMT_PI); + sim_debug(DEBUG_CONI, &dc_dev, "DC %03o CONI %06o PC=%o\n", + dev, (uint32)*data, PC); break; case CONO: - clr_interrupt(dev); /* Set PI */ uptr->STATUS &= ~PI_CHN; uptr->STATUS |= PI_CHN & *data; if (*data & RST_SCN) - uptr->STATUS &= ~ DTS_LINE; + dc_l_count = 0; if (*data & DTR_SET) uptr->STATUS |= DTR_SET; if (*data & CLR_SCN) { uptr->STATUS &= PI_CHN; + for (ln = 0; ln < dc_desc.lines; ln++) { + lp = &dc_ldsc[ln]; + if (lp->conn) { + tmxr_linemsg (lp, "\r\nLine Hangup\r\n"); + tmxr_reset_ln(lp); + } + } tx_enable = 0; + dc_enable = 0; rx_rdy = 0; /* Flags */ rx_conn = 0; + dc_ring = 0; + dc_l_status = 0; } - sim_activate (&dc_unit, dc_unit.wait); - if ((uptr->STATUS & (RCV_PI|XMT_PI)) == 0) { - set_interrupt(dev, uptr->STATUS & 7); - } + sim_debug(DEBUG_CONO, &dc_dev, "DC %03o CONO %06o PC=%06o\n", + dev, (uint32)*data, PC); + dc_doscan(uptr); break; case DATAO: if (*data & (LFLAG << 18)) ln = (*data >> 18) & 077; else - ln = (uptr->STATUS & DTS_LINE) >> 6; - if (ln >= DC10_LINES) { - lp = &dc_ldsc[ln - DC10_LINES]; + ln = dc_l_count; + if (ln >= dc_modem) { if (*data & CAUSE_PI) - rx_rdy |= (1 << ln); - if ((*data & OFF_HOOK) == 0 && lp->conn) { - tmxr_linemsg (lp, "\r\nLine Hangup\r\n"); - tmxr_reset_ln(lp); + dc_l_status |= (1LL << ln); + else + dc_l_status &= ~(1LL << ln); + ln -= dc_modem; + sim_debug(DEBUG_DETAIL, &dc_dev, "DC line modem %d %03o\n", + ln, (uint32)(*data & 0777)); + if ((*data & OFF_HOOK) == 0) { + uint32 mask = ~(1 << ln); + rx_rdy &= mask; + tx_enable &= mask; + dc_enable &= mask; + lp = &dc_ldsc[ln]; + if (rx_conn & (1 << ln) && lp->conn) { + sim_debug(DEBUG_DETAIL, &dc_dev, "DC line hangup %d\n", ln); + tmxr_linemsg (lp, "\r\nLine Hangup\r\n"); + tmxr_reset_ln(lp); + rx_conn &= mask; + } + } else { + sim_debug(DEBUG_DETAIL, &dc_dev, "DC line off-hook %d\n", ln); + dc_enable |= 1<conn) { + int32 ch = *data & DATA; + ch = sim_tt_outcvt(ch, TT_GET_MODE (dc_unit.flags) | TTUF_KSR); + tmxr_putc_ln (lp, ch); + tx_enable |= (1 << ln); + dc_l_status |= (1LL << ln); } } + dc_doscan(uptr); + sim_debug(DEBUG_DATAIO, &dc_dev, "DC %03o DATO %012llo PC=%06o\n", + dev, *data, PC); break; + case DATAI: - ln = (uptr->STATUS & DTS_LINE) >> 6; + ln = dc_l_count; *data = (uint64)(ln) << 18; - if (ln >= DC10_LINES) { - lp = &dc_ldsc[ln - DC10_LINES]; - if (lp->conn) - *data |= OFF_HOOK|CTS; - rx_rdy &= ~(1 << ln); - } else { + if (ln >= dc_modem) { + dc_l_status &= ~(1LL << ln); + ln = ln - dc_modem; + lp = &dc_ldsc[ln]; + if (dc_enable & (1 << ln)) + *data |= FLAG|OFF_HOOK; + if (rx_conn & (1 << ln) && lp->conn) + *data |= FLAG|CTS; + if (dc_ring & (1 << ln)) + *data |= FLAG|RES_DET; + } else if (ln < dc_desc.lines) { /* Nothing happens if no recieve data, which is transmit ready */ lp = &dc_ldsc[ln]; if (tmxr_rqln (lp) > 0) { int32 ch = tmxr_getc_ln (lp); if (ch & SCPE_BREAK) /* break? */ ch = 0; - else ch = sim_tt_inpcvt (ch, TTUF_MODE_7B | TTUF_KSR); + else + ch = sim_tt_inpcvt (ch, TT_GET_MODE(dc_unit.flags) | TTUF_KSR); *data |= FLAG | (uint64)(ch & DATA); } - rx_rdy &= ~(1 << ln); if (tmxr_rqln (lp) > 0) { rx_rdy |= 1 << ln; + dc_l_status |= (1LL << ln); + } else { + rx_rdy &= ~(1 << ln); + dc_l_status &= ~(1LL << ln); } } + dc_doscan(uptr); + sim_debug(DEBUG_DATAIO, &dc_dev, "DC %03o DATI %012llo PC=%06o\n", + dev, *data, PC); break; } - dc_doscan(uptr); return SCPE_OK; } @@ -232,67 +305,196 @@ int32 ln, c, temp; ln = tmxr_poll_conn (&dc_desc); /* look for connect */ if (ln >= 0) { /* got one? rcv enb*/ dc_ldsc[ln].rcve = 1; - rx_conn |= 1 << (ln + DC10_LINES); - rx_rdy |= 1 << (ln + DC10_LINES); + dc_ring |= (1 << ln); + dc_l_status |= (1LL << (ln + dc_modem)); /* Flag modem line */ + sim_debug(DEBUG_DETAIL, &dc_dev, "DC line connect %d\n", ln); } tmxr_poll_tx(&dc_desc); - dc_doscan(uptr); + tmxr_poll_rx(&dc_desc); + for (ln = 0; ln < dc_desc.lines; ln++) { + /* Check to see if any pending data for this line */ + if (tmxr_rqln(&dc_ldsc[ln]) > 0) { + rx_rdy |= (1 << ln); + dc_l_status |= (1LL << ln); /* Flag line */ + sim_debug(DEBUG_DETAIL, &dc_dev, "DC recieve %d\n", ln); + } + /* Check if disconnect */ + if ((rx_conn & (1 << ln)) != 0 && dc_ldsc[ln].conn == 0) { + rx_conn &= ~(1 << ln); + dc_l_status |= (1LL << (ln + dc_modem)); /* Flag modem line */ + sim_debug(DEBUG_DETAIL, &dc_dev, "DC line disconnect %d\n", ln); + } + } + + /* If any pending status request, raise the PI signal */ + if (dc_l_status) + set_interrupt(DC_DEVNUM, uptr->STATUS); return SCPE_OK; } /* Scan to see if something to do */ t_stat dc_doscan (UNIT *uptr) { - int cnt = 2 * DC10_LINES; - int32 ln; - int32 lmsk; - clr_interrupt(DC_DEVNUM); + int ln; + int32 lmask; + uptr->STATUS &= ~(RCV_PI|XMT_PI); - tmxr_poll_rx(&dc_desc); - ln = ((uptr->STATUS & DTS_LINE) >> 6) - 1; - while (cnt > 0 && (uptr->STATUS & (RCV_PI|XMT_PI)) == 0) { - cnt--; - ln = (ln + 1) & 037; /* Only 32 lines max */ - lmsk = 1 << ln; - if (ln >= DC10_LINES) { - /* Look for disconnect */ - if ((rx_conn & lmsk) != 0 && - dc_ldsc[ln - DC10_LINES].conn == 0) { - rx_rdy |= lmsk; - rx_conn &= ~lmsk; - } - } else { - if (tmxr_rqln(&dc_ldsc[ln]) > 0) - rx_rdy |= lmsk; - } - if (rx_rdy & lmsk) - uptr->STATUS |= RCV_PI; - if (tx_enable & lmsk) - uptr->STATUS |= XMT_PI; + clr_interrupt(DC_DEVNUM); + for (;dc_l_status != 0; dc_l_count++) { + dc_l_count &= 077; + /* Check if we found it */ + if (dc_l_status & (1LL << dc_l_count)) { + /* Check if modem control or data line */ + if (dc_l_count >= dc_modem) { + uptr->STATUS |= RCV_PI; + } else { + /* Must be data line */ + lmask = 1 << dc_l_count; + if (rx_rdy & lmask) + uptr->STATUS |= RCV_PI; + if (tx_enable & lmask) + uptr->STATUS |= XMT_PI; + } + /* Stop scanner */ + set_interrupt(DC_DEVNUM, uptr->STATUS); + return SCPE_OK; + } } - uptr->STATUS &= ~DTS_LINE; - uptr->STATUS |= ln << 6; - if (uptr->STATUS & (RCV_PI|XMT_PI)) - set_interrupt(DC_DEVNUM, uptr->STATUS & 07); + return SCPE_OK; } /* Reset routine */ t_stat dc_reset (DEVICE *dptr) { -int32 ln, itto; -if (dc_unit.flags & UNIT_ATT) /* if attached, */ - sim_activate (&dc_unit, tmxr_poll); /* activate */ -else sim_cancel (&dc_unit); /* else stop */ -tx_enable = 0; -rx_rdy = 0; /* Flags */ -rx_conn = 0; -dc_unit.STATUS = 0; -clr_interrupt(DC_DEVNUM); -return SCPE_OK; + if (dc_unit.flags & UNIT_ATT) /* if attached, */ + sim_activate (&dc_unit, tmxr_poll); /* activate */ + else + sim_cancel (&dc_unit); /* else stop */ + tx_enable = 0; + rx_rdy = 0; /* Flags */ + rx_conn = 0; + dc_l_status = 0; + dc_l_count = 0; + dc_unit.STATUS = 0; + clr_interrupt(DC_DEVNUM); + return SCPE_OK; } +/* SET BUFFER processor */ + +t_stat dc_set_modem (UNIT *uptr, int32 val, CONST char *cptr, void *desc) +{ + t_stat r; + int32 modem; + + if (cptr == NULL) + return SCPE_ARG; + modem = (int32) get_uint (cptr, 10, 32, &r); + if (r != SCPE_OK) + return SCPE_ARG; + if (modem < 0 || modem >= (DC10_MLINES * 2)) + return SCPE_ARG; + if (modem < dc_desc.lines) + return SCPE_ARG; + if ((modem % 8) == 0) { + dc_modem = modem; + return SCPE_OK; + } + return SCPE_ARG; +} + +/* SHOW BUFFER processor */ + +t_stat dc_show_modem (FILE *st, UNIT *uptr, int32 val, CONST void *desc) +{ + fprintf (st, "modem=%d ", dc_modem); + return SCPE_OK; +} + +/* SET LINES processor */ + +t_stat dc_setnl (UNIT *uptr, int32 val, CONST char *cptr, void *desc) +{ + int32 newln, i, t; + t_stat r; + + if (cptr == NULL) + return SCPE_ARG; + newln = (int32) get_uint (cptr, 10, DC10_MLINES, &r); + if ((r != SCPE_OK) || (newln == dc_desc.lines)) + return r; + if (newln > dc_modem) + return SCPE_ARG; + if ((newln == 0) || (newln > DC10_MLINES) || (newln % 8) != 0) + return SCPE_ARG; + if (newln < dc_desc.lines) { + for (i = newln, t = 0; i < dc_desc.lines; i++) + t = t | dc_ldsc[i].conn; + if (t && !get_yn ("This will disconnect users; proceed [N]?", FALSE)) + return SCPE_OK; + for (i = newln; i < dc_desc.lines; i++) { + if (dc_ldsc[i].conn) { + tmxr_linemsg (&dc_ldsc[i], "\r\nOperator disconnected line\r\n"); + tmxr_send_buffered_data (&dc_ldsc[i]); + } + tmxr_detach_ln (&dc_ldsc[i]); /* completely reset line */ + } + } + if (dc_desc.lines < newln) + memset (dc_ldsc + dc_desc.lines, 0, sizeof(*dc_ldsc)*(newln-dc_desc.lines)); + dc_desc.lines = newln; + return dc_reset (&dc_dev); /* setup lines and auto config */ +} + +/* SET LOG processor */ + +t_stat dc_set_log (UNIT *uptr, int32 val, CONST char *cptr, void *desc) +{ + t_stat r; + char gbuf[CBUFSIZE]; + int32 ln; + + if (cptr == NULL) + return SCPE_ARG; + cptr = get_glyph (cptr, gbuf, '='); + if ((cptr == NULL) || (*cptr == 0) || (gbuf[0] == 0)) + return SCPE_ARG; + ln = (int32) get_uint (gbuf, 10, dc_desc.lines, &r); + if ((r != SCPE_OK) || (ln >= dc_desc.lines)) + return SCPE_ARG; + return tmxr_set_log (NULL, ln, cptr, desc); +} + +/* SET NOLOG processor */ + +t_stat dc_set_nolog (UNIT *uptr, int32 val, CONST char *cptr, void *desc) +{ + t_stat r; + int32 ln; + + if (cptr == NULL) + return SCPE_ARG; + ln = (int32) get_uint (cptr, 10, dc_desc.lines, &r); + if ((r != SCPE_OK) || (ln >= dc_desc.lines)) + return SCPE_ARG; + return tmxr_set_nolog (NULL, ln, NULL, desc); +} + +/* SHOW LOG processor */ + +t_stat dc_show_log (FILE *st, UNIT *uptr, int32 val, CONST void *desc) +{ + int32 i; + + for (i = 0; i < dc_desc.lines; i++) { + fprintf (st, "line %d: ", i); + tmxr_show_log (st, NULL, i, desc); + fprintf (st, "\n"); + } + return SCPE_OK; +} /* Attach routine */ @@ -315,7 +517,7 @@ t_stat dc_detach (UNIT *uptr) int32 i; t_stat reason; reason = tmxr_detach (&dc_desc, uptr); -for (i = 0; i < DC10_LINES; i++) +for (i = 0; i < dc_desc.lines; i++) dc_ldsc[i].rcve = 0; sim_cancel (uptr); return reason; @@ -323,14 +525,15 @@ return reason; t_stat dc_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) { -fprintf (st, "DC10 Additional Terminal Interfaces\n\n"); -fprintf (st, "For very early system programs, the PDP-11 simulator supports up to sixteen\n"); -fprintf (st, "additional DC11 terminal interfaces. The additional terminals consist of two\n"); -fprintf (st, "independent devices, DCI and DCO. The entire set is modeled as a terminal\n"); -fprintf (st, "multiplexer, with DCI as the master controller. The additional terminals\n"); -fprintf (st, "perform input and output through Telnet sessions connected to a user-specified\n"); -fprintf (st, "port. The number of lines is specified with a SET command:\n\n"); -fprintf (st, " sim> SET DCI LINES=n set number of additional lines to n [1-16]\n\n"); +fprintf (st, "DC10E Terminal Interfaces\n\n"); +fprintf (st, "The DC10 supported up to 8 blocks of 8 lines. Modem control was on a seperate\n"); +fprintf (st, "line. The simulator supports this by setting modem control to a fixed offset\n"); +fprintf (st, "from the given line. The number of lines is specified with a SET command:\n\n"); +fprintf (st, " sim> SET DC LINES=n set number of additional lines to n [8-32]\n\n"); +fprintf (st, "Lines must be set in multiples of 8.\n"); +fprintf (st, "The default offset for modem lines is 32. This can be changed with\n\n"); +fprintf (st, " sim> SET DC MODEM=n set offset for modem control to n [8-32]\n\n"); +fprintf (st, "Modem control must be set larger then the number of lines\n"); fprintf (st, "The ATTACH command specifies the port to be used:\n\n"); tmxr_attach_help (st, dptr, uptr, flag, cptr); fprintf (st, "The additional terminals can be set to one of four modes: UC, 7P, 7B, or 8B.\n\n"); @@ -342,30 +545,29 @@ fprintf (st, " 7P high-order bit cleared high-order bit cleared,\n"); fprintf (st, " non-printing characters suppressed\n"); fprintf (st, " 7B high-order bit cleared high-order bit cleared\n"); fprintf (st, " 8B no changes no changes\n\n"); -fprintf (st, "The default mode is 7P. In addition, each line can be configured to\n"); -fprintf (st, "behave as though it was attached to a dataset, or hardwired to a terminal:\n\n"); -fprintf (st, "Finally, each line supports output logging. The SET DCOn LOG command enables\n"); +fprintf (st, "The default mode is 7P.\n"); +fprintf (st, "Finally, each line supports output logging. The SET DCn LOG command enables\n"); fprintf (st, "logging on a line:\n\n"); -fprintf (st, " sim> SET DCOn LOG=filename log output of line n to filename\n\n"); -fprintf (st, "The SET DCOn NOLOG command disables logging and closes the open log file,\n"); +fprintf (st, " sim> SET DCn LOG=filename log output of line n to filename\n\n"); +fprintf (st, "The SET DCn NOLOG command disables logging and closes the open log file,\n"); fprintf (st, "if any.\n\n"); -fprintf (st, "Once DCI is attached and the simulator is running, the terminals listen for\n"); +fprintf (st, "Once DC is attached and the simulator is running, the terminals listen for\n"); fprintf (st, "connections on the specified port. They assume that the incoming connections\n"); fprintf (st, "are Telnet connections. The connections remain open until disconnected either\n"); -fprintf (st, "by the Telnet client, a SET DCI DISCONNECT command, or a DETACH DCI command.\n\n"); +fprintf (st, "by the Telnet client, a SET DC DISCONNECT command, or a DETACH DC command.\n\n"); fprintf (st, "Other special commands:\n\n"); -fprintf (st, " sim> SHOW DCI CONNECTIONS show current connections\n"); -fprintf (st, " sim> SHOW DCI STATISTICS show statistics for active connections\n"); -fprintf (st, " sim> SET DCOn DISCONNECT disconnects the specified line.\n"); +fprintf (st, " sim> SHOW DC CONNECTIONS show current connections\n"); +fprintf (st, " sim> SHOW DC STATISTICS show statistics for active connections\n"); +fprintf (st, " sim> SET DCn DISCONNECT disconnects the specified line.\n"); fprint_reg_help (st, &dc_dev); fprintf (st, "\nThe additional terminals do not support save and restore. All open connections\n"); -fprintf (st, "are lost when the simulator shuts down or DCI is detached.\n"); +fprintf (st, "are lost when the simulator shuts down or DC is detached.\n"); return SCPE_OK; } const char *dc_description (DEVICE *dptr) { -return "DC10 asynchronous line interface"; +return "DC10E asynchronous line interface"; } #endif diff --git a/PDP10/ka10_df.c b/PDP10/ka10_df.c index b7da805..0008781 100644 --- a/PDP10/ka10_df.c +++ b/PDP10/ka10_df.c @@ -25,7 +25,7 @@ void df10_setirq(struct df10 *df) { df->status |= PI_ENABLE; - set_interrupt(df->devnum, df->status & API_MASK); + set_interrupt(df->devnum, df->status); // fprintf(stderr, "df irq %06o %03o\n\r", df->status, df->devnum); } diff --git a/PDP10/ka10_dk.c b/PDP10/ka10_dk.c index 5f982c4..ba97280 100644 --- a/PDP10/ka10_dk.c +++ b/PDP10/ka10_dk.c @@ -73,7 +73,7 @@ extern UNIT cpu_unit; DEVICE dk_dev; t_stat dk_devio(uint32 dev, uint64 *data); -void tim_incr_base (d10 *base, d10 incr); +void tim_incr_base (uint64 *base, uint64 incr); /* TIM data structures @@ -211,10 +211,6 @@ t_stat dk_svc (UNIT *uptr) if (Q_ITS) { /* ITS? */ if (pi_act == 0) quant = (quant + TIM_ITS_QUANT) & DMASK; - if (TSTS (pcst)) { /* PC sampling? */ - WriteP ((a10) pcst & AMASK, pager_PC); /* store sample */ - pcst = AOB (pcst); /* add 1,,1 */ - } } /* end ITS */ else if (t20_idlelock && PROB (100 - tim_t20_prob)) t20_idlelock = 0; diff --git a/PDP10/ka10_dp.c b/PDP10/ka10_dp.c index c79f046..0ab963d 100644 --- a/PDP10/ka10_dp.c +++ b/PDP10/ka10_dp.c @@ -1,6 +1,6 @@ /* ka10_dp.c: Dec Data Products Disk Drive. - Copyright (c) 2013, Richard Cornwell + Copyright (c) 2013-2016, Richard Cornwell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + RICHARD CORNWELL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -607,7 +607,7 @@ t_stat dp_svc (UNIT *uptr) if (cmd == WR) { int da = ((cyl * dp_drv_tab[dtype].surf + surf) * dp_drv_tab[dtype].sect + sect) * RP_NUMWD; - /* write block the block */ + /* write block the block */ for (; uptr->DATAPTR < RP_NUMWD; uptr->DATAPTR++) dp_buf[ctlr][uptr->DATAPTR] = 0; sim_fseek(uptr->fileref, da * sizeof(uint64), SEEK_SET); @@ -746,39 +746,39 @@ dp_boot(int32 unit_num, DEVICE * dptr) t_stat dp_attach (UNIT *uptr, CONST char *cptr) { -int32 drv, i, p; -t_stat r; -DEVICE *dptr; -DIB *dib; -int ctlr; + int32 drv, i, p; + t_stat r; + DEVICE *dptr; + DIB *dib; + int ctlr; -uptr->capac = dp_drv_tab[GET_DTYPE (uptr->flags)].size; -r = attach_unit (uptr, cptr); -if (r != SCPE_OK) - return r; -dptr = find_dev_from_unit(uptr); -if (dptr == 0) + uptr->capac = dp_drv_tab[GET_DTYPE (uptr->flags)].size; + r = attach_unit (uptr, cptr); + if (r != SCPE_OK) + return r; + dptr = find_dev_from_unit(uptr); + if (dptr == 0) + return SCPE_OK; + dib = (DIB *) dptr->ctxt; + ctlr = dib->dev_num & 014; + uptr->CUR_CYL = 0; + uptr->UFLAGS = (NO << 3) | SEEK_DONE | (ctlr >> 2); + dp_df10[ctlr].status |= PI_ENABLE; + set_interrupt(DP_DEVNUM + (ctlr), dp_df10[ctlr >> 2].status); return SCPE_OK; -dib = (DIB *) dptr->ctxt; -ctlr = dib->dev_num & 014; -uptr->CUR_CYL = 0; -uptr->UFLAGS = (NO << 3) | SEEK_DONE | (ctlr >> 2); -dp_df10[ctlr].status |= PI_ENABLE; -set_interrupt(DP_DEVNUM + (ctlr), dp_df10[ctlr >> 2].status & 7); -return SCPE_OK; } /* Device detach */ t_stat dp_detach (UNIT *uptr) { -int32 drv; + int32 drv; -if (!(uptr->flags & UNIT_ATT)) /* attached? */ - return SCPE_OK; -if (sim_is_active (uptr)) /* unit active? */ - sim_cancel (uptr); /* cancel operation */ -return detach_unit (uptr); + if (!(uptr->flags & UNIT_ATT)) /* attached? */ + return SCPE_OK; + if (sim_is_active (uptr)) /* unit active? */ + sim_cancel (uptr); /* cancel operation */ + return detach_unit (uptr); } t_stat dp_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) diff --git a/PDP10/ka10_lp.c b/PDP10/ka10_lp.c index 6ef95d4..7185036 100644 --- a/PDP10/ka10_lp.c +++ b/PDP10/ka10_lp.c @@ -1,6 +1,6 @@ /* ka10_lp.c: PDP-10 line printer simulator - Copyright (c) 1993-2011, Richard Cornwell + Copyright (c) 2011-2016, Richard Cornwell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -23,12 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Richard Cornwell. - lpt LP8E line printer - - 19-Jan-07 RMS Added UNIT_TEXT - 25-Apr-03 RMS Revised for extended file support - 04-Oct-02 RMS Added DIB, enable/disable, device number support - 30-May-02 RMS Widened POS to 32b */ #include "ka10_defs.h" @@ -55,16 +49,16 @@ -DEVICE lpt_dev; -t_stat lpt_devio(uint32 dev, uint64 *data); -t_stat lpt_svc (UNIT *uptr); -t_stat lpt_reset (DEVICE *dptr); -t_stat lpt_attach (UNIT *uptr, CONST char *cptr); -t_stat lpt_detach (UNIT *uptr); -t_stat lpt_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, - const char *cptr); -const char *lpt_description (DEVICE *dptr); -int32 lpt_stopioe; +DEVICE lpt_dev; +t_stat lpt_devio(uint32 dev, uint64 *data); +t_stat lpt_svc (UNIT *uptr); +t_stat lpt_reset (DEVICE *dptr); +t_stat lpt_attach (UNIT *uptr, CONST char *cptr); +t_stat lpt_detach (UNIT *uptr); +t_stat lpt_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, + const char *cptr); +const char *lpt_description (DEVICE *dptr); +int32 lpt_stopioe; /* LPT data structures @@ -84,20 +78,20 @@ REG lpt_reg[] = { { DRDATA (TIME, lpt_unit.wait, 24), PV_LEFT }, { FLDATA (STOP_IOE, lpt_stopioe, 0) }, { NULL } - }; +}; MTAB lpt_mod[] = { { 0 } - }; +}; DEVICE lpt_dev = { "LPT", &lpt_unit, lpt_reg, lpt_mod, 1, 10, 31, 1, 8, 8, NULL, NULL, &lpt_reset, NULL, &lpt_attach, &lpt_detach, - &lpt_dib, DEV_DISABLE, 0, NULL, + &lpt_dib, DEV_DISABLE | DEV_DEBUG, 0, dev_debug, NULL, NULL, &lpt_help, NULL, NULL, &lpt_description - }; +}; /* IOT routine */ @@ -108,12 +102,13 @@ t_stat lpt_devio(uint32 dev, uint64 *data) { *data = uptr->STATUS; if ((uptr->flags & UNIT_ATT) == 0) *data |= ERR_FLG; + sim_debug(DEBUG_CONI, &lpt_dev, "LP CONI %012llo\n", *data); break; case CONO: clr_interrupt(dev); clr_interrupt(0774); - // fprintf(stderr, "LP CONO %012llo\n\r", *data); + sim_debug(DEBUG_CONO, &lpt_dev, "LP CONO %012llo\n", *data); uptr->STATUS = C128 | ((PI_DONE|PI_ERROR|DONE_FLG|BUSY_FLG) & *data); if (*data & CLR_LPT) { uptr->CHR = 0; @@ -123,10 +118,10 @@ t_stat lpt_devio(uint32 dev, uint64 *data) { } if ((uptr->flags & UNIT_ATT) == 0) { uptr->STATUS |= ERR_FLG; - set_interrupt(0774, (uptr->STATUS >> 3) & 7); + set_interrupt(0774, (uptr->STATUS >> 3)); } if (uptr->STATUS & DONE_FLG) - set_interrupt(LP_DEVNUM, uptr->STATUS & 7); + set_interrupt(LP_DEVNUM, uptr->STATUS); break; case DATAO: @@ -137,7 +132,8 @@ t_stat lpt_devio(uint32 dev, uint64 *data) { uptr->STATUS &= ~DONE_FLG; clr_interrupt(dev); sim_activate (&lpt_unit, lpt_unit.wait); - // fprintf(stderr, "LP DATO %012llo, %06o %06o\n\r", *data, uptr->CHL, uptr->CHR); + sim_debug(DEBUG_DATAIO, &lpt_dev, "LP DATO %012llo, %06o %06o\n", + *data, uptr->CHL, uptr->CHR); } break; case DATAI: @@ -158,7 +154,7 @@ t_stat lpt_output(UNIT *uptr, char c) { perror ("LPT I/O error"); clearerr (uptr->fileref); uptr->STATUS |= ERR_FLG; - set_interrupt(0774, (uptr->STATUS >> 3) & 7); + set_interrupt(0774, (uptr->STATUS >> 3)); return SCPE_IOERR; } return SCPE_OK; @@ -166,68 +162,68 @@ t_stat lpt_output(UNIT *uptr, char c) { t_stat lpt_svc (UNIT *uptr) { -t_stat r; -char c; -if ((uptr->flags & UNIT_ATT) == 0) { - uptr->STATUS |= ERR_FLG; - return IORETURN (lpt_stopioe, SCPE_UNATT); - } - -c = (uptr->CHL >> 14) & 0177; -if ((r = lpt_output(uptr, c)) != SCPE_OK) - return r; -c = (uptr->CHL >> 7) & 0177; -if ((r = lpt_output(uptr, c)) != SCPE_OK) - return r; -c = uptr->CHL & 0177; -if ((r = lpt_output(uptr, c)) != SCPE_OK) - return r; -c = (uptr->CHR >> 7) & 0177; -if ((r = lpt_output(uptr, c)) != SCPE_OK) - return r; -c = uptr->CHR & 0177; -if ((r = lpt_output(uptr, c)) != SCPE_OK) - return r; -uptr->STATUS &= ~BUSY_FLG; -uptr->STATUS |= DONE_FLG; -set_interrupt(LP_DEVNUM, uptr->STATUS & 7); -//fprintf(stderr, "LP IRQ\n\r"); -return SCPE_OK; + t_stat r; + char c; + if ((uptr->flags & UNIT_ATT) == 0) { + uptr->STATUS |= ERR_FLG; + return IORETURN (lpt_stopioe, SCPE_UNATT); + } + + c = (uptr->CHL >> 14) & 0177; + if ((r = lpt_output(uptr, c)) != SCPE_OK) + return r; + c = (uptr->CHL >> 7) & 0177; + if ((r = lpt_output(uptr, c)) != SCPE_OK) + return r; + c = uptr->CHL & 0177; + if ((r = lpt_output(uptr, c)) != SCPE_OK) + return r; + c = (uptr->CHR >> 7) & 0177; + if ((r = lpt_output(uptr, c)) != SCPE_OK) + return r; + c = uptr->CHR & 0177; + if ((r = lpt_output(uptr, c)) != SCPE_OK) + return r; + uptr->STATUS &= ~BUSY_FLG; + uptr->STATUS |= DONE_FLG; + set_interrupt(LP_DEVNUM, uptr->STATUS); + //fprintf(stderr, "LP IRQ\n\r"); + return SCPE_OK; } /* Reset routine */ t_stat lpt_reset (DEVICE *dptr) { -UNIT *uptr = &lpt_unit; -uptr->CHR = 0; -uptr->CHL = 0; -uptr->STATUS = 0; -clr_interrupt(LP_DEVNUM); -clr_interrupt(0774); -sim_cancel (&lpt_unit); /* deactivate unit */ -return SCPE_OK; + UNIT *uptr = &lpt_unit; + uptr->CHR = 0; + uptr->CHL = 0; + uptr->STATUS = 0; + clr_interrupt(LP_DEVNUM); + clr_interrupt(0774); + sim_cancel (&lpt_unit); /* deactivate unit */ + return SCPE_OK; } /* Attach routine */ t_stat lpt_attach (UNIT *uptr, CONST char *cptr) { -t_stat reason; + t_stat reason; -reason = attach_unit (uptr, cptr); -uptr->STATUS &= ~ERR_FLG; -clr_interrupt(0774); -return reason; + reason = attach_unit (uptr, cptr); + uptr->STATUS &= ~ERR_FLG; + clr_interrupt(0774); + return reason; } /* Detach routine */ t_stat lpt_detach (UNIT *uptr) { -uptr->STATUS |= ERR_FLG; -set_interrupt(0774, (uptr->STATUS >> 3) & 7); -return detach_unit (uptr); + uptr->STATUS |= ERR_FLG; + set_interrupt(0774, (uptr->STATUS >> 3) & 7); + return detach_unit (uptr); } t_stat lpt_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) @@ -244,7 +240,7 @@ return SCPE_OK; const char *lpt_description (DEVICE *dptr) { -return "LP10 line printer" ; + return "LP10 line printer" ; } #endif diff --git a/PDP10/ka10_pt.c b/PDP10/ka10_pt.c index c6e33f0..a7ee444 100644 --- a/PDP10/ka10_pt.c +++ b/PDP10/ka10_pt.c @@ -1,6 +1,6 @@ /* ka10_pt.c: PDP-10 reader/punch simulator - Copyright (c) 1993-2011, Richard Cornwell + Copyright (c) 2011-2016, Richard Cornwell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -22,13 +22,6 @@ Except as contained in this notice, the name of Richard Cornwell shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Richard Cornwell. - - lpt LP8E line printer - - 19-Jan-07 RMS Added UNIT_TEXT - 25-Apr-03 RMS Revised for extended file support - 04-Oct-02 RMS Added DIB, enable/disable, device number support - 30-May-02 RMS Widened POS to 32b */ #include "ka10_defs.h" @@ -53,24 +46,26 @@ #define TAPE_PR 000400 -DEVICE ptp_dev; -t_stat ptp_devio(uint32 dev, uint64 *data); -t_stat ptp_svc (UNIT *uptr); -t_stat ptp_reset (DEVICE *dptr); -t_stat ptp_attach (UNIT *uptr, CONST char *cptr); -t_stat ptp_detach (UNIT *uptr); -t_stat ptp_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr); -const char *ptp_description (DEVICE *dptr); -int32 ptp_stopioe = 0; - -DEVICE ptr_dev; -t_stat ptr_devio(uint32 dev, uint64 *data); -t_stat ptr_svc (UNIT *uptr); -t_stat ptr_reset (DEVICE *dptr); -t_stat ptr_attach (UNIT *uptr, CONST char *cptr); -t_stat ptr_detach (UNIT *uptr); -t_stat ptr_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr); -const char *ptr_description (DEVICE *dptr); +DEVICE ptp_dev; +t_stat ptp_devio(uint32 dev, uint64 *data); +t_stat ptp_svc (UNIT *uptr); +t_stat ptp_reset (DEVICE *dptr); +t_stat ptp_attach (UNIT *uptr, CONST char *cptr); +t_stat ptp_detach (UNIT *uptr); +t_stat ptp_help (FILE *st, DEVICE *dptr, UNIT *uptr, + int32 flag, const char *cptr); +const char *ptp_description (DEVICE *dptr); +int32 ptp_stopioe = 0; + +DEVICE ptr_dev; +t_stat ptr_devio(uint32 dev, uint64 *data); +t_stat ptr_svc (UNIT *uptr); +t_stat ptr_reset (DEVICE *dptr); +t_stat ptr_attach (UNIT *uptr, CONST char *cptr); +t_stat ptr_detach (UNIT *uptr); +t_stat ptr_help (FILE *st, DEVICE *dptr, UNIT *uptr, + int32 flag, const char *cptr); +const char *ptr_description (DEVICE *dptr); int32 ptr_stopioe = 0; @@ -145,7 +140,7 @@ t_stat ptp_devio(uint32 dev, uint64 *data) { sim_activate (&ptp_unit, ptp_unit.wait); } if (uptr->STATUS & DONE_FLG) - set_interrupt(dev, uptr->STATUS & 7); + set_interrupt(dev, uptr->STATUS); break; case DATAO: @@ -196,32 +191,32 @@ t_stat ptp_svc (UNIT *uptr) t_stat ptp_reset (DEVICE *dptr) { -UNIT *uptr = &ptp_unit; -uptr->CHR = 0; -uptr->CHL = 0; -uptr->STATUS = 0; -clr_interrupt(PP_DEVNUM); -sim_cancel (&ptp_unit); /* deactivate unit */ -return SCPE_OK; + UNIT *uptr = &ptp_unit; + uptr->CHR = 0; + uptr->CHL = 0; + uptr->STATUS = 0; + clr_interrupt(PP_DEVNUM); + sim_cancel (&ptp_unit); /* deactivate unit */ + return SCPE_OK; } /* Attach routine */ t_stat ptp_attach (UNIT *uptr, CONST char *cptr) { -t_stat reason; + t_stat reason; -reason = attach_unit (uptr, cptr); -uptr->STATUS &= ~NO_TAPE_PP; -return reason; + reason = attach_unit (uptr, cptr); + uptr->STATUS &= ~NO_TAPE_PP; + return reason; } /* Detach routine */ t_stat ptp_detach (UNIT *uptr) { -uptr->STATUS |= NO_TAPE_PP; -return detach_unit (uptr); + uptr->STATUS |= NO_TAPE_PP; + return detach_unit (uptr); } @@ -245,7 +240,7 @@ t_stat ptr_devio(uint32 dev, uint64 *data) { sim_activate (&ptr_unit, ptr_unit.wait); } if (uptr->STATUS & DONE_FLG) - set_interrupt(dev, uptr->STATUS & 7); + set_interrupt(dev, uptr->STATUS); break; case DATAI: @@ -268,13 +263,13 @@ t_stat ptr_devio(uint32 dev, uint64 *data) { /* Unit service */ t_stat ptr_svc (UNIT *uptr) { -int32 temp; -uint64 word; -int count = (uptr->STATUS & BIN_FLG) ? 6 : 1; + int32 temp; + uint64 word; + int count = (uptr->STATUS & BIN_FLG) ? 6 : 1; uptr->STATUS &= ~BUSY_FLG; uptr->STATUS |= DONE_FLG; - set_interrupt(PR_DEVNUM, uptr->STATUS & 7); + set_interrupt(PR_DEVNUM, uptr->STATUS); if ((ptr_unit.flags & UNIT_ATT) == 0) /* attached? */ return IORETURN (ptr_stopioe, SCPE_UNATT); @@ -307,32 +302,32 @@ int count = (uptr->STATUS & BIN_FLG) ? 6 : 1; t_stat ptr_reset (DEVICE *dptr) { -UNIT *uptr = &ptr_unit; -uptr->CHR = 0; -uptr->CHL = 0; -uptr->STATUS = 0; -clr_interrupt(PR_DEVNUM); -sim_cancel (&ptr_unit); /* deactivate unit */ -return SCPE_OK; + UNIT *uptr = &ptr_unit; + uptr->CHR = 0; + uptr->CHL = 0; + uptr->STATUS = 0; + clr_interrupt(PR_DEVNUM); + sim_cancel (&ptr_unit); /* deactivate unit */ + return SCPE_OK; } /* Attach routine */ t_stat ptr_attach (UNIT *uptr, CONST char *cptr) { -t_stat reason; + t_stat reason; -reason = attach_unit (uptr, cptr); -uptr->STATUS |= TAPE_PR; -return reason; + reason = attach_unit (uptr, cptr); + uptr->STATUS |= TAPE_PR; + return reason; } /* Detach routine */ t_stat ptr_detach (UNIT *uptr) { -uptr->STATUS &= ~TAPE_PR; -return detach_unit (uptr); + uptr->STATUS &= ~TAPE_PR; + return detach_unit (uptr); } t_stat ptr_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) diff --git a/PDP10/ka10_rp.c b/PDP10/ka10_rp.c index d625def..9948be0 100644 --- a/PDP10/ka10_rp.c +++ b/PDP10/ka10_rp.c @@ -459,6 +459,7 @@ t_stat rp_devio(uint32 dev, uint64 *data) { struct df10 *df10; UNIT *uptr; int tmp; + int drive; for (drive = 0; drive < NUM_DEVS_RP; drive++) { if (rp_dib[drive].dev_num == (dev & 0774)) { @@ -1030,7 +1031,7 @@ t_stat rp_attach (UNIT *uptr, CONST char *cptr) if (uptr->flags & UNIT_WLK) uptr->u3 |= DS_WRL; rp_df10[ctlr].status |= PI_ENABLE; - set_interrupt(dib->dev_num, rp_df10[ctlr].status & 7); + set_interrupt(dib->dev_num, rp_df10[ctlr].status); return SCPE_OK; }