Fixed device chain loading (again) and ZIP and CD-ROM resetting.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* Implementation of the generic device interface to handle
|
||||
* all devices attached to the emulator.
|
||||
*
|
||||
* Version: @(#)device.c 1.0.21 2018/10/23
|
||||
* Version: @(#)device.c 1.0.22 2018/10/25
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -116,6 +116,10 @@ device_add_common(const device_t *d, void *p, int inst)
|
||||
if (c >= DEVICE_MAX)
|
||||
fatal("DEVICE: too many devices\n");
|
||||
|
||||
/* Do this so that a chained device_add will not identify the same ID
|
||||
its master device is already trying to assign. */
|
||||
devices[c] = (device_t *)d;
|
||||
|
||||
if (p == NULL) {
|
||||
memcpy(&old, &device_current, sizeof(device_context_t));
|
||||
device_set_context(&device_current, d, inst);
|
||||
@@ -128,6 +132,7 @@ device_add_common(const device_t *d, void *p, int inst)
|
||||
else
|
||||
device_log("DEVICE: device init failed\n");
|
||||
|
||||
devices[c] = NULL;
|
||||
device_priv[c] = NULL;
|
||||
|
||||
return(NULL);
|
||||
@@ -139,8 +144,6 @@ device_add_common(const device_t *d, void *p, int inst)
|
||||
} else
|
||||
device_priv[c] = p;
|
||||
|
||||
devices[c] = (device_t *)d;
|
||||
|
||||
return(priv);
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* Implementation of the Iomega ZIP drive with SCSI(-like)
|
||||
* commands, for both ATAPI and SCSI usage.
|
||||
*
|
||||
* Version: @(#)zip.c 1.0.28 2018/10/19
|
||||
* Version: @(#)zip.c 1.0.29 2018/10/25
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
@@ -1345,6 +1345,7 @@ zip_reset(void *p)
|
||||
dev->status = 0;
|
||||
dev->callback = 0LL;
|
||||
zip_set_callback(dev);
|
||||
zip_set_signature(dev);
|
||||
dev->packet_status = 0xff;
|
||||
dev->unit_attention = 0;
|
||||
}
|
||||
@@ -1949,13 +1950,8 @@ zip_command(void *p, uint8_t *cdb)
|
||||
else
|
||||
zipbufferb[0] = 0x00; /*Hard disk*/
|
||||
zipbufferb[1] = 0x80; /*Removable*/
|
||||
if (dev->drv->is_250) {
|
||||
zipbufferb[2] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x00; /*SCSI-2 compliant*/
|
||||
zipbufferb[3] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x21;
|
||||
} else {
|
||||
zipbufferb[2] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x00; /*SCSI-2 compliant*/
|
||||
zipbufferb[3] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x21;
|
||||
}
|
||||
zipbufferb[2] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x00; /*SCSI-2 compliant*/
|
||||
zipbufferb[3] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x21;
|
||||
zipbufferb[4] = 31;
|
||||
if (dev->drv->bus_type == ZIP_BUS_SCSI) {
|
||||
zipbufferb[6] = 1; /* 16-bit transfers supported */
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* Implementation of the CD-ROM drive with SCSI(-like)
|
||||
* commands, for both ATAPI and SCSI usage.
|
||||
*
|
||||
* Version: @(#)scsi_cdrom.c 1.0.54 2018/10/21
|
||||
* Version: @(#)scsi_cdrom.c 1.0.55 2018/10/25
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
@@ -1424,6 +1424,7 @@ scsi_cdrom_reset(void *p)
|
||||
dev->status = 0;
|
||||
dev->callback = 0LL;
|
||||
scsi_cdrom_set_callback(dev);
|
||||
scsi_cdrom_set_signature(dev);
|
||||
dev->packet_status = 0xff;
|
||||
dev->unit_attention = 0xff;
|
||||
}
|
||||
|
Reference in New Issue
Block a user