mirror of
https://github.com/simh/simh.git
synced 2026-05-16 02:02:15 +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:
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user