Skip to content

Commit c6ca12c

Browse files
committed
sigma: implement attention interrupt to sigma)mt.c
1 parent feb155f commit c6ca12c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

sigma/sigma_mt.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ int32 mt_rwtime = 10000; /* rewind latency */
112112
int32 mt_ctime = 100; /* command latency */
113113
int32 mt_time = 10; /* record latency */
114114
uint32 mt_rwi = 0; /* rewind interrupts */
115+
uint32 mt_atn = 0; /* attention interrupt */
115116
t_mtrlnt mt_bptr;
116117
t_mtrlnt mt_blim;
117118
uint8 mt_xb[MT_MAXFR]; /* transfer buffer */
@@ -152,6 +153,8 @@ t_stat mt_map_err (UNIT *uptr, t_stat r);
152153
int32 mt_clr_int (uint32 dva);
153154
void mt_set_rwi (uint32 un);
154155
void mt_clr_rwi (uint32 un);
156+
void mt_set_atn (uint32 un);
157+
void mt_clr_atn (uint32 un);
155158

156159
/* MT data structures
157160
@@ -631,6 +634,10 @@ for (iu = 0; iu < MT_NUMDR; iu++) { /* rewind int? */
631634
mt_clr_rwi ((uint32) iu);
632635
return (iu | MTAI_INT);
633636
}
637+
if (mt_atn & (1u << iu)) {
638+
mt_clr_atn ((uint32) iu);
639+
return (iu | MTAI_INT);
640+
}
634641
}
635642
return 0;
636643
}
@@ -644,6 +651,15 @@ chan_set_dvi (mt_dib.dva); /* set INP */
644651
return;
645652
}
646653

654+
/* Set ATN interrupt */
655+
656+
void mt_set_atn (uint32 un)
657+
{
658+
mt_atn |= (1u << un);
659+
chan_set_dvi (mt_dib.dva); /* set INP */
660+
return;
661+
}
662+
647663
/* Clear rewind interrupt */
648664

649665
void mt_clr_rwi (uint32 un)
@@ -656,6 +672,16 @@ else if (chan_chk_chi (mt_dib.dva) < 0) /* any int? */
656672
return;
657673
}
658674

675+
void mt_clr_atn (uint32 un)
676+
{
677+
mt_atn &= ~(1u << un);
678+
if (mt_atn != 0) /* more? */
679+
chan_set_dvi (mt_dib.dva);
680+
else if (chan_chk_chi (mt_dib.dva) < 0) /* any int? */
681+
chan_clr_chi (mt_dib.dva); /* clr INP */
682+
return;
683+
}
684+
659685
/* Reset routine */
660686

661687
t_stat mt_reset (DEVICE *dptr)
@@ -684,11 +710,14 @@ return SCPE_OK;
684710
t_stat mt_attach (UNIT *uptr, CONST char *cptr)
685711
{
686712
t_stat r;
713+
uint32 un = uptr - mt_unit;
687714

688715
r = sim_tape_attach (uptr, cptr);
689716
if (r != SCPE_OK)
690717
return r;
691718
uptr->UST = MTDV_BOT;
719+
if (sim_switches & SWMASK('A'))
720+
mt_set_atn (un);
692721
return r;
693722
}
694723

0 commit comments

Comments
 (0)