diff --git a/PDP1/pdp1_defs.h b/PDP1/pdp1_defs.h index 8b8d6653..19e72e23 100644 --- a/PDP1/pdp1_defs.h +++ b/PDP1/pdp1_defs.h @@ -132,7 +132,9 @@ #define IOT_SKP (1 << IOT_V_SKP) #define IOT_V_REASON (IOT_V_SKP + 1) /* reason */ #define IOT_REASON (1 << IOT_V_REASON) -#define IORETURN(f,v) ((f)? (v): SCPE_OK) /* stop on error */ +#define IORETURN(f,v) ((f)? (v): /* stop on error */ \ + (((v) != STOP_DTOFF) ? SCPE_OK : \ + sim_messagef ((v), "*** DECtape has gone off reel - listen for the flapping tape\r\n"), SCPE_OK)) /* stop on error */ /* I/O status flags */ diff --git a/PDP1/pdp1_dt.c b/PDP1/pdp1_dt.c index 29bbee99..d71440f2 100644 --- a/PDP1/pdp1_dt.c +++ b/PDP1/pdp1_dt.c @@ -680,7 +680,7 @@ if (mot & DTS_DIR) /* update pos */ else uptr->pos = uptr->pos + delta; if (((int32) uptr->pos < 0) || ((int32) uptr->pos > (DTU_FWDEZ (uptr) + DT_EZLIN))) { - detach_unit (uptr); /* off reel? */ + dt_detach (uptr); /* off reel? */ uptr->STATE = uptr->pos = 0; unum = (int32) (uptr - dt_dev.units); if (unum == DTA_GETUNIT (dtsa)) /* if selected, */ @@ -755,7 +755,7 @@ switch (fnc) { /* at speed, check fnc * return SCPE_OK; case DTS_OFR: /* off reel */ - detach_unit (uptr); /* must be deselected */ + dt_detach (uptr); /* must be deselected */ uptr->STATE = uptr->pos = 0; /* no visible action */ break; diff --git a/PDP11/pdp11_defs.h b/PDP11/pdp11_defs.h index 11bb6f66..cf9070f9 100644 --- a/PDP11/pdp11_defs.h +++ b/PDP11/pdp11_defs.h @@ -479,7 +479,9 @@ typedef struct { #define STOP_RQ (TRAP_V_MAX + 6) /* RQDX3 panic */ #define STOP_SANITY (TRAP_V_MAX + 7) /* sanity timer exp */ #define STOP_DTOFF (TRAP_V_MAX + 8) /* DECtape off reel */ -#define IORETURN(f,v) ((f)? (v): SCPE_OK) /* cond error return */ +#define IORETURN(f,v) ((f)? (v): /* stop on error */ \ + (((v) != STOP_DTOFF) ? SCPE_OK : \ + sim_messagef ((v), "*** DECtape has gone off reel - listen for the flapping tape\r\n"), SCPE_OK)) /* stop on error */ /* Timers */ diff --git a/PDP11/pdp11_tc.c b/PDP11/pdp11_tc.c index 1524e07a..51df9864 100644 --- a/PDP11/pdp11_tc.c +++ b/PDP11/pdp11_tc.c @@ -826,7 +826,7 @@ if (mot & DTS_DIR) /* update pos */ else uptr->pos = uptr->pos + delta; if (((int32) uptr->pos < 0) || ((int32) uptr->pos > (DTU_FWDEZ (uptr) + DT_EZLIN))) { - detach_unit (uptr); /* off reel? */ + dt_detach (uptr); /* off reel? */ uptr->STATE = 0, uptr->pos = 0; unum = (int32) (uptr - dt_dev.units); if ((unum == CSR_GETUNIT (tccm)) && (CSR_GETFNC (tccm) != FNC_STOP)) @@ -911,7 +911,7 @@ switch (fnc) { /* at speed, check fnc * break; case DTS_OFR: /* off reel */ - detach_unit (uptr); /* must be deselected */ + dt_detach (uptr); /* must be deselected */ uptr->STATE = 0, uptr->pos = 0; /* no visible action */ break; diff --git a/PDP18B/pdp18b_defs.h b/PDP18B/pdp18b_defs.h index 1122860b..bcc7d90a 100644 --- a/PDP18B/pdp18b_defs.h +++ b/PDP18B/pdp18b_defs.h @@ -234,7 +234,9 @@ #define IOT_SKP (1 << IOT_V_SKP) #define IOT_REASON (1 << IOT_V_REASON) -#define IORETURN(f,v) ((f)? (v): SCPE_OK) /* stop on error */ +#define IORETURN(f,v) ((f)? (v): /* stop on error */ \ + (((v) != STOP_DTOFF) ? SCPE_OK : \ + sim_messagef ((v), "*** DECtape has gone off reel - listen for the flapping tape\r\n"), SCPE_OK)) /* stop on error */ /* PC change queue */ diff --git a/PDP18B/pdp18b_dt.c b/PDP18B/pdp18b_dt.c index 27f6d264..5426314a 100644 --- a/PDP18B/pdp18b_dt.c +++ b/PDP18B/pdp18b_dt.c @@ -869,7 +869,7 @@ if (mot & DTS_DIR) /* update pos */ else uptr->pos = uptr->pos + delta; if (((int32) uptr->pos < 0) || ((int32) uptr->pos > (DTU_FWDEZ (uptr) + DT_EZLIN))) { - detach_unit (uptr); /* off reel? */ + dt_detach (uptr); /* off reel? */ uptr->STATE = uptr->pos = 0; unum = (int32) (uptr - dt_dev.units); if (unum == DTA_GETUNIT (dtsa)) /* if selected, */ @@ -945,7 +945,7 @@ switch (fnc) { /* at speed, check fnc * return SCPE_OK; case DTS_OFR: /* off reel */ - detach_unit (uptr); /* must be deselected */ + dt_detach (uptr); /* must be deselected */ uptr->STATE = uptr->pos = 0; /* no visible action */ break; diff --git a/PDP8/pdp8_defs.h b/PDP8/pdp8_defs.h index 71ceb4a7..9261d4f2 100644 --- a/PDP8/pdp8_defs.h +++ b/PDP8/pdp8_defs.h @@ -78,7 +78,9 @@ #define IOT_V_REASON 13 /* reason */ #define IOT_SKP (1 << IOT_V_SKP) #define IOT_REASON (1 << IOT_V_REASON) -#define IORETURN(f,v) ((f)? (v): SCPE_OK) /* stop on error */ +#define IORETURN(f,v) ((f)? (v): /* stop on error */ \ + (((v) != STOP_DTOFF) ? SCPE_OK : \ + sim_messagef ((v), "*** DECtape has gone off reel - listen for the flapping tape\r\n"), SCPE_OK)) /* stop on error */ /* Timers */ diff --git a/PDP8/pdp8_td.c b/PDP8/pdp8_td.c index f12c303b..9de0d153 100644 --- a/PDP8/pdp8_td.c +++ b/PDP8/pdp8_td.c @@ -446,7 +446,7 @@ if (uptr->STATE & STA_DIR) /* update pos */ else uptr->pos = uptr->pos + delta; if (((int32) uptr->pos < 0) || ((int32) uptr->pos > (DTU_FWDEZ (uptr) + DT_EZLIN))) { - detach_unit (uptr); /* off reel */ + td_detach (uptr); /* off reel */ sim_cancel (uptr); /* no timing pulses */ return TRUE; } @@ -503,7 +503,7 @@ switch (mot) { /* case on motion */ uptr->LASTT = sim_grtime (); /* save time */ if (((int32) uptr->pos < 0) || /* off reel? */ (uptr->pos >= (((uint32) DTU_FWDEZ (uptr)) + DT_EZLIN))) { - detach_unit (uptr); + td_detach (uptr); return IORETURN (td_stopoffr, STOP_DTOFF); } break; /* check function */