From 492da45c31746b41669de5cace1f73fc7a75cac0 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 22 Sep 2018 01:38:38 +0200 Subject: [PATCH] The Toshiba T1000 and T1200 FDC now has port 3F7 (the change line port), fixes booting floppies on at least the T1200. --- src/floppy/fdc.c | 16 +++++++++++++++- src/floppy/fdc.h | 4 +++- src/machine/m_xt_t1000.c | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 2b4e38514..f9856f5dd 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -9,7 +9,7 @@ * Implementation of the NEC uPD-765 and compatible floppy disk * controller. * - * Version: @(#)fdc.c 1.0.9 2018/06/12 + * Version: @(#)fdc.c 1.0.10 2018/09/22 * * Authors: Miran Grca, * Sarah Walker, @@ -2037,6 +2037,8 @@ fdc_set_base(fdc_t *fdc, int base) io_sethandler(base + 0x0002, 0x0001, NULL, NULL, NULL, fdc_write, NULL, NULL, fdc); io_sethandler(base + 0x0004, 0x0001, fdc_read, NULL, NULL, NULL, NULL, NULL, fdc); io_sethandler(base + 0x0005, 0x0001, fdc_read, NULL, NULL, fdc_write, NULL, NULL, fdc); + if (fdc->flags & FDC_FLAG_TOSHIBA) + io_sethandler(base + 0x0007, 0x0001, fdc_read, NULL, NULL, fdc_write, NULL, NULL, fdc); } fdc->base_address = base; fdc_log("fdc_t Base address set%s (%04X)\n", super_io ? " for Super I/O" : "", fdc->base_address); @@ -2056,6 +2058,8 @@ fdc_remove(fdc_t *fdc) io_removehandler(fdc->base_address + 0x0002, 0x0001, NULL, NULL, NULL, fdc_write, NULL, NULL, fdc); io_removehandler(fdc->base_address + 0x0004, 0x0001, fdc_read, NULL, NULL, NULL, NULL, NULL, fdc); io_removehandler(fdc->base_address + 0x0005, 0x0001, fdc_read, NULL, NULL, fdc_write, NULL, NULL, fdc); + if (fdc->flags & FDC_FLAG_TOSHIBA) + io_removehandler(fdc->base_address + 0x0007, 0x0001, fdc_read, NULL, NULL, fdc_write, NULL, NULL, fdc); } } @@ -2185,6 +2189,16 @@ const device_t fdc_xt_device = { NULL, NULL, NULL }; +const device_t fdc_xt_t1x00_device = { + "PC/XT Floppy Drive Controller", + 0, + FDC_FLAG_TOSHIBA, + fdc_init, + fdc_close, + fdc_reset, + NULL, NULL, NULL +}; + const device_t fdc_pcjr_device = { "PCjr Floppy Drive Controller", 0, diff --git a/src/floppy/fdc.h b/src/floppy/fdc.h index dbc3fdd0a..9158e57d8 100644 --- a/src/floppy/fdc.h +++ b/src/floppy/fdc.h @@ -9,7 +9,7 @@ * Implementation of the NEC uPD-765 and compatible floppy disk * controller. * - * Version: @(#)fdc.h 1.0.4 2018/04/12 + * Version: @(#)fdc.h 1.0.5 2018/09/22 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -49,6 +49,7 @@ #define FDC_FLAG_START_RWC_1 0x20 /* W83877F, W83977F */ #define FDC_FLAG_MORE_TRACKS 0x40 /* W83877F, W83977F, PC87306, PC87309 */ #define FDC_FLAG_NSC 0x80 /* PC87306, PC87309 */ +#define FDC_FLAG_TOSHIBA 0x100 /* T1000, T1200 */ typedef struct { @@ -183,6 +184,7 @@ extern uint8_t fdc_ps1_525(void); #ifdef EMU_DEVICE_H extern const device_t fdc_xt_device; +extern const device_t fdc_xt_t1x00_device; extern const device_t fdc_pcjr_device; extern const device_t fdc_at_device; extern const device_t fdc_at_actlow_device; diff --git a/src/machine/m_xt_t1000.c b/src/machine/m_xt_t1000.c index 73e2ea7b6..622d90b1d 100644 --- a/src/machine/m_xt_t1000.c +++ b/src/machine/m_xt_t1000.c @@ -968,7 +968,7 @@ machine_xt_t1200_init(const machine_t *model) pit_set_out_func(&pit, 1, pit_refresh_timer_xt); device_add(&keyboard_xt_device); - t1000.fdc = device_add(&fdc_xt_device); + t1000.fdc = device_add(&fdc_xt_t1x00_device); nmi_init(); tc8521_init(&t1000.nvr, model->nvrmask + 1);