Files
86Box/src/hdd.c
OBattler f6ef1f833c Vastly overhauled the UI, there's now a completely new Settings dialog as well as a status bar with disk activity icons and removable drive menus;
Thoroughly clean up the code to vastly reduce the number of compiler warnings and found and fixed several bugs in the process;
Applied all mainline PCem commits;
Added SCSI hard disk emulation;
Commented out all unfinished machines and graphics cards;
Added the AOpen AP53 and ASUS P/I-P55T2 machines as well as another Tyan 440FX machine, all three with AMI WinBIOS (patch from TheCollector1995);
Added the Diamond Stealth 3D 3000 (S3 ViRGE/VX) graphics card (patch from TheCollector1995);
Added the PS/2 XT IDE (AccuLogic) HDD Controller (patch from TheCollector1995);
Added Microsoft/Logitech Bus Mouse emulation (patch from waltje);
Overhauled the makefiles (patch from waltje);
Added the Adaptec AHA-1542CF SCSI controller (patch from waltje);
Added preliminary (but still unfinished) Adaptec AHA-154x SCSI controller BIOS support (patch from waltje);
Added an ISABugger debugging device (patch from waltje);
Added sanity checks to the Direct3D code.
2017-05-05 01:49:42 +02:00

100 lines
2.3 KiB
C

#include "ibm.h"
#include "device.h"
#include "hdd.h"
#include "hdd_esdi.h"
#include "mfm_at.h"
#include "mfm_xebec.h"
#include "xtide.h"
char hdd_controller_name[16];
static device_t null_hdd_device;
static int hdd_controller_current;
static struct
{
char name[50];
char internal_name[16];
device_t *device;
int is_mfm;
} hdd_controllers[] =
{
{"None", "none", &null_hdd_device, 0},
{"AT Fixed Disk Adapter", "mfm_at", &mfm_at_device, 1},
{"DTC 5150X", "dtc5150x", &dtc_5150x_device, 1},
{"Fixed Disk Adapter (Xebec)", "mfm_xebec", &mfm_xebec_device, 1},
{"IBM ESDI Fixed Disk Adapter (MCA)", "esdi_mca", &hdd_esdi_device, 1},
{"XTIDE", "xtide", &xtide_device, 0},
{"XTIDE (AT)", "xtide_at", &xtide_at_device, 0},
{"XTIDE (PS/2)", "xtide_ps2",&xtide_ps2_device,0},
{"XTIDE (AT) (PS/2)", "xtide_at_ps2",&xtide_at_ps2_device,0},
{"", "", NULL, 0}
};
char *hdd_controller_get_name(int hdd)
{
return hdd_controllers[hdd].name;
}
char *hdd_controller_get_internal_name(int hdd)
{
return hdd_controllers[hdd].internal_name;
}
int hdd_controller_get_flags(int hdd)
{
return hdd_controllers[hdd].device->flags;
}
int hdd_controller_available(int hdd)
{
return device_available(hdd_controllers[hdd].device);
}
int hdd_controller_current_is_mfm()
{
return hdd_controllers[hdd_controller_current].is_mfm;
}
void hdd_controller_init(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"))
device_add(hdd_controllers[c].device);
return;
}
c++;
}
}
static void *null_hdd_init()
{
return NULL;
}
static void null_hdd_close(void *p)
{
}
static device_t null_hdd_device =
{
"Null HDD controller",
0,
null_hdd_init,
null_hdd_close,
NULL,
NULL,
NULL,
NULL,
NULL
};