From e257569e6763a6ba91763e089cd9c8fa64440042 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 9 Feb 2025 23:40:56 -0500 Subject: [PATCH] Single Channel XTIDE support --- src/disk/hdc.c | 2 ++ src/disk/hdc_xtide.c | 44 ++++++++++++++++++++++++++++++++++++----- src/include/86box/hdc.h | 10 ++++++---- 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index f09a9a430..582c33428 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -72,7 +72,9 @@ static const struct { { &ide_isa_device }, { &ide_isa_2ch_device }, { &xtide_at_device }, + { &xtide_at_2ch_device }, { &xtide_at_ps2_device }, + { &xtide_at_ps2_2ch_device }, { &xta_wdxt150_device }, { &xtide_acculogic_device }, { &xtide_device }, diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 74abc1c4d..09e41b9ea 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -157,7 +157,10 @@ xtide_at_init(const device_t *info) device_get_bios_file(info, device_get_config_bios("bios"), 0), 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); - device_add(&ide_isa_2ch_device); + if (info->local == 1) + device_add(&ide_isa_2ch_device); + else + device_add(&ide_isa_device); return xtide; } @@ -203,7 +206,10 @@ xtide_at_ps2_init(UNUSED(const device_t *info)) rom_init(&xtide->bios_rom, ROM_PATH_PS2AT, 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); - device_add(&ide_isa_2ch_device); + if (info->local == 1) + device_add(&ide_isa_2ch_device); + else + device_add(&ide_isa_device); return xtide; } @@ -311,10 +317,24 @@ const device_t xtide_device = { }; const device_t xtide_at_device = { + .name = "PC/AT XTIDE (Primary Only)", + .internal_name = "xtide_at_1ch", + .flags = DEVICE_ISA16, + .local = 0, + .init = xtide_at_init, + .close = xtide_at_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = xtide_at_config +}; + +const device_t xtide_at_2ch_device = { .name = "PC/AT XTIDE", .internal_name = "xtide_at", .flags = DEVICE_ISA16, - .local = 0, + .local = 1, .init = xtide_at_init, .close = xtide_at_close, .reset = NULL, @@ -339,8 +359,8 @@ const device_t xtide_acculogic_device = { }; const device_t xtide_at_ps2_device = { - .name = "PS/2 AT XTIDE (1.1.5)", - .internal_name = "xtide_at_ps2", + .name = "PS/2 AT XTIDE (1.1.5) (Primary Only)", + .internal_name = "xtide_at_ps2_1ch", .flags = DEVICE_ISA16, .local = 0, .init = xtide_at_ps2_init, @@ -351,3 +371,17 @@ const device_t xtide_at_ps2_device = { .force_redraw = NULL, .config = NULL }; + +const device_t xtide_at_ps2_2ch_device = { + .name = "PS/2 AT XTIDE (1.1.5)", + .internal_name = "xtide_at_ps2", + .flags = DEVICE_ISA16, + .local = 1, + .init = xtide_at_ps2_init, + .close = xtide_at_close, + .reset = NULL, + .available = xtide_at_ps2_available, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/include/86box/hdc.h b/src/include/86box/hdc.h index 7f91fd61b..71f83e5e6 100644 --- a/src/include/86box/hdc.h +++ b/src/include/86box/hdc.h @@ -99,10 +99,12 @@ extern const device_t mcide_device; extern const device_t xta_wdxt150_device; /* xta_wdxt150 */ extern const device_t xta_hd20_device; /* EuroPC internal */ -extern const device_t xtide_device; /* xtide_xt */ -extern const device_t xtide_at_device; /* xtide_at */ -extern const device_t xtide_acculogic_device; /* xtide_ps2 */ -extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */ +extern const device_t xtide_device; /* xtide_xt */ +extern const device_t xtide_at_device; /* xtide_at */ +extern const device_t xtide_at_2ch_device; /* xtide_at_2ch */ +extern const device_t xtide_acculogic_device; /* xtide_ps2 */ +extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */ +extern const device_t xtide_at_ps2_2ch_device; /* xtide_at_ps2_2ch */ /* Miscellaneous */ extern const device_t lba_enhancer_device;