1
0
mirror of https://github.com/simh/simh.git synced 2026-05-17 10:27:45 +00:00

PDP1, PDP8, PDP11 and PDP18b's: Properly detach when tape off reel is detected

- This change avoids the possibility of mangling a tape image if the tape
  type auto detection (12b, 16b, 18b) has changed the in memory tape
  format.
- Anyone who wants the off reel detection to have the simulator drop
  back to a sim> prompt should have a non-zero value in the STOP_OFFR
  register.
This commit is contained in:
Mark Pizzolato
2026-04-07 12:00:48 -10:00
parent b0f160fc5a
commit 5654a8fba0
8 changed files with 20 additions and 12 deletions

View File

@@ -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 */

View File

@@ -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;