From 4cc3ba5bcd36b43f70ab002ceea6a4fca5b83036 Mon Sep 17 00:00:00 2001 From: Maxwell Scott Date: Fri, 27 Feb 2026 17:33:14 +0700 Subject: [PATCH 1/5] Added standalone HDC/FDC chips for expansion cards TODO: to add standalone UM82C86xF/UM8663/Prime 3B SIO chips for expansion cards with floppy --- src/disk/hdc.c | 81 ++++++++++++++++++++------------------ src/disk/hdc_ide_ali5213.c | 2 +- src/floppy/fdc.c | 3 ++ 3 files changed, 47 insertions(+), 39 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index eb6c3a1b3..a7e045675 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -54,49 +54,54 @@ static const struct { const device_t *device; } controllers[] = { // clang-format off - { &device_none }, - { &device_internal }, + { &device_none }, + { &device_internal }, /* ISA */ - { &xtide_acculogic_device }, - { &st506_xt_dtc5150x_device }, - { &st506_xt_xebec_device }, - { &xtide_device }, - { &st506_xt_st11_m_device }, - { &st506_xt_st11_r_device }, - { &xta_st50x_device }, - { &st506_xt_victor_v86p_device }, - { &st506_xt_wd1002a_27x_device }, - { &st506_xt_wd1002a_wx1_device }, - { &st506_xt_wd1004_27x_device }, - { &st506_xt_wd1004a_27x_device }, - { &st506_xt_wd1004a_wx1_device }, - { &xta_wdxt150_device }, - { &st506_xt_wdxt_gen_device }, + { &xtide_acculogic_device }, + { &st506_xt_dtc5150x_device }, + { &st506_xt_xebec_device }, + { &xtide_device }, + { &st506_xt_st11_m_device }, + { &st506_xt_st11_r_device }, + { &xta_st50x_device }, + { &st506_xt_victor_v86p_device }, + { &st506_xt_wd1002a_27x_device }, + { &st506_xt_wd1002a_wx1_device }, + { &st506_xt_wd1004_27x_device }, + { &st506_xt_wd1004a_27x_device }, + { &st506_xt_wd1004a_wx1_device }, + { &xta_wdxt150_device }, + { &st506_xt_wdxt_gen_device }, /* ISA16 */ - { &ide_isa_device }, - { &ide_isa_2ch_device }, - { &xtide_at_device }, - { &xtide_at_2ch_device }, - { &xtide_at_ps2_device }, - { &xtide_at_ps2_2ch_device }, - { &ide_ter_device }, - { &ide_qua_device }, - { &st506_at_wd1003_device }, - { &esdi_at_wd1007vse1_device }, + { &ide_isa_device }, + { &ide_isa_2ch_device }, + { &xtide_at_device }, + { &xtide_at_2ch_device }, + { &xtide_at_ps2_device }, + { &xtide_at_ps2_2ch_device }, + { &ide_ter_device }, + { &ide_qua_device }, + { &st506_at_wd1003_device }, + { &esdi_at_wd1007vse1_device }, /* MCA */ - { &esdi_ps2_device }, - { &esdi_integrated_device }, - { &mcide_device }, + { &esdi_ps2_device }, + { &esdi_integrated_device }, + { &mcide_device }, /* VLB */ - { &ide_vlb_device }, - { &ide_vlb_2ch_device }, + { &ide_ali5213_device }, + { &ide_cmd640_vlb_device }, + { &ide_opti611_vlb_device }, + { &ide_vlb_device }, + { &ide_vlb_2ch_device }, /* PCI */ - { &ide_cmd646_ter_qua_device }, - { &ide_cmd648_ter_qua_device }, - { &ide_cmd649_ter_qua_device }, - { &ide_pci_device }, - { &ide_pci_2ch_device }, - { NULL } + { &ide_cmd640_pci_device }, + { &ide_cmd640_pci_single_channel_device }, + { &ide_cmd646_ter_qua_device }, + { &ide_cmd648_ter_qua_device }, + { &ide_cmd649_ter_qua_device }, + { &ide_pci_device }, + { &ide_pci_2ch_device }, + { NULL } // clang-format on }; diff --git a/src/disk/hdc_ide_ali5213.c b/src/disk/hdc_ide_ali5213.c index ff837cbc6..a64aae170 100644 --- a/src/disk/hdc_ide_ali5213.c +++ b/src/disk/hdc_ide_ali5213.c @@ -253,7 +253,7 @@ const device_t ide_ali1489_device = { const device_t ide_ali5213_device = { .name = "ALi M5213", .internal_name = "ali5213", - .flags = 0, + .flags = DEVICE_VLB, .local = 0, .init = ali5213_init, .close = ali5213_close, diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index cfc51f2b0..5a4df85dd 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -108,7 +108,10 @@ static fdc_cards_t fdc_cards[] = { { &device_none }, { &device_internal }, { &fdc_xt_device }, + { &fdc_xt_umc_um8398_device }, { &fdc_at_device }, + { &fdc_at_nsc_dp8473_device }, + { &fdc_at_smc_device }, { &fdc_b215_device }, { &fdc_pii151b_device }, { &fdc_pii158b_device }, From 0dbbf55984514f09c43604f4909c13ff0015e818 Mon Sep 17 00:00:00 2001 From: Maxwell Scott Date: Sat, 28 Feb 2026 00:30:46 +0700 Subject: [PATCH 2/5] Some HDC/FDC related changes for midnight 1. Added the NSC floppy controller (TODO: to add PC87311 SIO & floppy controller) 2. Removed CMD-640 PCI (Single Channel) IDE controller 3. Alphabetized OPTI 82c611 IDE controller --- src/disk/hdc.c | 3 +-- src/floppy/fdc.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index a7e045675..a63573823 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -90,12 +90,11 @@ static const struct { /* VLB */ { &ide_ali5213_device }, { &ide_cmd640_vlb_device }, - { &ide_opti611_vlb_device }, { &ide_vlb_device }, { &ide_vlb_2ch_device }, + { &ide_opti611_vlb_device }, /* PCI */ { &ide_cmd640_pci_device }, - { &ide_cmd640_pci_single_channel_device }, { &ide_cmd646_ter_qua_device }, { &ide_cmd648_ter_qua_device }, { &ide_cmd649_ter_qua_device }, diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 5a4df85dd..6e2c88a44 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -111,6 +111,7 @@ static fdc_cards_t fdc_cards[] = { { &fdc_xt_umc_um8398_device }, { &fdc_at_device }, { &fdc_at_nsc_dp8473_device }, + { &fdc_at_nsc_device }, /* TODO: PC87311 SIO & floppy controller */ { &fdc_at_smc_device }, { &fdc_b215_device }, { &fdc_pii151b_device }, From 085d501345e02e4d978cb7df119ec9902db9997e Mon Sep 17 00:00:00 2001 From: Maxwell Scott Date: Sat, 28 Feb 2026 00:59:57 +0700 Subject: [PATCH 3/5] Added forgotten Winbond FDC --- src/floppy/fdc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 6e2c88a44..d9f28eec4 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -113,6 +113,7 @@ static fdc_cards_t fdc_cards[] = { { &fdc_at_nsc_dp8473_device }, { &fdc_at_nsc_device }, /* TODO: PC87311 SIO & floppy controller */ { &fdc_at_smc_device }, + { &fdc_at_winbond_device }, { &fdc_b215_device }, { &fdc_pii151b_device }, { &fdc_pii158b_device }, From 8300881e71935454047e2b914f3377c201de6f29 Mon Sep 17 00:00:00 2001 From: Maxwell Scott Date: Sat, 28 Feb 2026 03:53:38 +0700 Subject: [PATCH 4/5] Replaced M5213 VLB with UM8673F PCI As for M5213, I have added an TODO note. --- src/disk/hdc.c | 5 ++++- src/disk/hdc_ide_ali5213.c | 2 +- src/disk/hdc_ide_um8673f.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index a63573823..3540e738c 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -88,7 +88,9 @@ static const struct { { &esdi_integrated_device }, { &mcide_device }, /* VLB */ - { &ide_ali5213_device }, +#if 0 + { &ide_ali5213_device }, /* TODO: to add standalone ADI2 HDC */ +#endif { &ide_cmd640_vlb_device }, { &ide_vlb_device }, { &ide_vlb_2ch_device }, @@ -100,6 +102,7 @@ static const struct { { &ide_cmd649_ter_qua_device }, { &ide_pci_device }, { &ide_pci_2ch_device }, + { &ide_um8673f_device }, { NULL } // clang-format on }; diff --git a/src/disk/hdc_ide_ali5213.c b/src/disk/hdc_ide_ali5213.c index a64aae170..ff837cbc6 100644 --- a/src/disk/hdc_ide_ali5213.c +++ b/src/disk/hdc_ide_ali5213.c @@ -253,7 +253,7 @@ const device_t ide_ali1489_device = { const device_t ide_ali5213_device = { .name = "ALi M5213", .internal_name = "ali5213", - .flags = DEVICE_VLB, + .flags = 0, .local = 0, .init = ali5213_init, .close = ali5213_close, diff --git a/src/disk/hdc_ide_um8673f.c b/src/disk/hdc_ide_um8673f.c index b40595750..b8b4d2f09 100644 --- a/src/disk/hdc_ide_um8673f.c +++ b/src/disk/hdc_ide_um8673f.c @@ -200,7 +200,7 @@ const device_t ide_um8886af_device = { const device_t ide_um8673f_device = { .name = "UMC UM8673F", .internal_name = "um8673f", - .flags = 0, + .flags = DEVICE_PCI, .local = 0, .init = um8673f_init, .close = um8673f_close, From 28bc6b9c23a60056246fa74483c408ae9e2d8c83 Mon Sep 17 00:00:00 2001 From: Maxwell Scott Date: Sat, 28 Feb 2026 04:53:55 +0700 Subject: [PATCH 5/5] Removed standalone UM8673F It's not working --- src/disk/hdc.c | 1 - src/disk/hdc_ide_um8673f.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index 3540e738c..ad56a39d4 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -102,7 +102,6 @@ static const struct { { &ide_cmd649_ter_qua_device }, { &ide_pci_device }, { &ide_pci_2ch_device }, - { &ide_um8673f_device }, { NULL } // clang-format on }; diff --git a/src/disk/hdc_ide_um8673f.c b/src/disk/hdc_ide_um8673f.c index b8b4d2f09..b40595750 100644 --- a/src/disk/hdc_ide_um8673f.c +++ b/src/disk/hdc_ide_um8673f.c @@ -200,7 +200,7 @@ const device_t ide_um8886af_device = { const device_t ide_um8673f_device = { .name = "UMC UM8673F", .internal_name = "um8673f", - .flags = DEVICE_PCI, + .flags = 0, .local = 0, .init = um8673f_init, .close = um8673f_close,