From 7325bd86f73aa1e97f80521c72d776bb2acd1b87 Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Sat, 23 Oct 2021 22:30:49 -0400 Subject: [PATCH] IBM360: Fix DASD to work correctly when device not attached. --- IBM360/ibm360_dasd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/IBM360/ibm360_dasd.c b/IBM360/ibm360_dasd.c index 33bdd7b..2c96bfa 100644 --- a/IBM360/ibm360_dasd.c +++ b/IBM360/ibm360_dasd.c @@ -405,13 +405,13 @@ uint8 dasd_startcmd(UNIT *uptr, uint8 cmd) { sim_debug(DEBUG_CMD, dptr, "CMD unit=%d %02x\n", unit, cmd); if ((uptr->flags & UNIT_ATT) == 0) { - if (cmd != 0) { // if ((cmd & 0xF) == 0x4) { /* Sense */ - uptr->CMD |= cmd; - sim_activate(uptr, 10); - return 0; + if (cmd == 0) { + return SNS_UNITCHK; } sim_debug(DEBUG_CMD, dptr, "CMD unit=%d disco\n", unit); - return SNS_CHNEND|SNS_UNITCHK; + uptr->CMD |= cmd; + sim_activate(uptr, 10); + return 0; } switch (cmd & 0x3) { @@ -435,7 +435,7 @@ uint8 dasd_startcmd(UNIT *uptr, uint8 cmd) { } if (uptr->SNS & 0xff) { sim_debug(DEBUG_CMD, dptr, "CMD unit=%d test %08x\n", unit, uptr->SNS); - return SNS_CHNEND|SNS_UNITCHK; + return SNS_CHNEND|SNS_DEVEND|SNS_UNITCHK; } } return SNS_CHNEND;