src/floppy

This commit is contained in:
Jasmine Iwanek
2022-03-13 09:38:53 -04:00
parent 369f6774f9
commit 288e2ce1d2
3 changed files with 198 additions and 149 deletions

View File

@@ -102,12 +102,17 @@ fdc_log(const char *fmt, ...)
const device_t fdc_internal_device = { const device_t fdc_internal_device = {
"Internal", .name = "Internal",
"internal", .internal_name = "internal",
0, 0, .flags = 0,
NULL, NULL, NULL, .local = 0,
{ NULL }, NULL, NULL, .init = NULL,
NULL .close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
@@ -117,11 +122,13 @@ typedef const struct {
/* All emulated machines have at least one integrated FDC controller */ /* All emulated machines have at least one integrated FDC controller */
static fdc_cards_t fdc_cards[] = { static fdc_cards_t fdc_cards[] = {
{ &fdc_internal_device }, // clang-format off
{ &fdc_b215_device }, { &fdc_internal_device },
{ &fdc_pii151b_device }, { &fdc_b215_device },
{ &fdc_pii158b_device }, { &fdc_pii151b_device },
{ NULL } { &fdc_pii158b_device },
{ NULL }
// clang-format on
}; };
@@ -2382,145 +2389,183 @@ fdc_3f1_enable(fdc_t *fdc, int enable)
} }
const device_t fdc_xt_device = { const device_t fdc_xt_device = {
"PC/XT Floppy Drive Controller", .name = "PC/XT Floppy Drive Controller",
"fdc_xt", .internal_name = "fdc_xt",
0, .flags = 0,
0, .local = 0,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_xt_t1x00_device = { const device_t fdc_xt_t1x00_device = {
"PC/XT Floppy Drive Controller (Toshiba)", .name = "PC/XT Floppy Drive Controller (Toshiba)",
"fdc_xt_t1x00", .internal_name = "fdc_xt_t1x00",
0, .flags = 0,
FDC_FLAG_TOSHIBA, .local = FDC_FLAG_TOSHIBA,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_xt_amstrad_device = { const device_t fdc_xt_amstrad_device = {
"PC/XT Floppy Drive Controller (Amstrad)", .name = "PC/XT Floppy Drive Controller (Amstrad)",
"fdc_xt_amstrad", .internal_name = "fdc_xt_amstrad",
0, .flags = 0,
FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AMSTRAD, .local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AMSTRAD,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_xt_tandy_device = { const device_t fdc_xt_tandy_device = {
"PC/XT Floppy Drive Controller (Tandy)", .name = "PC/XT Floppy Drive Controller (Tandy)",
"fdc_xt_tandy", .internal_name = "fdc_xt_tandy",
0, .flags = 0,
FDC_FLAG_AMSTRAD, .local = FDC_FLAG_AMSTRAD,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_pcjr_device = { const device_t fdc_pcjr_device = {
"PCjr Floppy Drive Controller", .name = "PCjr Floppy Drive Controller",
"fdc_pcjr", .internal_name = "fdc_pcjr",
0, .flags = 0,
FDC_FLAG_PCJR, .local = FDC_FLAG_PCJR,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_at_device = { const device_t fdc_at_device = {
"PC/AT Floppy Drive Controller", .name = "PC/AT Floppy Drive Controller",
"fdc_at", .internal_name = "fdc_at",
0, .flags = 0,
FDC_FLAG_AT, .local = FDC_FLAG_AT,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_at_actlow_device = { const device_t fdc_at_actlow_device = {
"PC/AT Floppy Drive Controller (Active low)", .name = "PC/AT Floppy Drive Controller (Active low)",
"fdc_at_actlow", .internal_name = "fdc_at_actlow",
0, .flags = 0,
FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT, .local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_at_ps1_device = { const device_t fdc_at_ps1_device = {
"PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)", .name = "PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)",
"fdc_at_ps1", .internal_name = "fdc_at_ps1",
0, .flags = 0,
FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1, .local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_at_smc_device = { const device_t fdc_at_smc_device = {
"PC/AT Floppy Drive Controller (SM(s)C FDC37Cxxx)", .name = "PC/AT Floppy Drive Controller (SM(s)C FDC37Cxxx)",
"fdc_at_smc", .internal_name = "fdc_at_smc",
0, .flags = 0,
FDC_FLAG_AT | FDC_FLAG_SUPERIO, .local = FDC_FLAG_AT | FDC_FLAG_SUPERIO,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_at_winbond_device = { const device_t fdc_at_winbond_device = {
"PC/AT Floppy Drive Controller (Winbond W83x77F)", .name = "PC/AT Floppy Drive Controller (Winbond W83x77F)",
"fdc_at_winbond", .internal_name = "fdc_at_winbond",
0, .flags = 0,
FDC_FLAG_AT | FDC_FLAG_SUPERIO | FDC_FLAG_START_RWC_1 | FDC_FLAG_MORE_TRACKS, .local = FDC_FLAG_AT | FDC_FLAG_SUPERIO | FDC_FLAG_START_RWC_1 | FDC_FLAG_MORE_TRACKS,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_at_nsc_device = { const device_t fdc_at_nsc_device = {
"PC/AT Floppy Drive Controller (NSC PC8730x)", .name = "PC/AT Floppy Drive Controller (NSC PC8730x)",
"fdc_at_nsc", .internal_name = "fdc_at_nsc",
0, .flags = 0,
FDC_FLAG_AT | FDC_FLAG_MORE_TRACKS | FDC_FLAG_NSC, .local = FDC_FLAG_AT | FDC_FLAG_MORE_TRACKS | FDC_FLAG_NSC,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_dp8473_device = { const device_t fdc_dp8473_device = {
"NS DP8473 Floppy Drive Controller", .name = "NS DP8473 Floppy Drive Controller",
"fdc_dp8473", .internal_name = "fdc_dp8473",
0, .flags = 0,
FDC_FLAG_AT | FDC_FLAG_NSC, .local = FDC_FLAG_AT | FDC_FLAG_NSC,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };
const device_t fdc_um8398_device = { const device_t fdc_um8398_device = {
"UMC UM8398 Floppy Drive Controller", .name = "UMC UM8398 Floppy Drive Controller",
"fdc_um8398", .internal_name = "fdc_um8398",
0, .flags = 0,
FDC_FLAG_UMC, .local = FDC_FLAG_UMC,
fdc_init, .init = fdc_init,
fdc_close, .close = fdc_close,
fdc_reset, .reset = fdc_reset,
{ NULL }, NULL, NULL { .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
}; };

View File

@@ -126,14 +126,16 @@ static const device_config_t b215_config[] = {
}; };
const device_t fdc_b215_device = { const device_t fdc_b215_device = {
"Magitronic B215", .name = "Magitronic B215",
"b215", .internal_name = "b215",
DEVICE_ISA, .flags = DEVICE_ISA,
0, .local = 0,
b215_init, .init = b215_init,
b215_close, .close = b215_close,
NULL, .reset = NULL,
{b215_available}, { .available = b215_available },
NULL, .speed_changed = NULL,
NULL, .force_redraw = NULL,
b215_config}; .config = b215_config
};

View File

@@ -138,27 +138,29 @@ static const device_config_t pii_config[] = {
}; };
const device_t fdc_pii151b_device = { const device_t fdc_pii151b_device = {
"DTK PII-151B (MiniMicro) Floppy Drive Controller", .name = "DTK PII-151B (MiniMicro) Floppy Drive Controller",
"dtk_pii151b", .internal_name = "dtk_pii151b",
DEVICE_ISA, .flags = DEVICE_ISA,
151, .local = 151,
pii_init, .init = pii_init,
pii_close, .close = pii_close,
NULL, .reset = NULL,
{pii_151b_available}, { .available = pii_151b_available },
NULL, .speed_changed = NULL,
NULL, .force_redraw = NULL,
pii_config}; .config = pii_config
};
const device_t fdc_pii158b_device = { const device_t fdc_pii158b_device = {
"DTK PII-158B (MiniMicro4) Floppy Drive Controller", .name = "DTK PII-158B (MiniMicro4) Floppy Drive Controller",
"dtk_pii158b", .internal_name = "dtk_pii158b",
DEVICE_ISA, .flags = DEVICE_ISA,
158, .local = 158,
pii_init, .init = pii_init,
pii_close, .close = pii_close,
NULL, .reset = NULL,
{pii_158_available}, { .available = pii_158_available },
NULL, .speed_changed = NULL,
NULL, .force_redraw = NULL,
pii_config}; .config = pii_config
};