From f62fc73862b2f771ba19dc77d14c1c174ee3755e Mon Sep 17 00:00:00 2001 From: TC1995 Date: Wed, 17 Jun 2020 00:32:48 +0200 Subject: [PATCH] (Re-)added the Deskpro 386, but only in the development/incomplete section of the code definitions. Selected XT and AT clones can use either their built-in FDC controller or an external one (the IBM AT and Compaq AT machines don't support booting from a 1.44M floppy so this makes the external floppy useful). Added the FDC to the Adaptec AHA-154xCF ("2" variant) and defaulted to None to keep compatibility with existing FDC's. --- src/config.c | 29 ++++---- src/cpu/cpu.h | 1 + src/cpu/cpu_table.c | 10 +++ src/floppy/fdc.c | 33 +++------ src/floppy/fdc_pii15xb.c | 24 ++---- src/include/86box/fdc_ext.h | 3 +- src/include/86box/machine.h | 3 +- src/include/86box/scsi_x54x.h | 4 +- src/machine/m_at.c | 4 +- src/machine/m_at_compaq.c | 32 +++++++- src/machine/m_tandy.c | 5 +- src/machine/m_xt.c | 5 +- src/machine/m_xt_compaq.c | 4 +- src/machine/m_xt_zenith.c | 7 +- src/machine/machine_table.c | 3 +- src/scsi/scsi_aha154x.c | 136 +++++++++++++++++++++++++++++++++- src/scsi/scsi_buslogic.c | 2 + src/scsi/scsi_x54x.c | 2 + src/win/86Box.rc | 4 +- src/win/win_settings.c | 1 - 20 files changed, 235 insertions(+), 77 deletions(-) diff --git a/src/config.c b/src/config.c index 5aea7fe5b..bd4ddb40c 100644 --- a/src/config.c +++ b/src/config.c @@ -784,24 +784,21 @@ load_other_peripherals(void) else scsi_card_current = 0; - if (machines[machine].flags & MACHINE_FDC_FIXED) { - config_delete_var(cat, "fdc"); + p = config_get_string(cat, "fdc", NULL); + if (p == NULL) { + p = (char *)malloc((strlen("internal")+1)*sizeof(char)); + strcpy(p, "internal"); + free_p = 1; + } + + if (!strcmp(p, "internal")) fdc_type = FDC_INTERNAL; - } else { - p = config_get_string(cat, "fdc", NULL); - if (p == NULL) { - if (machines[machine].flags & MACHINE_FDC) { - p = (char *)malloc((strlen("internal")+1)*sizeof(char)); - strcpy(p, "internal"); - } else { - p = (char *)malloc((strlen("none")+1)*sizeof(char)); - strcpy(p, "none"); - } - free_p = 1; - } + else fdc_type = fdc_ext_get_from_internal_name(p); - if (free_p) - free(p); + + if (free_p) { + free(p); + p = NULL; } p = config_get_string(cat, "hdc", NULL); diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 567b40fc0..985696b53 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -128,6 +128,7 @@ extern CPU cpus_8086[]; extern CPU cpus_286[]; extern CPU cpus_i386SX[]; extern CPU cpus_i386DX[]; +extern CPU cpus_i386DX_Compaq[]; extern CPU cpus_Am386SX[]; extern CPU cpus_Am386DX[]; extern CPU cpus_486SLC[]; diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 82f99b3ab..d6939f78e 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -186,6 +186,16 @@ CPU cpus_i386DX[] = { {"", -1, 0, 0, 0, 0, 0, 0, 0,0,0,0, 0} }; +CPU cpus_i386DX_Compaq[] = { + /*i386DX/RapidCAD*/ + {"i386DX/16", CPU_386DX, fpus_80286, 16000000, 1, 0x0308, 0, 0, 0, 3,3,3,3, 2}, + {"i386DX/20", CPU_386DX, fpus_80286, 20000000, 1, 0x0308, 0, 0, 0, 4,4,3,3, 3}, + {"i386DX/25", CPU_386DX, fpus_80286, 25000000, 1, 0x0308, 0, 0, 0, 4,4,3,3, 3}, + {"i386DX/33", CPU_386DX, fpus_80286, 33333333, 1, 0x0308, 0, 0, 0, 6,6,3,3, 4}, + {"i386DX/40", CPU_386DX, fpus_80286, 40000000, 1, 0x0308, 0, 0, 0, 7,7,3,3, 5}, + {"", -1, 0, 0, 0, 0, 0, 0, 0,0,0,0, 0} +}; + CPU cpus_Am386SX[] = { /*Am386SX*/ {"Am386SX/16", CPU_386SX, fpus_80386, 16000000, 1, 0x2308, 0, 0, 0, 3,3,3,3, 2}, diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 94d588bd6..bea1c86f3 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -115,21 +115,15 @@ fdc_log(const char *fmt, ...) typedef struct { + const char *name; const char *internal_name; const device_t *device; } fdc_ext_t; -static const device_t fdc_none_device = { - "None", - 0, FDC_NONE, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL -}; static const device_t fdc_internal_device = { "Internal Floppy Drive Controller", - 0, FDC_INTERNAL, + 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL @@ -137,29 +131,25 @@ static const device_t fdc_internal_device = { static fdc_ext_t fdc_devices[] = { - { "none", &fdc_none_device }, - { "internal", &fdc_internal_device }, - { "dtk_pii151b", &fdc_pii151b_device }, - { "dtk_pii158b", &fdc_pii158b_device }, - { NULL, NULL } + { "Internal controller", "internal", &fdc_internal_device }, + { "DTK PII-151B", "dtk_pii151b", &fdc_pii151b_device }, + { "DTK PII-158B", "dtk_pii158b", &fdc_pii158b_device }, + { "", NULL, NULL } }; -/* Reset the HDC, whichever one that is. */ +/* Reset the FDC, 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) + if (fdc_type > 0) device_add(fdc_devices[fdc_type].device); } char * fdc_ext_get_name(int fdc_ext) { - return((char *)fdc_devices[fdc_ext].device->name); + return((char *)fdc_devices[fdc_ext].name); } @@ -174,9 +164,9 @@ fdc_ext_get_id(char *s) { int c = 0; - while (strlen((char *) fdc_devices[c].internal_name)) + while (strlen((char *) fdc_devices[c].name)) { - if (!strcmp((char *) fdc_devices[c].internal_name, s)) + if (!strcmp((char *) fdc_devices[c].name, s)) return c; c++; } @@ -2253,7 +2243,6 @@ fdc_init(const device_t *info) memset(fdc, 0, sizeof(fdc_t)); fdc->flags = info->local; - fdc_reset(fdc); fdc->irq = 6; diff --git a/src/floppy/fdc_pii15xb.c b/src/floppy/fdc_pii15xb.c index b41f2e9e1..55dd55460 100644 --- a/src/floppy/fdc_pii15xb.c +++ b/src/floppy/fdc_pii15xb.c @@ -71,8 +71,8 @@ #include <86box/fdc.h> #include <86box/fdc_ext.h> -#define ROM_PII_151B L"floppy/dtk/pii-151b.rom" -#define ROM_PII_158B L"floppy/dtk/pii-158b.rom" +#define ROM_PII_151B L"roms/floppy/dtk/pii-151b.rom" +#define ROM_PII_158B L"roms/floppy/dtk/pii-158b.rom" typedef struct { const char *name; @@ -81,8 +81,8 @@ typedef struct { uint32_t bios_addr, bios_size; rom_t bios_rom; - - fdc_t *fdc; + + fdc_t *fdc; } pii_t; @@ -145,7 +145,7 @@ pii_init(const device_t *info) } /* Attach the DP8473 chip. */ - dev->fdc = device_add(&fdc_dp8473_device); + dev->fdc = device_add(&fdc_at_device); //pclog("FDC: %s (I/O=%04X, flags=%08x)\n", // info->name, dev->fdc->base_address, dev->fdc->flags); @@ -184,20 +184,6 @@ static const device_config_t pii_config[] = { } } }, - { - "speed", "Drive Speed", CONFIG_SELECTION, "", 0, - { - { - "Single", 0 - }, - { - "Dual", 1 - }, - { - "" - } - } - }, { "", "", -1 } diff --git a/src/include/86box/fdc_ext.h b/src/include/86box/fdc_ext.h index 4cb1ec686..d92bba9de 100644 --- a/src/include/86box/fdc_ext.h +++ b/src/include/86box/fdc_ext.h @@ -25,8 +25,7 @@ extern int fdc_type; /* Controller types. */ -#define FDC_NONE 0 -#define FDC_INTERNAL 1 +#define FDC_INTERNAL 0 extern const device_t fdc_pii151b_device; extern const device_t fdc_pii158b_device; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index d8caefefb..b745f757e 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -41,7 +41,6 @@ #define MACHINE_SOUND 0x010000 /* sys has int sound */ #define MACHINE_NONMI 0x020000 /* sys does not have NMI's */ #define MACHINE_FDC 0x040000 /* sys has int FDC */ -#define MACHINE_FDC_FIXED 0x080000 /* sys has ONLY int FDC */ #else #define MACHINE_PC 0x000000 /* PC architecture */ #define MACHINE_AT 0x000001 /* PC/AT architecture */ @@ -60,7 +59,6 @@ #define MACHINE_SOUND 0x010000 /* sys has int sound */ #define MACHINE_NONMI 0x020000 /* sys does not have NMI's */ #define MACHINE_FDC 0x040000 /* sys has int FDC */ -#define MACHINE_FDC_FIXED 0x080000 /* sys has ONLY int FDC */ #endif #define IS_ARCH(m, a) (machines[(m)].flags & (a)) ? 1 : 0; @@ -282,6 +280,7 @@ extern int machine_at_cmdpc_init(const machine_t *); extern int machine_at_portableii_init(const machine_t *); extern int machine_at_portableiii_init(const machine_t *); extern int machine_at_portableiii386_init(const machine_t *); +extern int machine_at_deskpro386_init(const machine_t *); #ifdef EMU_DEVICE_H extern const device_t *at_cpqiii_get_device(void); #endif diff --git a/src/include/86box/scsi_x54x.h b/src/include/86box/scsi_x54x.h index 175fdfe6c..6c8164902 100644 --- a/src/include/86box/scsi_x54x.h +++ b/src/include/86box/scsi_x54x.h @@ -423,7 +423,7 @@ typedef struct { PendingInterrupt, Lock, target_data_len, pad0; - uint32_t Base, rom_addr, /* address of BIOS ROM */ + uint32_t Base, fdc_address, rom_addr, /* address of BIOS ROM */ CmdParamLeft, Outgoing, transfer_size; @@ -486,6 +486,8 @@ typedef struct { pc_timer_t timer, ResetCB; Req_t Req; + + fdc_t *fdc; } x54x_t; diff --git a/src/machine/m_at.c b/src/machine/m_at.c index 90f4fc40c..7adc98ecd 100644 --- a/src/machine/m_at.c +++ b/src/machine/m_at.c @@ -49,6 +49,7 @@ #include <86box/device.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/nvr.h> #include <86box/gameport.h> #include <86box/keyboard.h> @@ -102,7 +103,8 @@ machine_at_ibm_common_init(const machine_t *model) mem_remap_top(384); - device_add(&fdc_at_device); + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_at_device); } diff --git a/src/machine/m_at_compaq.c b/src/machine/m_at_compaq.c index 7cd3f254e..6601d9399 100644 --- a/src/machine/m_at_compaq.c +++ b/src/machine/m_at_compaq.c @@ -33,6 +33,7 @@ #include <86box/device.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/hdc.h> #include <86box/hdc_ide.h> #include <86box/machine.h> @@ -45,7 +46,8 @@ enum { COMPAQ_PORTABLEII = 0, COMPAQ_PORTABLEIII, - COMPAQ_PORTABLEIII386 + COMPAQ_PORTABLEIII386, + COMPAQ_DESKPRO386 }; #define CGA_RGB 0 @@ -809,9 +811,11 @@ machine_at_compaq_init(const machine_t *model, int type) { machine_at_init(model); - mem_remap_top(384); + if (type != COMPAQ_DESKPRO386) + mem_remap_top(384); - device_add(&fdc_at_device); + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_at_device); mem_mapping_add(&ram_mapping, 0xfa0000, 0x60000, read_ram, read_ramw, read_raml, @@ -833,6 +837,11 @@ machine_at_compaq_init(const machine_t *model, int type) if (gfxcard == VID_INTERNAL) device_add(&compaq_plasma_device); break; + + case COMPAQ_DESKPRO386: + if (hdc_current == 1) + device_add(&ide_isa_device); + break; } } @@ -889,3 +898,20 @@ machine_at_portableiii386_init(const machine_t *model) return ret; } + +int +machine_at_deskpro386_init(const machine_t *model) +{ + int ret; + + ret = bios_load_interleavedr(L"roms/machines/deskpro386/109592-005.U11.bin", + L"roms/machines/deskpro386/109591-005.U13.bin", + 0x000f8000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_compaq_init(model, COMPAQ_DESKPRO386); + + return ret; +} \ No newline at end of file diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index 3fee77bba..26777dc77 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -35,6 +35,7 @@ #include <86box/nvr.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/gameport.h> #include <86box/keyboard.h> #include <86box/sound.h> @@ -1495,7 +1496,8 @@ machine_tandy1k_init(const machine_t *model, int type) device_add(&keyboard_tandy_device); keyboard_set_table(scancode_tandy); - device_add(&fdc_xt_device); + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_xt_device); switch(type) { case TYPE_TANDY: @@ -1524,6 +1526,7 @@ machine_tandy1k_init(const machine_t *model, int type) device_add_ex(&vid_device_sl, dev); device_add(&pssj_device); device_add(&eep_1000sl2_device); + break; } if (joystick_type != JOYSTICK_TYPE_NONE) diff --git a/src/machine/m_xt.c b/src/machine/m_xt.c index 0cbf071d1..a34fe5b38 100644 --- a/src/machine/m_xt.c +++ b/src/machine/m_xt.c @@ -10,6 +10,7 @@ #include <86box/device.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/gameport.h> #include <86box/ibm_5161.h> #include <86box/keyboard.h> @@ -24,7 +25,9 @@ machine_xt_common_init(const machine_t *model) pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt); - device_add(&fdc_xt_device); + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_xt_device); + nmi_init(); if (joystick_type != JOYSTICK_TYPE_NONE) device_add(&gameport_device); diff --git a/src/machine/m_xt_compaq.c b/src/machine/m_xt_compaq.c index 575500ffb..1b84a10de 100644 --- a/src/machine/m_xt_compaq.c +++ b/src/machine/m_xt_compaq.c @@ -31,6 +31,7 @@ #include <86box/device.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/gameport.h> #include <86box/keyboard.h> #include <86box/lpt.h> @@ -53,7 +54,8 @@ machine_xt_compaq_init(const machine_t *model) pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt); device_add(&keyboard_xt_compaq_device); - device_add(&fdc_xt_device); + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_xt_device); nmi_init(); if (joystick_type != JOYSTICK_TYPE_NONE) device_add(&gameport_device); diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index 0d527d20b..c0448bd09 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -36,6 +36,7 @@ #include <86box/device.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/gameport.h> #include <86box/keyboard.h> #include <86box/lpt.h> @@ -116,8 +117,10 @@ machine_xt_zenith_init(const machine_t *model) return ret; machine_common_init(model); - - device_add(&fdc_xt_device); + + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_xt_device); + lpt1_remove(); /* only one parallel port */ lpt2_remove(); lpt1_init(0x278); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index f45611935..390a90703 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -88,7 +88,7 @@ const machine_t machines[] = { /* 8088 Machines */ { "[8088] IBM PC (1981)", "ibmpc", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 16, 64, 16, 0, machine_pc_init, NULL }, { "[8088] IBM PC (1982)", "ibmpc82", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 256, 256, 256, 0, machine_pc82_init, NULL }, - { "[8088] IBM PCjr", "ibmpcjr", MACHINE_TYPE_8088, {{"Intel", cpus_pcjr}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED, 128, 640, 128, 0, machine_pcjr_init, pcjr_get_device }, + { "[8088] IBM PCjr", "ibmpcjr", MACHINE_TYPE_8088, {{"Intel", cpus_pcjr}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_VIDEO | MACHINE_VIDEO_FIXED, 128, 640, 128, 0, machine_pcjr_init, pcjr_get_device }, { "[8088] IBM XT (1982)", "ibmxt", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 64, 256, 64, 0, machine_xt_init, NULL }, { "[8088] IBM XT (1986)", "ibmxt86", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 256, 640, 64, 0, machine_xt86_init, NULL }, { "[8088] AMI XT clone", "amixt", MACHINE_TYPE_8088, {{"Intel", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA, 64, 640, 64, 0, machine_xt_amixt_init, NULL }, @@ -178,6 +178,7 @@ const machine_t machines[] = { /* 386DX machines */ { "[ACC 2168] AMI 386DX clone", "acc386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 512, 16384, 128, 127, machine_at_acc386_init, NULL }, { "[SiS Rabbit] ASUS 386DX ISA", "asus386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 512, 16384, 128, 127, machine_at_asus386_init, NULL }, + { "[ISA] Compaq Deskpro 386", "deskpro386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX_Compaq}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 1, 14, 1, 127, machine_at_deskpro386_init, NULL }, { "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_VIDEO, 1, 14, 1, 127, machine_at_portableiii386_init, at_cpqiii_get_device }, { "[ISA] Micronics 386 clone", "micronics386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 512, 8192, 128, 127, machine_at_micronics386_init, NULL }, { "[C&T 386] ECS 386/32", "ecs386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 1, 16, 1, 127, machine_at_ecs386_init, NULL }, diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index e8342ad90..8e50864e1 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -36,6 +36,8 @@ #include <86box/dma.h> #include <86box/pic.h> #include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #include <86box/scsi.h> #include <86box/scsi_aha154x.h> #include <86box/scsi_x54x.h> @@ -187,6 +189,13 @@ aha154x_eeprom(x54x_t *dev, uint8_t cmd,uint8_t arg,uint8_t len,uint8_t off,uint r = 0; aha_eeprom_save(dev); + + if (dev->type == AHA_154xCF) { + if (dev->fdc_address > 0) { + fdc_remove(dev->fdc); + fdc_set_base(dev->fdc, dev->fdc_address); + } + } } if (cmd == 0x23) { @@ -702,6 +711,8 @@ aha_initnvr(x54x_t *dev) /* Initialize the on-board EEPROM. */ dev->nvr[0] = dev->HostID; /* SCSI ID 7 */ dev->nvr[0] |= (0x10 | 0x20 | 0x40); + if (dev->fdc_address == 0x370) + dev->nvr[0] |= EE0_ALTFLOP; dev->nvr[1] = dev->Irq-9; /* IRQ15 */ dev->nvr[1] |= (dev->DmaChannel<<4); /* DMA6 */ dev->nvr[2] = (EE2_HABIOS | /* BIOS enabled */ @@ -757,6 +768,10 @@ aha_init(const device_t *info) dev->Irq = device_get_config_int("irq"); dev->DmaChannel = device_get_config_int("dma"); dev->rom_addr = device_get_config_hex20("bios_addr"); + if (!(dev->bus & DEVICE_MCA)) + dev->fdc_address = device_get_config_hex16("fdc_addr"); + else + dev->fdc_address = 0; dev->HostID = 7; /* default HA ID */ dev->setup_info_len = sizeof(aha_setup_t); dev->max_id = 7; @@ -834,6 +849,8 @@ aha_init(const device_t *info) dev->ven_get_irq = aha_get_irq; /* function to return IRQ from EEPROM */ dev->ven_get_dma = aha_get_dma; /* function to return DMA channel from EEPROM */ dev->ha_bps = 10000000.0; /* fast SCSI */ + if (dev->fdc_address > 0) + dev->fdc = device_add(&fdc_at_device); break; case AHA_154xCP: @@ -1022,7 +1039,6 @@ static const device_config_t aha_154xb_config[] = { } }; - static const device_config_t aha_154x_config[] = { { "base", "Address", CONFIG_HEX16, "", 0x334, @@ -1122,6 +1138,122 @@ static const device_config_t aha_154x_config[] = { }; +static const device_config_t aha_154xcf_config[] = { + { + "base", "Address", CONFIG_HEX16, "", 0x334, + { + { + "None", 0 + }, + { + "0x330", 0x330 + }, + { + "0x334", 0x334 + }, + { + "0x230", 0x230 + }, + { + "0x234", 0x234 + }, + { + "0x130", 0x130 + }, + { + "0x134", 0x134 + }, + { + "" + } + }, + }, + { + "irq", "IRQ", CONFIG_SELECTION, "", 9, + { + { + "IRQ 9", 9 + }, + { + "IRQ 10", 10 + }, + { + "IRQ 11", 11 + }, + { + "IRQ 12", 12 + }, + { + "IRQ 14", 14 + }, + { + "IRQ 15", 15 + }, + { + "" + } + }, + }, + { + "dma", "DMA channel", CONFIG_SELECTION, "", 6, + { + { + "DMA 5", 5 + }, + { + "DMA 6", 6 + }, + { + "DMA 7", 7 + }, + { + "" + } + }, + }, + { + "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0, + { + { + "Disabled", 0 + }, + { + "C800H", 0xc8000 + }, + { + "D000H", 0xd0000 + }, + { + "D800H", 0xd8000 + }, + { + "" + } + }, + }, + { + "fdc_addr", "FDC address", CONFIG_HEX16, "", 0, + { + { + "None", 0 + }, + { + "0x3f0", 0x3f0 + }, + { + "0x370", 0x370 + }, + { + "" + } + }, + }, + { + "", "", -1 + } +}; + + const device_t aha154xa_device = { "Adaptec AHA-154xA", DEVICE_ISA | DEVICE_AT, @@ -1155,7 +1287,7 @@ const device_t aha154xcf_device = { AHA_154xCF, aha_init, x54x_close, NULL, NULL, NULL, NULL, - aha_154x_config + aha_154xcf_config }; const device_t aha1640_device = { diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 71529ef32..a3e7b6161 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -37,6 +37,8 @@ #include <86box/device.h> #include <86box/nvr.h> #include <86box/dma.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #include <86box/pic.h> #include <86box/pci.h> #include <86box/plat.h> diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index 0f301abdf..a3e8d2f0d 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -38,6 +38,8 @@ #include <86box/mem.h> #include <86box/rom.h> #include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #include <86box/nvr.h> #include <86box/plat.h> #include <86box/scsi.h> diff --git a/src/win/86Box.rc b/src/win/86Box.rc index c2000852a..f8291582d 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -553,10 +553,10 @@ BEGIN CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_4,217,171,38,12 - LTEXT "External FD Controller:",IDT_1768,7,190,48,10 + LTEXT "FDC Controller:",IDT_1768,7,190,48,10 COMBOBOX IDC_COMBO_FDC_EXT,64,189,155,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Configure",IDC_CONFIGURE_FDC_EXT,217,185,38,12 + PUSHBUTTON "Configure",IDC_CONFIGURE_FDC_EXT,217,189,38,12 END DLG_CFG_HARD_DISKS DIALOG DISCARDABLE 97, 0, 267, 154 diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 8f5db211b..fdc148859 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -1628,7 +1628,6 @@ recalc_fdc_list(HWND hdlg) } if (!found_card) SendMessage(h, CB_SETCURSEL, 0, 0); - EnableWindow(h, (machines[temp_machine].flags & MACHINE_FDC_FIXED) ? FALSE : TRUE); }