Added external Floppy disk controller support.

This commit is contained in:
TC1995
2020-06-16 16:25:23 +02:00
parent 0413a48a5c
commit a77c88addf
10 changed files with 535 additions and 3 deletions

View File

@@ -117,7 +117,8 @@ typedef struct {
parallel_enabled[3]; /* LPT1, LPT2, LPT3 enabled */
/* Other peripherals category */
int hdc, /* Hard disk controller */
int fdc_type, /* Floppy disk controller type */
hdc, /* Hard disk controller */
scsi_card, /* SCSI controller */
ide_ter_enabled, /* Tertiary IDE controller enabled */
ide_qua_enabled, /* Quaternary IDE controller enabled */

View File

@@ -22,6 +22,11 @@
#ifndef EMU_FDC_H
# define EMU_FDC_H
extern int fdc_type;
/* Controller types. */
#define FDC_NONE 0
#define FDC_INTERNAL 1
#define FDC_FLAG_PCJR 0x01 /* PCjr */
#define FDC_FLAG_DISKCHG_ACTLOW 0x02 /* Amstrad, PS/1, PS/2 ISA */
@@ -33,6 +38,7 @@
#define FDC_FLAG_NSC 0x80 /* PC87306, PC87309 */
#define FDC_FLAG_TOSHIBA 0x100 /* T1000, T1200 */
#define FDC_FLAG_AMSTRAD 0x200 /* Non-AT Amstrad machines */
#define FDC_FLAG_NSDP 0x400 /* DP8473N, DP8473V */
typedef struct {
@@ -178,7 +184,15 @@ extern const device_t fdc_at_ps1_device;
extern const device_t fdc_at_smc_device;
extern const device_t fdc_at_winbond_device;
extern const device_t fdc_at_nsc_device;
extern const device_t fdc_dp8473_device;
#endif
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);
extern int fdc_ext_get_from_internal_name(char *s);
extern const device_t *fdc_ext_get_device(int fdc_ext);
extern int fdc_ext_has_config(int fdc_ext);
extern int fdc_ext_available(int fdc_ext);
#endif /*EMU_FDC_H*/

View File

@@ -0,0 +1,56 @@
/*
* VARCem Virtual ARchaeological Computer EMulator.
* An emulator of (mostly) x86-based PC systems and devices,
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
* spanning the era between 1981 and 1995.
*
* This file is part of the VARCem Project.
*
* Implementation of the DTK PII-151B and PII-158B cards.
*
* These are DP8473-based floppy controller ISA cards for XT
* class systems, and allow usage of standard and high-density
* drives on them. They have their own BIOS which takes over
* from the standard system BIOS.
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2019 Fred N. van Kempen.
*
* Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the entire
* above notice, this list of conditions and the following
* disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names
* of its contributors may be used to endorse or promote
* products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FLOPPY_PII15XB_H
# define FLOPPY_PII15XB_H
extern const device_t fdc_pii151b_device;
extern const device_t fdc_pii158b_device;
#endif /*FLOPPY_PII15XB_H*/

View File

@@ -40,6 +40,8 @@
#define MACHINE_MOUSE 0x008000 /* sys has int mouse */
#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 */
@@ -57,6 +59,8 @@
#define MACHINE_MOUSE 0x008000 /* sys has int mouse */
#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;

View File

@@ -99,6 +99,7 @@
#define IDT_1765 1765 /* Board #3: */
#define IDT_1766 1766 /* Board #4: */
#define IDT_1767 1767 /* ISA RTC: */
#define IDT_1768 1768 /* Ext FD Controller: */
/*
@@ -180,6 +181,8 @@
#define IDC_CHECK_POSTCARD 1130
#define IDC_COMBO_ISARTC 1131
#define IDC_CONFIGURE_ISARTC 1132
#define IDC_COMBO_FDC_EXT 1133
#define IDC_CONFIGURE_FDC_EXT 1134
#define IDC_GROUP_ISAMEM 1140
#define IDC_COMBO_ISAMEM_1 1141
#define IDC_COMBO_ISAMEM_2 1142