diff --git a/src/emu/machine/upd765.c b/src/emu/machine/upd765.c index c0b094bf08d..bbc5fc7f223 100644 --- a/src/emu/machine/upd765.c +++ b/src/emu/machine/upd765.c @@ -9,6 +9,8 @@ const device_type UPD72065 = &device_creator; const device_type SMC37C78 = &device_creator; const device_type N82077AA = &device_creator; const device_type PC_FDC_SUPERIO = &device_creator; +const device_type DP8473 = &device_creator; +const device_type PC8477A = &device_creator; DEVICE_ADDRESS_MAP_START(map, 8, upd765a_device) AM_RANGE(0x0, 0x0) AM_READ(msr_r) @@ -58,6 +60,26 @@ DEVICE_ADDRESS_MAP_START(map, 8, pc_fdc_superio_device) AM_RANGE(0x7, 0x7) AM_READWRITE(dir_r, ccr_w) ADDRESS_MAP_END +DEVICE_ADDRESS_MAP_START(map, 8, dp8473_device) + AM_RANGE(0x0, 0x0) AM_READ(sra_r) + AM_RANGE(0x1, 0x1) AM_READ(srb_r) + AM_RANGE(0x2, 0x2) AM_READWRITE(dor_r, dor_w) + AM_RANGE(0x3, 0x3) AM_READWRITE(tdr_r, tdr_w) + AM_RANGE(0x4, 0x4) AM_READWRITE(msr_r, dsr_w) + AM_RANGE(0x5, 0x5) AM_READWRITE(fifo_r, fifo_w) + AM_RANGE(0x7, 0x7) AM_READWRITE(dir_r, ccr_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(map, 8, pc8477a_device) + AM_RANGE(0x0, 0x0) AM_READ(sra_r) + AM_RANGE(0x1, 0x1) AM_READ(srb_r) + AM_RANGE(0x2, 0x2) AM_READWRITE(dor_r, dor_w) + AM_RANGE(0x3, 0x3) AM_READWRITE(tdr_r, tdr_w) + AM_RANGE(0x4, 0x4) AM_READWRITE(msr_r, dsr_w) + AM_RANGE(0x5, 0x5) AM_READWRITE(fifo_r, fifo_w) + AM_RANGE(0x7, 0x7) AM_READWRITE(dir_r, ccr_w) +ADDRESS_MAP_END + int upd765_family_device::rates[4] = { 500000, 300000, 250000, 1000000 }; @@ -2201,3 +2223,19 @@ pc_fdc_superio_device::pc_fdc_superio_device(const machine_config &mconfig, cons ready_connected = false; select_connected = true; } + +dp8473_device::dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock) +{ + m_shortname = "dp8473"; + ready_polled = false; + ready_connected = false; + select_connected = true; +} + +pc8477a_device::pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock) +{ + m_shortname = "pc8477a"; + ready_polled = false; + ready_connected = false; + select_connected = true; +} diff --git a/src/emu/machine/upd765.h b/src/emu/machine/upd765.h index 5609898766b..cb1e8bb032b 100644 --- a/src/emu/machine/upd765.h +++ b/src/emu/machine/upd765.h @@ -40,6 +40,12 @@ #define MCFG_PC_FDC_SUPERIO_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, PC_FDC_SUPERIO, 0) +#define MCFG_DP8473_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, DP8473, 0) + +#define MCFG_PC8477A_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, PC8477A, 0) + /* Interface required for PC ISA wrapping */ class pc_fdc_interface : public device_t { public: @@ -431,6 +437,20 @@ public: virtual DECLARE_ADDRESS_MAP(map, 8); }; +class dp8473_device : public upd765_family_device { +public: + dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_ADDRESS_MAP(map, 8); +}; + +class pc8477a_device : public upd765_family_device { +public: + pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_ADDRESS_MAP(map, 8); +}; + extern const device_type UPD765A; extern const device_type UPD765B; extern const device_type I8272A; @@ -438,5 +458,7 @@ extern const device_type UPD72065; extern const device_type SMC37C78; extern const device_type N82077AA; extern const device_type PC_FDC_SUPERIO; +extern const device_type DP8473; +extern const device_type PC8477A; #endif diff --git a/src/mess/machine/fd2000.c b/src/mess/machine/fd2000.c index 99bddef8bcc..4f7401c6592 100644 --- a/src/mess/machine/fd2000.c +++ b/src/mess/machine/fd2000.c @@ -13,6 +13,7 @@ - IEC - VIA + - DP8473/PC8477A command extensions to upd765 - D1M/D2M/D4M image format (http://ist.uwaterloo.ca/~schepers/formats/D2M-DNP.TXT) */ @@ -92,27 +93,121 @@ const rom_entry *fd2000_device::device_rom_region() const static ADDRESS_MAP_START( fd2000_mem, AS_PROGRAM, 8, fd2000_device ) AM_RANGE(0x0000, 0x3fff) AM_RAM AM_RANGE(0x4000, 0x400f) AM_MIRROR(0xbf0) AM_DEVREADWRITE(M6522_TAG, via6522_device, read, write) - AM_RANGE(0x4e00, 0x4e07) AM_MIRROR(0x1f8) AM_DEVICE(DP8473_TAG, upd765a_device, map) + AM_RANGE(0x4e00, 0x4e07) AM_MIRROR(0x1f8) AM_DEVICE(DP8473_TAG, dp8473_device, map) AM_RANGE(0x5000, 0x7fff) AM_RAM AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0) ADDRESS_MAP_END //------------------------------------------------- -// via6522_interface via1_intf +// ADDRESS_MAP( fd4000_mem ) //------------------------------------------------- +static ADDRESS_MAP_START( fd4000_mem, AS_PROGRAM, 8, fd4000_device ) + AM_RANGE(0x0000, 0x3fff) AM_RAM + AM_RANGE(0x4000, 0x400f) AM_MIRROR(0xbf0) AM_DEVREADWRITE(M6522_TAG, via6522_device, read, write) + AM_RANGE(0x4e00, 0x4e07) AM_MIRROR(0x1f8) AM_DEVICE(PC8477AV1_TAG, pc8477a_device, map) + AM_RANGE(0x5000, 0x7fff) AM_RAM + AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0) +ADDRESS_MAP_END + + +//------------------------------------------------- +// via6522_interface via_intf +//------------------------------------------------- + +READ8_MEMBER( fd2000_device::via_pa_r ) +{ + /* + + bit description + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + + */ + + return 0; +} + +WRITE8_MEMBER( fd2000_device::via_pa_w ) +{ + /* + + bit description + + 0 + 1 + 2 + 3 + 4 + 5 FAST DIR + 6 + 7 + + */ +} + +READ8_MEMBER( fd2000_device::via_pb_r ) +{ + /* + + bit description + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 FDC INTRQ + + */ + + UINT8 data = 0; + + // FDC interrupt + data |= m_fdc->get_irq() << 7; + + return data; +} + +WRITE8_MEMBER( fd2000_device::via_pb_w ) +{ + /* + + bit description + + 0 + 1 + 2 + 3 + 4 + 5 LED + 6 LED + 7 + + */ +} + static const via6522_interface via_intf = { - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, fd2000_device, via_pa_r), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, fd2000_device, via_pb_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, fd2000_device, via_pa_w), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, fd2000_device, via_pb_w), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -144,7 +239,7 @@ static MACHINE_CONFIG_FRAGMENT( fd2000 ) MCFG_CPU_PROGRAM_MAP(fd2000_mem) MCFG_VIA6522_ADD(M6522_TAG, 2000000, via_intf) - MCFG_UPD765A_ADD(DP8473_TAG, true, true) + MCFG_DP8473_ADD(DP8473_TAG) MCFG_FLOPPY_DRIVE_ADD(DP8473_TAG":0", fd2000_floppies, "35hd", 0, floppy_image_device::default_floppy_formats)//fd2000_device::floppy_formats) MACHINE_CONFIG_END @@ -156,12 +251,12 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_FRAGMENT( fd4000 ) MCFG_CPU_ADD(M6502_TAG, M65C02, 2000000) - MCFG_CPU_PROGRAM_MAP(fd2000_mem) + MCFG_CPU_PROGRAM_MAP(fd4000_mem) MCFG_VIA6522_ADD(M6522_TAG, 2000000, via_intf) - MCFG_UPD765A_ADD(DP8473_TAG, true, true) + MCFG_PC8477A_ADD(PC8477AV1_TAG) - MCFG_FLOPPY_DRIVE_ADD(DP8473_TAG":0", fd4000_floppies, "35ed", 0, floppy_image_device::default_floppy_formats)//fd2000_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(PC8477AV1_TAG":0", fd4000_floppies, "35ed", 0, floppy_image_device::default_floppy_formats)//fd2000_device::floppy_formats) MACHINE_CONFIG_END @@ -217,6 +312,7 @@ fd2000_device::fd2000_device(const machine_config &mconfig, const char *tag, dev : device_t(mconfig, FD2000, "FD-2000", tag, owner, clock), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), + m_fdc(*this, DP8473_TAG), m_floppy0(*this, DP8473_TAG":0"), m_variant(TYPE_FD2000) { @@ -226,7 +322,8 @@ fd2000_device::fd2000_device(const machine_config &mconfig, device_type type, co : device_t(mconfig, type, name, tag, owner, clock), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), - m_floppy0(*this, DP8473_TAG":0"), + m_fdc(*this, PC8477AV1_TAG), + m_floppy0(*this, PC8477AV1_TAG":0"), m_variant(variant) { } diff --git a/src/mess/machine/fd2000.h b/src/mess/machine/fd2000.h index 961af2c1bbb..f029989b83b 100644 --- a/src/mess/machine/fd2000.h +++ b/src/mess/machine/fd2000.h @@ -53,6 +53,11 @@ public: virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; + DECLARE_READ8_MEMBER( via_pa_r ); + DECLARE_WRITE8_MEMBER( via_pa_w ); + DECLARE_READ8_MEMBER( via_pb_r ); + DECLARE_WRITE8_MEMBER( via_pb_w ); + //DECLARE_FLOPPY_FORMATS( floppy_formats ); protected: @@ -68,6 +73,7 @@ protected: void cbm_iec_reset(int state); required_device m_maincpu; + required_device m_fdc; required_device m_floppy0; int m_variant;