From 60b09a4b56d8d95cbd65945bdc2916145bc215e2 Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Thu, 17 Sep 2020 20:12:21 -0400 Subject: [PATCH] IBM360: Fixed sense data in MT, minor 2703 fixes. --- IBM360/ibm360_com.c | 16 +++++++++++++--- IBM360/ibm360_mt.c | 12 +++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/IBM360/ibm360_com.c b/IBM360/ibm360_com.c index ed0220e..24a269d 100644 --- a/IBM360/ibm360_com.c +++ b/IBM360/ibm360_com.c @@ -272,7 +272,7 @@ uint8 coml_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) { switch (cmd & 0x3) { case 0x3: /* Control */ - if ((cmd == CMD_NOP) || (cmd & 0x8) != 0) + if ((cmd == CMD_NOP) || (cmd & 0x10) != 0) return SNS_CHNEND|SNS_DEVEND; case 0x2: /* Read command */ case 0x1: /* Write command */ @@ -378,7 +378,7 @@ t_stat coml_srv(UNIT * uptr) chan_end(addr, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP); return SCPE_OK; } - if (uptr->CMD & ADDR) { + if ((uptr->CMD & ADDR) != 0 && uptr->BPTR == 0) { ch = 0x16; sim_debug(DEBUG_CMD, dptr, "COM: unit=%d addr %02x\n", unit, ch); uptr->CMD &= ~ADDR; @@ -408,6 +408,8 @@ t_stat coml_srv(UNIT * uptr) chan_end(addr, SNS_CHNEND|SNS_DEVEND); return SCPE_OK; } +// if (ch == 0x1f) +// uptr->CMD |= ADDR; ch = com_buf[unit][uptr->IPTR++]; if (chan_write_byte( addr, &ch)) { uptr->CMD &= ~(0xff|INPUT|RECV); @@ -436,6 +438,13 @@ t_stat coml_srv(UNIT * uptr) chan_end(addr, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP); return SCPE_OK; } + if (uptr->CMD & BREAK) { + sim_debug(DEBUG_CMD, dptr, "COM: unit=%d attn write\n", unit); + uptr->CMD &= ~(0xff|BREAK); + uptr->SNS |= SNS_INTVENT; + chan_end(addr, SNS_CHNEND|SNS_DEVEND|SNS_UNITCHK); + return SCPE_OK; + } sim_debug(DEBUG_CMD, dptr, "COM: unit=%d write\n", unit); if (chan_read_byte (addr, &ch)) { uptr->CMD &= ~0xff; @@ -471,6 +480,7 @@ t_stat coml_srv(UNIT * uptr) case CMD_BRK: /* Send break signal */ uptr->CMD &= ~0xff; + uptr->CMD |= ADDR; uptr->SNS = 0; chan_end(addr, SNS_CHNEND|SNS_DEVEND); break; @@ -694,7 +704,7 @@ return SCPE_OK; const char *com_description (DEVICE *dptr) { -return "IBM 2701 communications controller"; +return "IBM 2703 communications controller"; } #endif diff --git a/IBM360/ibm360_mt.c b/IBM360/ibm360_mt.c index fe3c590..e712636 100644 --- a/IBM360/ibm360_mt.c +++ b/IBM360/ibm360_mt.c @@ -254,7 +254,6 @@ uint8 mt_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) { case 0x2: /* Read command */ case 0xc: /* Read backward */ uptr->SNS = 0; - uptr->SNS |= SNS_TUASTA << 8; /* Fall through */ case 0x4: /* Sense */ @@ -402,10 +401,13 @@ t_stat mt_srv(UNIT * uptr) ch = (uptr->SNS >> 8) & 0xff; if ((uptr->flags & MTUF_9TR) == 0) ch |= SNS_7TRACK; - if (sim_tape_wrp(uptr)) - ch |= SNS_WRP; - if (sim_tape_bot(uptr)) - ch |= SNS_LOAD; + if ((uptr->flags & UNIT_ATT) != 0) { + if (sim_tape_wrp(uptr)) + ch |= SNS_WRP; + if (sim_tape_bot(uptr)) + ch |= SNS_LOAD; + ch |= SNS_TUASTA; + } sim_debug(DEBUG_DETAIL, dptr, "sense unit=%d 2 %x\n", unit, ch); chan_write_byte(addr, &ch) ; ch = 0xc0;