The scsi_cdrom[], zip[], and scsi_disk[] arrays are now gone.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Generic CD-ROM drive core.
|
* Generic CD-ROM drive core.
|
||||||
*
|
*
|
||||||
* Version: @(#)cdrom.c 1.0.3 2018/10/21
|
* Version: @(#)cdrom.c 1.0.4 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -264,6 +264,8 @@ cdrom_close(void)
|
|||||||
if (dev->close)
|
if (dev->close)
|
||||||
dev->close(dev->p);
|
dev->close(dev->p);
|
||||||
|
|
||||||
|
dev->p = NULL;
|
||||||
|
|
||||||
cdrom_drive_reset(dev);
|
cdrom_drive_reset(dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Generic CD-ROM drive core header.
|
* Generic CD-ROM drive core header.
|
||||||
*
|
*
|
||||||
* Version: @(#)cdrom.h 1.0.15 2018/10/17
|
* Version: @(#)cdrom.h 1.0.16 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -96,7 +96,7 @@ typedef struct cdrom {
|
|||||||
|
|
||||||
void *image;
|
void *image;
|
||||||
|
|
||||||
void *p;
|
void *priv;
|
||||||
|
|
||||||
void (*insert)(void *p);
|
void (*insert)(void *p);
|
||||||
void (*close)(void *p);
|
void (*close)(void *p);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Definitions for the hard disk image handler.
|
* Definitions for the hard disk image handler.
|
||||||
*
|
*
|
||||||
* Version: @(#)hdd.h 1.0.6 2018/06/09
|
* Version: @(#)hdd.h 1.0.7 2018/10/26
|
||||||
*
|
*
|
||||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
@@ -92,6 +92,8 @@ typedef struct {
|
|||||||
at_spt, /* [Translation] parameters */
|
at_spt, /* [Translation] parameters */
|
||||||
at_hpc;
|
at_hpc;
|
||||||
|
|
||||||
|
void *priv;
|
||||||
|
|
||||||
FILE *f; /* current file handle to image */
|
FILE *f; /* current file handle to image */
|
||||||
|
|
||||||
wchar_t fn[260]; /* name of current image file */
|
wchar_t fn[260]; /* name of current image file */
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Implementation of the Iomega ZIP drive with SCSI(-like)
|
* Implementation of the Iomega ZIP drive with SCSI(-like)
|
||||||
* commands, for both ATAPI and SCSI usage.
|
* commands, for both ATAPI and SCSI usage.
|
||||||
*
|
*
|
||||||
* Version: @(#)zip.c 1.0.29 2018/10/25
|
* Version: @(#)zip.c 1.0.30 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -51,7 +51,6 @@
|
|||||||
#define zipbufferb dev->buffer
|
#define zipbufferb dev->buffer
|
||||||
|
|
||||||
|
|
||||||
zip_t *zip[ZIP_NUM] = { NULL, NULL, NULL, NULL };
|
|
||||||
zip_drive_t zip_drives[ZIP_NUM];
|
zip_drive_t zip_drives[ZIP_NUM];
|
||||||
|
|
||||||
|
|
||||||
@@ -2638,7 +2637,6 @@ void
|
|||||||
zip_global_init(void)
|
zip_global_init(void)
|
||||||
{
|
{
|
||||||
/* Clear the global data. */
|
/* Clear the global data. */
|
||||||
memset(zip, 0x00, sizeof(zip));
|
|
||||||
memset(zip_drives, 0x00, sizeof(zip_drives));
|
memset(zip_drives, 0x00, sizeof(zip_drives));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2738,21 +2736,24 @@ zip_identify(void *p, int ide_has_dma)
|
|||||||
static void
|
static void
|
||||||
zip_drive_reset(int c)
|
zip_drive_reset(int c)
|
||||||
{
|
{
|
||||||
|
zip_t *dev;
|
||||||
scsi_device_t *sd;
|
scsi_device_t *sd;
|
||||||
ide_t *id;
|
ide_t *id;
|
||||||
|
|
||||||
if (!zip[c]) {
|
if (!zip_drives[c].priv) {
|
||||||
zip[c] = (zip_t *) malloc(sizeof(zip_t));
|
zip_drives[c].priv = (zip_t *) malloc(sizeof(zip_t));
|
||||||
memset(zip[c], 0, sizeof(zip_t));
|
memset(zip_drives[c].priv, 0, sizeof(zip_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
zip[c]->id = c;
|
dev = (zip_t *) zip_drives[c].priv;
|
||||||
|
|
||||||
|
dev->id = c;
|
||||||
|
|
||||||
if (zip_drives[c].bus_type == ZIP_BUS_SCSI) {
|
if (zip_drives[c].bus_type == ZIP_BUS_SCSI) {
|
||||||
/* SCSI ZIP, attach to the SCSI bus. */
|
/* SCSI ZIP, attach to the SCSI bus. */
|
||||||
sd = &scsi_devices[zip_drives[c].scsi_device_id];
|
sd = &scsi_devices[zip_drives[c].scsi_device_id];
|
||||||
|
|
||||||
sd->p = zip[c];
|
sd->p = dev;
|
||||||
sd->command = zip_command;
|
sd->command = zip_command;
|
||||||
sd->callback = zip_callback;
|
sd->callback = zip_callback;
|
||||||
sd->err_stat_to_scsi = zip_err_stat_to_scsi;
|
sd->err_stat_to_scsi = zip_err_stat_to_scsi;
|
||||||
@@ -2767,7 +2768,7 @@ zip_drive_reset(int c)
|
|||||||
otherwise, we do nothing - it's going to be a drive
|
otherwise, we do nothing - it's going to be a drive
|
||||||
that's not attached to anything. */
|
that's not attached to anything. */
|
||||||
if (id) {
|
if (id) {
|
||||||
id->p = zip[c];
|
id->p = dev;
|
||||||
id->get_max = zip_get_max;
|
id->get_max = zip_get_max;
|
||||||
id->get_timings = zip_get_timings;
|
id->get_timings = zip_get_timings;
|
||||||
id->identify = zip_identify;
|
id->identify = zip_identify;
|
||||||
@@ -2788,6 +2789,7 @@ zip_drive_reset(int c)
|
|||||||
void
|
void
|
||||||
zip_hard_reset(void)
|
zip_hard_reset(void)
|
||||||
{
|
{
|
||||||
|
zip_t *dev;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
for (c = 0; c < ZIP_NUM; c++) {
|
for (c = 0; c < ZIP_NUM; c++) {
|
||||||
@@ -2804,15 +2806,17 @@ zip_hard_reset(void)
|
|||||||
|
|
||||||
zip_drive_reset(c);
|
zip_drive_reset(c);
|
||||||
|
|
||||||
zip[c]->id = c;
|
dev = (zip_t *) zip_drives[c].priv;
|
||||||
zip[c]->drv = &zip_drives[c];
|
|
||||||
|
|
||||||
zip_init(zip[c]);
|
dev->id = c;
|
||||||
|
dev->drv = &zip_drives[c];
|
||||||
|
|
||||||
|
zip_init(dev);
|
||||||
|
|
||||||
if (wcslen(zip_drives[c].image_path))
|
if (wcslen(zip_drives[c].image_path))
|
||||||
zip_load(zip[c], zip_drives[c].image_path);
|
zip_load(dev, zip_drives[c].image_path);
|
||||||
|
|
||||||
zip_mode_sense_load(zip[c]);
|
zip_mode_sense_load(dev);
|
||||||
|
|
||||||
if (zip_drives[c].bus_type == ZIP_BUS_SCSI)
|
if (zip_drives[c].bus_type == ZIP_BUS_SCSI)
|
||||||
zip_log("SCSI ZIP drive %i attached to SCSI ID %i\n", c, zip_drives[c].scsi_device_id);
|
zip_log("SCSI ZIP drive %i attached to SCSI ID %i\n", c, zip_drives[c].scsi_device_id);
|
||||||
@@ -2830,13 +2834,13 @@ zip_close(void)
|
|||||||
int c;
|
int c;
|
||||||
|
|
||||||
for (c = 0; c < ZIP_NUM; c++) {
|
for (c = 0; c < ZIP_NUM; c++) {
|
||||||
dev = zip[c];
|
dev = (zip_t *) zip_drives[c].priv;
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
zip_disk_close(dev);
|
zip_disk_close(dev);
|
||||||
|
|
||||||
free(zip[c]);
|
free(dev);
|
||||||
zip[c] = NULL;
|
zip_drives[c].priv = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Implementation of the Iomega ZIP drive with SCSI(-like)
|
* Implementation of the Iomega ZIP drive with SCSI(-like)
|
||||||
* commands, for both ATAPI and SCSI usage.
|
* commands, for both ATAPI and SCSI usage.
|
||||||
*
|
*
|
||||||
* Version: @(#)zip.h 1.0.6 2018/04/30
|
* Version: @(#)zip.h 1.0.7 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -54,6 +54,7 @@ typedef struct {
|
|||||||
uint32_t medium_size, base;
|
uint32_t medium_size, base;
|
||||||
|
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
void *priv;
|
||||||
} zip_drive_t;
|
} zip_drive_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* word 0 - base address
|
* word 0 - base address
|
||||||
* word 1 - bits 1-15 = byte count, bit 31 = end of transfer
|
* word 1 - bits 1-15 = byte count, bit 31 = end of transfer
|
||||||
*
|
*
|
||||||
* Version: @(#)intel_piix.c 1.0.19 2018/10/17
|
* Version: @(#)intel_piix.c 1.0.20 2018/10/26
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -831,12 +831,12 @@ piix_reset(void *p)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < CDROM_NUM; i++) {
|
for (i = 0; i < CDROM_NUM; i++) {
|
||||||
if (cdrom[i].bus_type == CDROM_BUS_ATAPI)
|
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && cdrom[i].priv)
|
||||||
scsi_cdrom_reset(scsi_cdrom[i]);
|
scsi_cdrom_reset(cdrom[i].priv);
|
||||||
}
|
}
|
||||||
for (i = 0; i < ZIP_NUM; i++) {
|
for (i = 0; i < ZIP_NUM; i++) {
|
||||||
if (zip_drives[i].bus_type == ZIP_BUS_ATAPI)
|
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && zip_drives[i].priv)
|
||||||
zip_reset(zip[i]);
|
zip_reset(zip_drives[i].priv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
src/pc.c
3
src/pc.c
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Main emulator module where most things are controlled.
|
* Main emulator module where most things are controlled.
|
||||||
*
|
*
|
||||||
* Version: @(#)pc.c 1.0.86 2018/10/19
|
* Version: @(#)pc.c 1.0.87 2018/10/26
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -495,7 +495,6 @@ usage:
|
|||||||
mouse_init();
|
mouse_init();
|
||||||
cdrom_global_init();
|
cdrom_global_init();
|
||||||
zip_global_init();
|
zip_global_init();
|
||||||
scsi_disk_global_init();
|
|
||||||
|
|
||||||
/* Load the configuration file. */
|
/* Load the configuration file. */
|
||||||
config_load();
|
config_load();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Implementation of the CD-ROM drive with SCSI(-like)
|
* Implementation of the CD-ROM drive with SCSI(-like)
|
||||||
* commands, for both ATAPI and SCSI usage.
|
* commands, for both ATAPI and SCSI usage.
|
||||||
*
|
*
|
||||||
* Version: @(#)scsi_cdrom.c 1.0.56 2018/10/26
|
* Version: @(#)scsi_cdrom.c 1.0.57 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -54,9 +54,6 @@
|
|||||||
#define cdbufferb dev->buffer
|
#define cdbufferb dev->buffer
|
||||||
|
|
||||||
|
|
||||||
scsi_cdrom_t *scsi_cdrom[CDROM_NUM] = { NULL, NULL, NULL, NULL };
|
|
||||||
|
|
||||||
|
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -2989,13 +2986,9 @@ static void
|
|||||||
scsi_cdrom_close(void *p)
|
scsi_cdrom_close(void *p)
|
||||||
{
|
{
|
||||||
scsi_cdrom_t *dev = (scsi_cdrom_t *) p;
|
scsi_cdrom_t *dev = (scsi_cdrom_t *) p;
|
||||||
uint8_t id;
|
|
||||||
|
|
||||||
if (dev) {
|
if (dev)
|
||||||
id = dev->id;
|
free(dev);
|
||||||
free(scsi_cdrom[id]);
|
|
||||||
scsi_cdrom[id] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3100,6 +3093,7 @@ void
|
|||||||
scsi_cdrom_drive_reset(int c)
|
scsi_cdrom_drive_reset(int c)
|
||||||
{
|
{
|
||||||
cdrom_t *drv = &cdrom[c];
|
cdrom_t *drv = &cdrom[c];
|
||||||
|
scsi_cdrom_t *dev;
|
||||||
scsi_device_t *sd;
|
scsi_device_t *sd;
|
||||||
ide_t *id;
|
ide_t *id;
|
||||||
|
|
||||||
@@ -3111,26 +3105,27 @@ scsi_cdrom_drive_reset(int c)
|
|||||||
if ((drv->bus_type == CDROM_BUS_ATAPI) && (drv->ide_channel > 7))
|
if ((drv->bus_type == CDROM_BUS_ATAPI) && (drv->ide_channel > 7))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!scsi_cdrom[c]) {
|
if (!drv->priv) {
|
||||||
scsi_cdrom[c] = (scsi_cdrom_t *) malloc(sizeof(scsi_cdrom_t));
|
drv->priv = (scsi_cdrom_t *) malloc(sizeof(scsi_cdrom_t));
|
||||||
memset(scsi_cdrom[c], 0, sizeof(scsi_cdrom_t));
|
memset(drv->priv, 0, sizeof(scsi_cdrom_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
scsi_cdrom[c]->id = c;
|
dev = (scsi_cdrom_t *) drv->priv;
|
||||||
scsi_cdrom[c]->drv = drv;
|
|
||||||
drv->p = scsi_cdrom[c];
|
dev->id = c;
|
||||||
|
dev->drv = drv;
|
||||||
drv->insert = scsi_cdrom_insert;
|
drv->insert = scsi_cdrom_insert;
|
||||||
drv->get_volume = scsi_cdrom_get_volume;
|
drv->get_volume = scsi_cdrom_get_volume;
|
||||||
drv->get_channel = scsi_cdrom_get_channel;
|
drv->get_channel = scsi_cdrom_get_channel;
|
||||||
drv->close = scsi_cdrom_close;
|
drv->close = scsi_cdrom_close;
|
||||||
|
|
||||||
scsi_cdrom_init(scsi_cdrom[c]);
|
scsi_cdrom_init(dev);
|
||||||
|
|
||||||
if (drv->bus_type == CDROM_BUS_SCSI) {
|
if (drv->bus_type == CDROM_BUS_SCSI) {
|
||||||
/* SCSI CD-ROM, attach to the SCSI bus. */
|
/* SCSI CD-ROM, attach to the SCSI bus. */
|
||||||
sd = &scsi_devices[drv->scsi_device_id];
|
sd = &scsi_devices[drv->scsi_device_id];
|
||||||
|
|
||||||
sd->p = scsi_cdrom[c];
|
sd->p = dev;
|
||||||
sd->command = scsi_cdrom_command;
|
sd->command = scsi_cdrom_command;
|
||||||
sd->callback = scsi_cdrom_callback;
|
sd->callback = scsi_cdrom_callback;
|
||||||
sd->err_stat_to_scsi = scsi_cdrom_err_stat_to_scsi;
|
sd->err_stat_to_scsi = scsi_cdrom_err_stat_to_scsi;
|
||||||
@@ -3147,7 +3142,7 @@ scsi_cdrom_drive_reset(int c)
|
|||||||
otherwise, we do nothing - it's going to be a drive
|
otherwise, we do nothing - it's going to be a drive
|
||||||
that's not attached to anything. */
|
that's not attached to anything. */
|
||||||
if (id) {
|
if (id) {
|
||||||
id->p = scsi_cdrom[c];
|
id->p = dev;
|
||||||
id->get_max = scsi_cdrom_get_max;
|
id->get_max = scsi_cdrom_get_max;
|
||||||
id->get_timings = scsi_cdrom_get_timings;
|
id->get_timings = scsi_cdrom_get_timings;
|
||||||
id->identify = scsi_cdrom_identify;
|
id->identify = scsi_cdrom_identify;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Emulation of SCSI fixed disks.
|
* Emulation of SCSI fixed disks.
|
||||||
*
|
*
|
||||||
* Version: @(#)scsi_disk.c 1.0.25 2018/10/18
|
* Version: @(#)scsi_disk.c 1.0.26 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -53,10 +53,6 @@
|
|||||||
#define scsi_disk_ascq dev->sense[13]
|
#define scsi_disk_ascq dev->sense[13]
|
||||||
|
|
||||||
|
|
||||||
scsi_disk_t *scsi_disk[HDD_NUM] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
|
|
||||||
|
|
||||||
|
|
||||||
/* Table of all SCSI commands and their flags, needed for the new disc change / not ready handler. */
|
/* Table of all SCSI commands and their flags, needed for the new disc change / not ready handler. */
|
||||||
const uint8_t scsi_disk_command_flags[0x100] = {
|
const uint8_t scsi_disk_command_flags[0x100] = {
|
||||||
IMPLEMENTED | CHECK_READY | NONDATA, /* 0x00 */
|
IMPLEMENTED | CHECK_READY | NONDATA, /* 0x00 */
|
||||||
@@ -1238,19 +1234,11 @@ scsi_disk_callback(void *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Peform a master init on the entire module. */
|
|
||||||
void
|
|
||||||
scsi_disk_global_init(void)
|
|
||||||
{
|
|
||||||
/* Clear the global data. */
|
|
||||||
memset(scsi_disk, 0x00, sizeof(scsi_disk));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scsi_disk_hard_reset(void)
|
scsi_disk_hard_reset(void)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
scsi_disk_t *dev;
|
||||||
scsi_device_t *sd;
|
scsi_device_t *sd;
|
||||||
|
|
||||||
for (c = 0; c < HDD_NUM; c++) {
|
for (c = 0; c < HDD_NUM; c++) {
|
||||||
@@ -1269,15 +1257,17 @@ scsi_disk_hard_reset(void)
|
|||||||
if (! hdd_image_load(c))
|
if (! hdd_image_load(c))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!scsi_disk[c]) {
|
if (!hdd[c].priv) {
|
||||||
scsi_disk[c] = (scsi_disk_t *) malloc(sizeof(scsi_disk_t));
|
hdd[c].priv = (scsi_disk_t *) malloc(sizeof(scsi_disk_t));
|
||||||
memset(scsi_disk[c], 0, sizeof(scsi_disk_t));
|
memset(hdd[c].priv, 0, sizeof(scsi_disk_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev = (scsi_disk_t *) hdd[c].priv;
|
||||||
|
|
||||||
/* SCSI disk, attach to the SCSI bus. */
|
/* SCSI disk, attach to the SCSI bus. */
|
||||||
sd = &scsi_devices[hdd[c].scsi_id];
|
sd = &scsi_devices[hdd[c].scsi_id];
|
||||||
|
|
||||||
sd->p = scsi_disk[c];
|
sd->p = dev;
|
||||||
sd->command = scsi_disk_command;
|
sd->command = scsi_disk_command;
|
||||||
sd->callback = scsi_disk_callback;
|
sd->callback = scsi_disk_callback;
|
||||||
sd->err_stat_to_scsi = scsi_disk_err_stat_to_scsi;
|
sd->err_stat_to_scsi = scsi_disk_err_stat_to_scsi;
|
||||||
@@ -1286,10 +1276,10 @@ scsi_disk_hard_reset(void)
|
|||||||
sd->read_capacity = scsi_disk_read_capacity;
|
sd->read_capacity = scsi_disk_read_capacity;
|
||||||
sd->type = SCSI_FIXED_DISK;
|
sd->type = SCSI_FIXED_DISK;
|
||||||
|
|
||||||
scsi_disk[c]->id = c;
|
dev->id = c;
|
||||||
scsi_disk[c]->drv = &hdd[c];
|
dev->drv = &hdd[c];
|
||||||
|
|
||||||
scsi_disk_mode_sense_load(scsi_disk[c]);
|
scsi_disk_mode_sense_load(dev);
|
||||||
|
|
||||||
scsi_disk_log("SCSI disk %i attached to SCSI ID %i\n", c, hdd[c].scsi_id);
|
scsi_disk_log("SCSI disk %i attached to SCSI ID %i\n", c, hdd[c].scsi_id);
|
||||||
}
|
}
|
||||||
@@ -1304,13 +1294,13 @@ scsi_disk_close(void)
|
|||||||
int c;
|
int c;
|
||||||
|
|
||||||
for (c = 0; c < HDD_NUM; c++) {
|
for (c = 0; c < HDD_NUM; c++) {
|
||||||
dev = scsi_disk[c];
|
dev = hdd[c].priv;
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
hdd_image_close(c);
|
hdd_image_close(c);
|
||||||
|
|
||||||
free(scsi_disk[c]);
|
free(dev);
|
||||||
scsi_disk[c] = NULL;
|
hdd[c].priv = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Emulation of SCSI fixed and removable disks.
|
* Emulation of SCSI fixed and removable disks.
|
||||||
*
|
*
|
||||||
* Version: @(#)scsi_disk.h 1.0.6 2018/10/10
|
* Version: @(#)scsi_disk.h 1.0.7 2018/10/26
|
||||||
*
|
*
|
||||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||||
* Copyright 2017,2018 Miran Grca.
|
* Copyright 2017,2018 Miran Grca.
|
||||||
@@ -45,6 +45,5 @@ typedef struct {
|
|||||||
extern scsi_disk_t *scsi_disk[HDD_NUM];
|
extern scsi_disk_t *scsi_disk[HDD_NUM];
|
||||||
|
|
||||||
|
|
||||||
extern void scsi_disk_global_init(void);
|
|
||||||
extern void scsi_disk_hard_reset(void);
|
extern void scsi_disk_hard_reset(void);
|
||||||
extern void scsi_disk_close(void);
|
extern void scsi_disk_close(void);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Handle the platform-side of CDROM drives.
|
* Handle the platform-side of CDROM drives.
|
||||||
*
|
*
|
||||||
* Version: @(#)win_cdrom.c 1.0.11 2018/10/21
|
* Version: @(#)win_cdrom.c 1.0.12 2018/10/26
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -61,10 +61,12 @@ plat_cdrom_ui_update(uint8_t id, uint8_t reload)
|
|||||||
void
|
void
|
||||||
zip_eject(uint8_t id)
|
zip_eject(uint8_t id)
|
||||||
{
|
{
|
||||||
zip_disk_close(zip[id]);
|
zip_t *dev = (zip_t *) zip_drives[id].priv;
|
||||||
|
|
||||||
|
zip_disk_close(dev);
|
||||||
if (zip_drives[id].bus_type) {
|
if (zip_drives[id].bus_type) {
|
||||||
/* Signal disk change to the emulated machine. */
|
/* Signal disk change to the emulated machine. */
|
||||||
zip_insert(zip[id]);
|
zip_insert(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_sb_update_icon_state(SB_ZIP | id, 1);
|
ui_sb_update_icon_state(SB_ZIP | id, 1);
|
||||||
@@ -78,7 +80,9 @@ zip_eject(uint8_t id)
|
|||||||
void
|
void
|
||||||
zip_reload(uint8_t id)
|
zip_reload(uint8_t id)
|
||||||
{
|
{
|
||||||
zip_disk_reload(zip[id]);
|
zip_t *dev = (zip_t *) zip_drives[id].priv;
|
||||||
|
|
||||||
|
zip_disk_reload(dev);
|
||||||
if (wcslen(zip_drives[id].image_path) == 0) {
|
if (wcslen(zip_drives[id].image_path) == 0) {
|
||||||
ui_sb_enable_menu_item(SB_ZIP|id, IDM_ZIP_EJECT | id, MF_BYCOMMAND | MF_GRAYED);
|
ui_sb_enable_menu_item(SB_ZIP|id, IDM_ZIP_EJECT | id, MF_BYCOMMAND | MF_GRAYED);
|
||||||
ui_sb_update_icon_state(SB_ZIP|id, 1);
|
ui_sb_update_icon_state(SB_ZIP|id, 1);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implement the application's Status Bar.
|
* Implement the application's Status Bar.
|
||||||
*
|
*
|
||||||
* Version: @(#)win_stbar.c 1.0.22 2018/10/19
|
* Version: @(#)win_stbar.c 1.0.23 2018/10/26
|
||||||
*
|
*
|
||||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
@@ -777,10 +777,12 @@ ui_sb_mount_floppy_img(uint8_t id, int part, uint8_t wp, wchar_t *file_name)
|
|||||||
void
|
void
|
||||||
ui_sb_mount_zip_img(uint8_t id, int part, uint8_t wp, wchar_t *file_name)
|
ui_sb_mount_zip_img(uint8_t id, int part, uint8_t wp, wchar_t *file_name)
|
||||||
{
|
{
|
||||||
zip_disk_close(zip[id]);
|
zip_t *dev = (zip_t *) zip_drives[id].priv;
|
||||||
|
|
||||||
|
zip_disk_close(dev);
|
||||||
zip_drives[id].ui_writeprot = wp;
|
zip_drives[id].ui_writeprot = wp;
|
||||||
zip_load(zip[id], file_name);
|
zip_load(dev, file_name);
|
||||||
zip_insert(zip[id]);
|
zip_insert(dev);
|
||||||
if (sb_ready) {
|
if (sb_ready) {
|
||||||
ui_sb_update_icon_state(SB_ZIP | id, wcslen(zip_drives[id].image_path) ? 0 : 1);
|
ui_sb_update_icon_state(SB_ZIP | id, wcslen(zip_drives[id].image_path) ? 0 : 1);
|
||||||
EnableMenuItem(sb_menu_handles[part], IDM_ZIP_EJECT | id, MF_BYCOMMAND | (wcslen(zip_drives[id].image_path) ? MF_ENABLED : MF_GRAYED));
|
EnableMenuItem(sb_menu_handles[part], IDM_ZIP_EJECT | id, MF_BYCOMMAND | (wcslen(zip_drives[id].image_path) ? MF_ENABLED : MF_GRAYED));
|
||||||
@@ -914,7 +916,7 @@ StatusBarProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
cdrom_image_open(&(cdrom[id]), temp_path);
|
cdrom_image_open(&(cdrom[id]), temp_path);
|
||||||
/* Signal media change to the emulated machine. */
|
/* Signal media change to the emulated machine. */
|
||||||
if (cdrom[id].insert)
|
if (cdrom[id].insert)
|
||||||
cdrom[id].insert(cdrom[id].p);
|
cdrom[id].insert(cdrom[id].priv);
|
||||||
cdrom[id].host_drive = (wcslen(cdrom[id].image_path) == 0) ? 0 : 200;
|
cdrom[id].host_drive = (wcslen(cdrom[id].image_path) == 0) ? 0 : 200;
|
||||||
if (cdrom[id].host_drive == 200) {
|
if (cdrom[id].host_drive == 200) {
|
||||||
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_EMPTY | id, MF_UNCHECKED);
|
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_EMPTY | id, MF_UNCHECKED);
|
||||||
|
|||||||
Reference in New Issue
Block a user