Major changes to NVR, system initialization (pc.c), and what goes on in the Windows startup (win.c.) Not fully done yet, but good enough for a first commit.

This commit is contained in:
waltje
2017-10-07 00:46:54 -04:00
parent 95fe21b651
commit 2b37b7fbfb
108 changed files with 5628 additions and 5912 deletions

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of disk controllers.
*
* Version: @(#)hdc.c 1.0.2 2017/10/01
* Version: @(#)hdc.c 1.0.3 2017/10/04
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -31,7 +31,7 @@ int hdc_current;
static void *
null_init(void)
null_init(device_t *info)
{
return(NULL);
}
@@ -44,14 +44,14 @@ null_close(void *priv)
static device_t null_device = {
"Null HDC", 0,
null_init, null_close,
"Null HDC", 0, 0,
null_init, null_close, NULL,
NULL, NULL, NULL, NULL, NULL
};
static void *
inthdc_init(void)
inthdc_init(device_t *info)
{
return(NULL);
}
@@ -64,8 +64,8 @@ inthdc_close(void *priv)
static device_t inthdc_device = {
"Internal Controller", 0,
inthdc_init, inthdc_close,
"Internal Controller", 0, 0,
inthdc_init, inthdc_close, NULL,
NULL, NULL, NULL, NULL, NULL
};

View File

@@ -8,7 +8,7 @@
*
* Driver for the ESDI controller (WD1007-vse1) for PC/AT.
*
* Version: @(#)hdc_esdi_at.c 1.0.2 2017/10/01
* Version: @(#)hdc_esdi_at.c 1.0.3 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -32,6 +32,7 @@
#include "../pic.h"
#include "../rom.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -513,7 +514,7 @@ esdi_callback(void *priv)
esdi->pos = 0;
esdi->status = STAT_DRQ | STAT_READY | STAT_DSC;
irq_raise(esdi);
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
break;
case CMD_WRITE:
@@ -548,7 +549,7 @@ esdi_callback(void *priv)
} else {
esdi->status = STAT_READY | STAT_DSC;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
break;
case CMD_VERIFY:
@@ -574,7 +575,7 @@ esdi_callback(void *priv)
break;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
next_sector(esdi);
esdi->secount = (esdi->secount - 1) & 0xff;
if (esdi->secount)
@@ -608,7 +609,7 @@ esdi_callback(void *priv)
}
esdi->status = STAT_READY | STAT_DSC;
irq_raise(esdi);
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
break;
case CMD_DIAGNOSE:
@@ -736,7 +737,7 @@ esdi_callback(void *priv)
break;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 0);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 0);
}
@@ -770,7 +771,7 @@ loadhd(esdi_t *esdi, int hdd_num, int d, const wchar_t *fn)
static void *
wd1007vse1_init(void)
wd1007vse1_init(device_t *info)
{
int i, c = 0;
@@ -842,8 +843,10 @@ wd1007vse1_available(void)
device_t esdi_at_wd1007vse1_device = {
"Western Digital WD1007V-SE1 (ESDI)",
DEVICE_AT,
0,
wd1007vse1_init,
wd1007vse1_close,
NULL,
wd1007vse1_available,
NULL, NULL, NULL, NULL
};

View File

@@ -52,7 +52,7 @@
* however, are auto-configured by the system software as
* shown above.
*
* Version: @(#)hdc_esdi_mca.c 1.0.4 2017/09/29
* Version: @(#)hdc_esdi_mca.c 1.0.5 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -73,6 +73,7 @@
#include "../pic.h"
#include "../rom.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -325,7 +326,7 @@ esdi_callback(void *priv)
if (dev->rba >= drive->sectors)
fatal("Read past end of drive\n");
hdd_image_read(drive->hdd_num, dev->rba, 1, (uint8_t *)dev->data);
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
}
while (dev->data_pos < 256) {
@@ -406,11 +407,11 @@ esdi_callback(void *priv)
hdd_image_write(drive->hdd_num, dev->rba, 1, (uint8_t *)dev->data);
dev->rba++;
dev->sector_pos++;
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
dev->data_pos = 0;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 0);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 0);
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
@@ -970,7 +971,7 @@ esdi_mca_write(int port, uint8_t val, void *priv)
static void *
esdi_init(void)
esdi_init(device_t *info)
{
drive_t *drive;
esdi_t *dev;
@@ -1066,7 +1067,7 @@ esdi_available(void)
device_t esdi_ps2_device = {
"IBM ESDI Fixed Disk Adapter (MCA)",
DEVICE_MCA,
esdi_init, esdi_close, esdi_available,
NULL, NULL, NULL, NULL
DEVICE_MCA, 0,
esdi_init, esdi_close, NULL,
esdi_available, NULL, NULL, NULL, NULL
};

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdc_ide.c 1.0.9 2017/09/30
* Version: @(#)hdc_ide.c 1.0.10 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -30,6 +30,7 @@
#include "../device.h"
#include "../cdrom/cdrom.h"
#include "../scsi/scsi.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdc_ide.h"
#include "hdd.h"
@@ -1296,7 +1297,7 @@ uint32_t ide_read_data(int ide_board, int length)
}
else
{
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
}
}
@@ -1644,7 +1645,7 @@ void callbackide(int ide_board)
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
return;
case WIN_READ_DMA:
@@ -1691,12 +1692,12 @@ void callbackide(int ide_board)
ide_next_sector(ide);
ide->atastat = BUSY_STAT;
idecallback[ide_board]=6*IDE_TIME;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
}
}
@@ -1749,7 +1750,7 @@ void callbackide(int ide_board)
ide->blockcount = 0;
}
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
return;
case WIN_WRITE:
@@ -1770,12 +1771,12 @@ void callbackide(int ide_board)
ide->atastat = DRQ_STAT | READY_STAT | DSC_STAT;
ide->pos=0;
ide_next_sector(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide->atastat = READY_STAT | DSC_STAT;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
return;
@@ -1809,12 +1810,12 @@ void callbackide(int ide_board)
ide_next_sector(ide);
ide->atastat = BUSY_STAT;
idecallback[ide_board]=6*IDE_TIME;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
}
}
@@ -1843,12 +1844,12 @@ void callbackide(int ide_board)
ide->atastat = DRQ_STAT | READY_STAT | DSC_STAT;
ide->pos=0;
ide_next_sector(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide->atastat = READY_STAT | DSC_STAT;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
return;
@@ -1865,7 +1866,7 @@ void callbackide(int ide_board)
ide->pos=0;
ide->atastat = READY_STAT | DSC_STAT;
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
return;
case WIN_FORMAT:
@@ -1882,7 +1883,7 @@ void callbackide(int ide_board)
ide->atastat = READY_STAT | DSC_STAT;
ide_irq_raise(ide);
/* update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1); */
/* StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1); */
return;
case WIN_DRIVE_DIAGNOSTICS:

View File

@@ -12,7 +12,7 @@
* based design. Most cards were WD1003-WA2 or -WAH, where the
* -WA2 cards had a floppy controller as well (to save space.)
*
* Version: @(#)hdd_mfm_at.c 1.0.4 2017/09/29
* Version: @(#)hdd_mfm_at.c 1.0.5 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -29,6 +29,7 @@
#include "../io.h"
#include "../pic.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -461,7 +462,7 @@ mfm_readw(uint16_t port, void *priv)
mfm->callback = 6*MFM_TIME;
timer_update_outstanding();
} else {
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
}
}
}
@@ -561,7 +562,7 @@ do_callback(void *priv)
mfm->reset = 0;
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
return;
}
@@ -595,7 +596,7 @@ do_callback(void *priv)
mfm->pos = 0;
mfm->status = STAT_DRQ|STAT_READY|STAT_DSC;
irq_raise(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
break;
case CMD_WRITE:
@@ -620,9 +621,9 @@ do_callback(void *priv)
mfm->status |= STAT_DRQ;
mfm->pos = 0;
next_sector(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
} else {
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
}
irq_raise(mfm);
break;
@@ -636,7 +637,7 @@ do_callback(void *priv)
mfm->pos = 0;
mfm->status = STAT_READY|STAT_DSC;
irq_raise(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
break;
case CMD_FORMAT:
@@ -656,7 +657,7 @@ do_callback(void *priv)
mfm->status = STAT_READY|STAT_DSC;
irq_raise(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
break;
case CMD_DIAGNOSE:
@@ -700,7 +701,7 @@ loadhd(mfm_t *mfm, int c, int d, const wchar_t *fn)
static void *
mfm_init(void)
mfm_init(device_t *info)
{
mfm_t *mfm;
int c, d;
@@ -733,7 +734,7 @@ mfm_init(void)
timer_add(do_callback, &mfm->callback, &mfm->callback, mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
return(mfm);
}
@@ -753,13 +754,13 @@ mfm_close(void *priv)
free(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
}
device_t mfm_at_wd1003_device = {
"WD1003 AT MFM/RLL Controller",
DEVICE_AT,
DEVICE_AT, 0,
mfm_init, mfm_close, NULL,
NULL, NULL, NULL, NULL
NULL, NULL, NULL, NULL, NULL
};

View File

@@ -41,7 +41,7 @@
* Since all controllers (including the ones made by DTC) use
* (mostly) the same API, we keep them all in this module.
*
* Version: @(#)hdd_mfm_xt.c 1.0.6 2017/09/30
* Version: @(#)hdd_mfm_xt.c 1.0.7 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -61,6 +61,7 @@
#include "../pic.h"
#include "../rom.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -402,7 +403,7 @@ mfm_callback(void *priv)
mfm_complete(mfm);
update_status_bar_icon(SB_HDD | HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_MFM, 1);
break;
default:
@@ -447,7 +448,7 @@ mfm_callback(void *priv)
hdd_image_read(drive->hdd_num, addr, 1,
(uint8_t *) mfm->sector_buf);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
if (mfm->irq_dma_mask & DMA_ENA)
mfm->callback = MFM_TIME;
@@ -492,7 +493,7 @@ mfm_callback(void *priv)
hdd_image_read(drive->hdd_num, addr, 1,
(uint8_t *) mfm->sector_buf);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
mfm->state = STATE_SEND_DATA;
@@ -504,7 +505,7 @@ mfm_callback(void *priv)
}
} else {
mfm_complete(mfm);
update_status_bar_icon(SB_HDD | HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_MFM, 0);
}
break;
@@ -565,7 +566,7 @@ mfm_callback(void *priv)
hdd_image_write(drive->hdd_num, addr, 1,
(uint8_t *) mfm->sector_buf);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
next_sector(mfm);
mfm->data_pos = 0;
@@ -802,7 +803,7 @@ mfm_set_switches(mfm_t *mfm)
static void *
xebec_init(void)
xebec_init(device_t *info)
{
int i, c = 0;
@@ -856,14 +857,15 @@ xebec_available(void)
device_t mfm_xt_xebec_device = {
"IBM PC Fixed Disk Adapter",
0,
xebec_init, mfm_close, xebec_available,
NULL, NULL, NULL, NULL
0, 0,
xebec_init, mfm_close, NULL,
xebec_available, NULL, NULL, NULL,
NULL
};
static void *
dtc5150x_init(void)
dtc5150x_init(device_t *info)
{
int i, c = 0;
@@ -906,7 +908,8 @@ dtc5150x_available(void)
device_t mfm_xt_dtc5150x_device = {
"DTC 5150X",
0,
dtc5150x_init, mfm_close, dtc5150x_available,
NULL, NULL, NULL, NULL
0, 0,
dtc5150x_init, mfm_close, NULL,
dtc5150x_available, NULL, NULL, NULL,
NULL
};

View File

@@ -21,7 +21,7 @@
* already on their way out, the newer IDE standard based on the
* PC/AT controller and 16b design became the IDE we now know.
*
* Version: @(#)xtide.c 1.0.6 2017/10/10
* Version: @(#)hdc_xtide.c 1.0.7 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -126,7 +126,7 @@ xtide_read(uint16_t port, void *priv)
static void *
xtide_init(void)
xtide_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -153,7 +153,7 @@ xtide_available(void)
static void *
xtide_at_init(void)
xtide_at_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -176,7 +176,7 @@ xtide_at_available(void)
static void *
xtide_ps2_init(void)
xtide_ps2_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -203,7 +203,7 @@ xtide_ps2_available(void)
static void *
xtide_at_ps2_init(void)
xtide_at_ps2_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -237,27 +237,35 @@ xtide_close(void *priv)
device_t xtide_device = {
"XTIDE",
0,
xtide_init, xtide_close, xtide_available,
NULL, NULL, NULL, NULL
0,
xtide_init, xtide_close, NULL,
xtide_available, NULL, NULL, NULL,
NULL
};
device_t xtide_at_device = {
"XTIDE (AT)",
DEVICE_AT,
xtide_at_init, xtide_close, xtide_at_available,
NULL, NULL, NULL, NULL
0,
xtide_at_init, xtide_close, NULL,
xtide_at_available, NULL, NULL, NULL,
NULL
};
device_t xtide_ps2_device = {
"XTIDE (Acculogic)",
0,
xtide_ps2_init, xtide_close, xtide_ps2_available,
NULL, NULL, NULL, NULL
0,
xtide_ps2_init, xtide_close, NULL,
xtide_ps2_available, NULL, NULL, NULL,
NULL
};
device_t xtide_at_ps2_device = {
"XTIDE (AT) (1.1.5)",
DEVICE_PS2,
xtide_at_ps2_init, xtide_close, xtide_at_ps2_available,
NULL, NULL, NULL, NULL
0,
xtide_at_ps2_init, xtide_close, NULL,
xtide_at_ps2_available, NULL, NULL, NULL,
NULL
};

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of hard disk images.
*
* Version: @(#)hdd.c 1.0.2 2017/09/30
* Version: @(#)hdd.c 1.0.3 2017/10/05
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -23,6 +23,8 @@
#include "../cpu/cpu.h"
#include "../device.h"
#include "../machine/machine.h"
#include "../win/win.h"
#include "../win/win_language.h"
#include "hdd.h"
@@ -37,3 +39,138 @@ hdd_init(void)
return(0);
}
int
hdd_string_to_bus(char *str, int cdrom)
{
if (! strcmp(str, "none"))
return(HDD_BUS_DISABLED);
if (! strcmp(str, "mfm")) {
if (cdrom) {
no_cdrom:
msgbox_error(hwndMain, IDS_4114);
return(0);
}
return(HDD_BUS_MFM);
}
/* FIXME: delete 'rll' in a year or so.. --FvK */
if (!strcmp(str, "esdi") || !strcmp(str, "rll")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_ESDI);
}
if (! strcmp(str, "ide_pio_only"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "ide"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "atapi_pio_only"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "atapi"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "eide"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "xtide"))
return(HDD_BUS_XTIDE);
if (! strcmp(str, "atide"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "ide_pio_and_dma"))
return(HDD_BUS_IDE_PIO_AND_DMA);
if (! strcmp(str, "atapi_pio_and_dma"))
return(HDD_BUS_IDE_PIO_AND_DMA);
if (! strcmp(str, "scsi"))
return(HDD_BUS_SCSI);
if (! strcmp(str, "removable")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_SCSI_REMOVABLE);
}
if (! strcmp(str, "scsi_removable")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_SCSI_REMOVABLE);
}
if (! strcmp(str, "removable_scsi")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_SCSI_REMOVABLE);
}
if (! strcmp(str, "usb"))
msgbox_error(hwndMain, IDS_4110);
return(0);
}
char *
hdd_bus_to_string(int bus, int cdrom)
{
char *s = "none";
switch (bus) {
case HDD_BUS_DISABLED:
default:
break;
case HDD_BUS_MFM:
s = "mfm";
break;
case HDD_BUS_XTIDE:
s = "xtide";
break;
case HDD_BUS_ESDI:
s = "esdi";
break;
case HDD_BUS_IDE_PIO_ONLY:
s = cdrom ? "atapi_pio_only" : "ide_pio_only";
break;
case HDD_BUS_IDE_PIO_AND_DMA:
s = cdrom ? "atapi_pio_and_dma" : "ide_pio_and_dma";
break;
case HDD_BUS_SCSI:
s = "scsi";
break;
case HDD_BUS_SCSI_REMOVABLE:
s = "scsi_removable";
break;
}
return(s);
}
int
hdd_is_valid(int c)
{
if (hdd[c].bus == HDD_BUS_DISABLED) return(0);
if ((wcslen(hdd[c].fn) == 0) &&
(hdd[c].bus != HDD_BUS_SCSI_REMOVABLE)) return(0);
if ((hdd[c].tracks==0) || (hdd[c].hpc==0) || (hdd[c].spt==0)) return(0);
return(1);
}

View File

@@ -8,7 +8,7 @@
*
* Definitions for the hard disk image handler.
*
* Version: @(#)hdd.h 1.0.2 2017/09/30
* Version: @(#)hdd.h 1.0.3 2017/10/05
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -71,6 +71,9 @@ extern uint64_t hdd_table[128][3];
extern int hdd_init(void);
extern int hdd_string_to_bus(char *str, int cdrom);
extern char *hdd_bus_to_string(int bus, int cdrom);
extern int hdd_is_valid(int c);
extern int hdd_image_load(int id);
extern void hdd_image_seek(uint8_t id, uint32_t sector);