Hard disc controllers can now be selected on all machines.
Added device configuration for hard disc controller to Wx GUI.
This commit is contained in:
parent
4ca6d67f87
commit
06f7cd3c6c
10 changed files with 3759 additions and 3574 deletions
79
src/hdd.c
79
src/hdd.c
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "esdi_at.h"
|
||||
#include "hdd_esdi.h"
|
||||
#include "ide.h"
|
||||
#include "mfm_at.h"
|
||||
#include "mfm_xebec.h"
|
||||
#include "xtide.h"
|
||||
|
|
@ -20,17 +21,19 @@ static struct
|
|||
char internal_name[16];
|
||||
device_t *device;
|
||||
int is_mfm;
|
||||
int is_ide;
|
||||
} hdd_controllers[] =
|
||||
{
|
||||
{"None", "none", &null_hdd_device, 0},
|
||||
{"[MFM] AT Fixed Disk Adapter", "mfm_at", &mfm_at_device, 1},
|
||||
{"[MFM] DTC 5150X", "dtc5150x", &dtc_5150x_device, 1},
|
||||
{"[MFM] Fixed Disk Adapter (Xebec)", "mfm_xebec", &mfm_xebec_device, 1},
|
||||
{"[ESDI] IBM ESDI Fixed Disk Controller", "esdi_mca", &hdd_esdi_device, 1},
|
||||
{"[ESDI] Western Digital WD1007V-SE1", "wd1007vse1", &wd1007vse1_device, 0},
|
||||
{"[IDE] XTIDE", "xtide", &xtide_device, 0},
|
||||
{"[IDE] XTIDE (AT)", "xtide_at", &xtide_at_device, 0},
|
||||
{"", "", NULL, 0}
|
||||
{"None", "none", &null_hdd_device, 0, 0},
|
||||
{"[MFM] AT Fixed Disk Adapter", "mfm_at", &mfm_at_device, 1, 0},
|
||||
{"[MFM] DTC 5150X", "dtc5150x", &dtc_5150x_device, 1, 0},
|
||||
{"[MFM] Fixed Disk Adapter (Xebec)", "mfm_xebec", &mfm_xebec_device, 1, 0},
|
||||
{"[ESDI] IBM ESDI Fixed Disk Controller", "esdi_mca", &hdd_esdi_device, 1, 0},
|
||||
{"[ESDI] Western Digital WD1007V-SE1", "wd1007vse1", &wd1007vse1_device, 0, 0},
|
||||
{"[IDE] Standard IDE", "ide", &ide_device, 0, 1},
|
||||
{"[IDE] XTIDE", "xtide", &xtide_device, 0, 1},
|
||||
{"[IDE] XTIDE (AT)", "xtide_at", &xtide_at_device, 0, 1},
|
||||
{"", "", NULL, 0, 0}
|
||||
};
|
||||
|
||||
char *hdd_controller_get_name(int hdd)
|
||||
|
|
@ -53,7 +56,7 @@ int hdd_controller_available(int hdd)
|
|||
return device_available(hdd_controllers[hdd].device);
|
||||
}
|
||||
|
||||
int hdd_controller_is_mfm(char* internal_name)
|
||||
int hdd_controller_is_mfm(char *internal_name)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
|
|
@ -70,11 +73,67 @@ int hdd_controller_is_mfm(char* internal_name)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int hdd_controller_is_ide(char *internal_name)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (hdd_controllers[c].device)
|
||||
{
|
||||
if (!strcmp(internal_name, hdd_controllers[c].internal_name))
|
||||
{
|
||||
hdd_controller_current = c;
|
||||
if (strcmp(internal_name, "none"))
|
||||
return hdd_controllers[c].is_ide;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int hdd_controller_has_config(char *internal_name)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (hdd_controllers[c].device)
|
||||
{
|
||||
if (!strcmp(internal_name, hdd_controllers[c].internal_name))
|
||||
{
|
||||
hdd_controller_current = c;
|
||||
if (strcmp(internal_name, "none"))
|
||||
return hdd_controllers[c].device->config ? 1 : 0;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
device_t *hdd_controller_get_device(char *internal_name)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (hdd_controllers[c].device)
|
||||
{
|
||||
if (!strcmp(internal_name, hdd_controllers[c].internal_name))
|
||||
{
|
||||
hdd_controller_current = c;
|
||||
if (strcmp(internal_name, "none"))
|
||||
return hdd_controllers[c].device;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int hdd_controller_current_is_mfm()
|
||||
{
|
||||
return hdd_controller_is_mfm(hdd_controller_name);
|
||||
}
|
||||
int hdd_controller_current_is_ide()
|
||||
{
|
||||
return hdd_controller_is_ide(hdd_controller_name);
|
||||
}
|
||||
|
||||
void hdd_controller_init(char *internal_name)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue