From 118192e5982299c7c587899645aad668cdbd713c Mon Sep 17 00:00:00 2001 From: TC1995 Date: Tue, 16 Jun 2020 16:37:48 +0200 Subject: [PATCH] Fixed the fix. --- src/floppy/fdc.c | 14 +++++++++++++- src/include/86box/fdc_ext.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 6882fea70..5f4ce695a 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -35,7 +35,7 @@ #include <86box/ui.h> #include <86box/fdd.h> #include <86box/fdc.h> -#include <86box/fdc_ext.h> +#include <86box/fdc_pii15xb.h> extern uint64_t motoron[FDD_NUM]; @@ -144,6 +144,18 @@ static fdc_ext_t fdc_devices[] = { { NULL, NULL } }; +/* Reset the HDC, whichever one that is. */ +void +fdc_ext_reset(void) +{ + fdc_log("FDC: reset(current=%d, internal=%d)\n", + fdc_type, (machines[machine].flags & MACHINE_FDC) ? 1 : 0); + + /* If we have a valid controller, add its device. */ + if (fdc_type > 1) + device_add(fdc_devices[fdc_type].device); +} + char * fdc_ext_get_name(int fdc_ext) { diff --git a/src/include/86box/fdc_ext.h b/src/include/86box/fdc_ext.h index 735a06d88..4cb1ec686 100644 --- a/src/include/86box/fdc_ext.h +++ b/src/include/86box/fdc_ext.h @@ -31,6 +31,8 @@ extern int fdc_type; extern const device_t fdc_pii151b_device; extern const device_t fdc_pii158b_device; +extern void fdc_ext_reset(void); + extern char *fdc_ext_get_name(int fdc_ext); extern char *fdc_ext_get_internal_name(int fdc_ext); extern int fdc_ext_get_id(char *s);