Add WD1004 series of XT HDD controllers

This commit is contained in:
Jasmine Iwanek
2022-03-13 10:21:21 -04:00
parent c195b348a7
commit e54d136e3b
3 changed files with 181 additions and 0 deletions

View File

@@ -112,9 +112,12 @@ static const struct {
{ &st506_xt_dtc5150x_device },
{ &st506_xt_st11_m_device },
{ &st506_xt_wd1002a_wx1_device },
{ &st506_xt_wd1004a_wx1_device },
{ &st506_at_wd1003_device },
{ &st506_xt_st11_r_device },
{ &st506_xt_wd1002a_27x_device },
{ &st506_xt_wd1004_27x_device },
{ &st506_xt_wd1004a_27x_device },
{ &esdi_at_wd1007vse1_device },
{ &ide_isa_device },
{ &ide_isa_2ch_device },

View File

@@ -96,10 +96,13 @@
#define ST11_BIOS_FILE_OLD "roms/hdd/st506/st11_bios_vers_1.7.bin"
#define ST11_BIOS_FILE_NEW "roms/hdd/st506/st11_bios_vers_2.0.bin"
#define WD1002A_WX1_BIOS_FILE "roms/hdd/st506/wd1002a_wx1-62-000094-032.bin"
#define WD1004A_WX1_BIOS_FILE "roms/hdd/st506/wd1002a_wx1-62-000094-032.bin"
/* SuperBIOS was for both the WX1 and 27X, users jumpers readout to determine
if to use 26 sectors per track, 26 -> 17 sectors per track translation, or
17 sectors per track. */
#define WD1002A_27X_BIOS_FILE "roms/hdd/st506/wd1002a_27x-62-000094-032.bin"
#define WD1004_27X_BIOS_FILE "roms/hdd/st506/western_digital_WD1004A-27X.bin"
#define WD1004A_27X_BIOS_FILE "roms/hdd/st506/western_digital_WD1004A-27X.bin"
#define ST506_TIME (250 * TIMER_USEC)
@@ -1614,6 +1617,24 @@ wd1002a_27x_available(void)
return(rom_present(WD1002A_27X_BIOS_FILE));
}
static int
wd1004a_wx1_available(void)
{
return(rom_present(WD1004A_WX1_BIOS_FILE));
}
static int
wd1004_27x_available(void)
{
return(rom_present(WD1004_27X_BIOS_FILE));
}
static int
wd1004a_27x_available(void)
{
return(rom_present(WD1004A_27X_BIOS_FILE));
}
// clang-format off
static const device_config_t dtc_config[] = {
{
@@ -1734,6 +1755,118 @@ static const device_config_t wd_rll_config[] = {
},
{ "", "", -1 }
};
static const device_config_t wd1004a_config[] = {
{
.name = "bios_addr",
.description = "BIOS address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "" }
}
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "" }
}
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
{ .name = "", .description = "", .type = -1 }
};
static const device_config_t wd1004_rll_config[] = {
{
.name = "bios_addr",
.description = "BIOS address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CA00H", .value = 0xca000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "CE00H", .value = 0xce000 },
{ .description = "" }
}
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "328H", .value = 0x0328 },
{ .description = "32CH", .value = 0x032c },
{ .description = "" }
}
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
{
.name = "translate",
.description = "Translate 26 -> 17",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "Off", .value = 0 },
{ .description = "On", .value = 1 },
{ .description = "" }
}
},
{ .name = "", .description = "", .type = -1 }
};
// clang-format on
const device_t st506_xt_xebec_device = {
@@ -1819,3 +1952,45 @@ const device_t st506_xt_wd1002a_27x_device = {
.force_redraw = NULL,
.config = wd_rll_config
};
const device_t st506_xt_wd1004a_wx1_device = {
.name = "WD1004A-WX1 MFM Fixed Disk Adapter",
.internal_name = "st506_xt_wd1004a_wx1",
.flags = DEVICE_ISA,
.local = (HDD_BUS_MFM << 8) | 21,
.init = st506_init,
.close = st506_close,
.reset = NULL,
{ wd1004a_wx1_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = wd1004a_config
};
const device_t st506_xt_wd1004_27x_device = {
.name = "WD1004-27X RLL Fixed Disk Adapter",
.internal_name = "st506_xt_wd1004_27x",
.flags = DEVICE_ISA,
.local = (HDD_BUS_MFM << 8) | 22,
.init = st506_init,
.close = st506_close,
.reset = NULL,
{ .available = wd1004_27x_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = wd1004_rll_config
};
const device_t st506_xt_wd1004a_27x_device = {
.name = "WD1004a-27X RLL Fixed Disk Adapter",
.internal_name = "st506_xt_wd1004a_27x",
.flags = DEVICE_ISA,
.local = (HDD_BUS_MFM << 8) | 22,
.init = st506_init,
.close = st506_close,
.reset = NULL,
{ .available = wd1004a_27x_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = wd_rll_config
};

View File

@@ -39,6 +39,9 @@ extern const device_t st506_xt_st11_r_device; /* st506_xt_st11_m */
extern const device_t st506_xt_wd1002a_wx1_device; /* st506_xt_wd1002a_wx1 */
extern const device_t st506_xt_wd1002a_27x_device; /* st506_xt_wd1002a_27x */
extern const device_t st506_at_wd1003_device; /* st506_at_wd1003 */
extern const device_t st506_xt_wd1004a_wx1_device; /* st506_xt_wd1004a_wx1 */
extern const device_t st506_xt_wd1004_27x_device; /* st506_xt_wd1004_27x */
extern const device_t st506_xt_wd1004a_27x_device; /* st506_xt_wd1004a_27x */
extern const device_t esdi_at_wd1007vse1_device; /* esdi_at */
extern const device_t esdi_ps2_device; /* esdi_mca */