diff options
author | Curt Coder <curtcoder@mail.com> | 2014-05-12 12:28:44 +0000 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2014-05-12 12:28:44 +0000 |
commit | bd863c15f2a906a56cdf2883135b31a741f9b1ac (patch) | |
tree | 8e07f01b8b8bfe3e590f2a07a0d41217c2b49f70 /src | |
parent | ea89fb613b91d4a89a07da5e7115aff3efe810e3 (diff) |
wd17xx: devcb2. (nw)
Diffstat (limited to 'src')
44 files changed, 67 insertions, 80 deletions
diff --git a/src/emu/bus/bml3/bml3mp1802.c b/src/emu/bus/bml3/bml3mp1802.c index fb00f9d7acd..dbda88a12c2 100644 --- a/src/emu/bus/bml3/bml3mp1802.c +++ b/src/emu/bus/bml3/bml3mp1802.c @@ -38,8 +38,6 @@ WRITE_LINE_MEMBER( bml3bus_mp1802_device::bml3_wd17xx_intrq_w ) const wd17xx_interface bml3_wd17xx_interface = { DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, bml3bus_mp1802_device, bml3_wd17xx_intrq_w), - DEVCB_NULL, {FLOPPY_0, FLOPPY_1} }; @@ -54,6 +52,7 @@ ROM_END MACHINE_CONFIG_FRAGMENT( mp1802 ) MCFG_MB8866_ADD("wd17xx", bml3_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_mp1802_floppy_interface) MACHINE_CONFIG_END diff --git a/src/emu/bus/coco/coco_fdc.c b/src/emu/bus/coco/coco_fdc.c index 190ca2585e4..d1b681db8ab 100644 --- a/src/emu/bus/coco/coco_fdc.c +++ b/src/emu/bus/coco/coco_fdc.c @@ -149,13 +149,13 @@ WRITE_LINE_MEMBER( coco_fdc_device::fdc_drq_w ) static const wd17xx_interface coco_wd17xx_interface = { DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, coco_fdc_device, fdc_intrq_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, coco_fdc_device, fdc_drq_w), {FLOPPY_0,FLOPPY_1,FLOPPY_2,FLOPPY_3} }; static MACHINE_CONFIG_FRAGMENT(coco_fdc) MCFG_WD1773_ADD(WD_TAG, coco_wd17xx_interface) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_drq_w)) MCFG_DEVICE_ADD(DISTO_TAG, MSM6242, XTAL_32_768kHz) MCFG_DS1315_ADD(CLOUD9_TAG) diff --git a/src/emu/bus/ti99_peb/bwg.c b/src/emu/bus/ti99_peb/bwg.c index 0c3410867aa..c1a4b1bd06c 100644 --- a/src/emu/bus/ti99_peb/bwg.c +++ b/src/emu/bus/ti99_peb/bwg.c @@ -1107,8 +1107,6 @@ void snug_bwg_legacy_device::device_reset() const wd17xx_interface bwgleg_wd17xx_interface = { DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, snug_bwg_legacy_device, intrq_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, snug_bwg_legacy_device, drq_w), { PFLOPPY_0, PFLOPPY_1, PFLOPPY_2, PFLOPPY_3 } }; @@ -1133,6 +1131,8 @@ INPUT_PORTS_END MACHINE_CONFIG_FRAGMENT( bwg_fdc_legacy ) MCFG_WD1773_ADD(FDCLEG_TAG, bwgleg_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(snug_bwg_legacy_device, intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(snug_bwg_legacy_device, drq_w)) MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0) MCFG_MM58274C_MODE24(1) // 24 hour diff --git a/src/emu/bus/ti99_peb/ti_fdc.c b/src/emu/bus/ti99_peb/ti_fdc.c index b675ef887d2..d740625f852 100644 --- a/src/emu/bus/ti99_peb/ti_fdc.c +++ b/src/emu/bus/ti99_peb/ti_fdc.c @@ -441,8 +441,6 @@ const device_type TI99_FDC = &device_creator<ti_fdc_device>; const wd17xx_interface ti_wd17xx_interface = { DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_fdc_legacy_device, intrq_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_fdc_legacy_device, drq_w), { PFLOPPY_0, PFLOPPY_1, PFLOPPY_2, NULL } }; @@ -724,6 +722,8 @@ void ti_fdc_legacy_device::device_reset(void) MACHINE_CONFIG_FRAGMENT( ti_fdc_legacy ) MCFG_FD1771_ADD(FDCLEG_TAG, ti_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(ti_fdc_legacy_device, intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(ti_fdc_legacy_device, drq_w)) MACHINE_CONFIG_END ROM_START( ti_fdc_legacy ) diff --git a/src/emu/machine/wd17xx.c b/src/emu/machine/wd17xx.c index bfc576a06e0..28eb8221995 100644 --- a/src/emu/machine/wd17xx.c +++ b/src/emu/machine/wd17xx.c @@ -288,12 +288,12 @@ static const UINT8 track_SD[][2] = { const wd17xx_interface default_wd17xx_interface = { - DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} + DEVCB_NULL, { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; const wd17xx_interface default_wd17xx_interface_2_drives = { - DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, { FLOPPY_0, FLOPPY_1, NULL, NULL} + DEVCB_NULL, { FLOPPY_0, FLOPPY_1, NULL, NULL} }; @@ -1972,11 +1972,15 @@ wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, dev const device_type WD1770 = &device_creator<wd1770_device>; wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, WD1770, "WD1770_LEGACY", tag, owner, clock, "wd1770_l", __FILE__) + : device_t(mconfig, WD1770, "WD1770_LEGACY", tag, owner, clock, "wd1770_l", __FILE__), + m_out_intrq_func(*this), + m_out_drq_func(*this) { } wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + m_out_intrq_func(*this), + m_out_drq_func(*this) { } @@ -2011,8 +2015,8 @@ void wd1770_device::device_start() /* resolve callbacks */ m_in_dden_func.resolve(m_intf->in_dden_func, *this); - m_out_intrq_func.resolve(m_intf->out_intrq_func, *this); - m_out_drq_func.resolve(m_intf->out_drq_func, *this); + m_out_intrq_func.resolve_safe(); + m_out_drq_func.resolve_safe(); /* stepping rate depends on the clock */ m_stepping_rate[0] = 6; diff --git a/src/emu/machine/wd17xx.h b/src/emu/machine/wd17xx.h index 6fd5a7f446f..06fb31a5c03 100644 --- a/src/emu/machine/wd17xx.h +++ b/src/emu/machine/wd17xx.h @@ -17,12 +17,16 @@ TYPE DEFINITIONS ***************************************************************************/ +#define MCFG_WD17XX_INTRQ_CALLBACK(_write) \ + devcb = &wd1770_device::set_intrq_wr_callback(*device, DEVCB2_##_write); + +#define MCFG_WD17XX_DRQ_CALLBACK(_write) \ + devcb = &wd1770_device::set_drq_wr_callback(*device, DEVCB2_##_write); + /* Interface */ struct wd17xx_interface { devcb_read_line in_dden_func; - devcb_write_line out_intrq_func; - devcb_write_line out_drq_func; const char *floppy_drive_tags[4]; }; @@ -39,6 +43,9 @@ public: wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + template<class _Object> static devcb2_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast<wd1770_device &>(device).m_out_intrq_func.set_callback(object); } + template<class _Object> static devcb2_base &set_drq_wr_callback(device_t &device, _Object object) { return downcast<wd1770_device &>(device).m_out_drq_func.set_callback(object); } + /* the following are not strictly part of the wd179x hardware/emulation but will be put here for now until the flopdrv code has been finalised more */ void set_drive(UINT8); /* set drive wd179x is accessing */ @@ -103,8 +110,8 @@ protected: // internal state /* callbacks */ devcb_resolved_read_line m_in_dden_func; - devcb_resolved_write_line m_out_intrq_func; - devcb_resolved_write_line m_out_drq_func; + devcb2_write_line m_out_intrq_func; + devcb2_write_line m_out_drq_func; /* input lines */ int m_mr; /* master reset */ diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c index 22b2885a519..f80aa35de53 100644 --- a/src/mess/drivers/bbc.c +++ b/src/mess/drivers/bbc.c @@ -763,6 +763,8 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_I8271_IRQ_CALLBACK(WRITELINE(bbc_state, bbc_i8271_interrupt)) MCFG_I8271_FLOPPIES(FLOPPY_0, FLOPPY_1) MCFG_WD1770_ADD("wd177x", bbc_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface) /* slot devices */ @@ -823,6 +825,8 @@ static MACHINE_CONFIG_DERIVED( bbcb_us, bbca ) MCFG_I8271_IRQ_CALLBACK(WRITELINE(bbc_state, bbc_i8271_interrupt)) MCFG_I8271_FLOPPIES(FLOPPY_0, FLOPPY_1) MCFG_WD1770_ADD("wd177x", bbc_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface) MCFG_FRAGMENT_ADD(bbc_cartslot) @@ -985,6 +989,8 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) /* fdc */ MCFG_WD1770_ADD("wd177x", bbc_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface) /* rom slots */ @@ -1071,6 +1077,8 @@ static MACHINE_CONFIG_DERIVED( bbcmc, bbcm ) /* fdc */ MCFG_DEVICE_REMOVE("wd177x") MCFG_WD1772_ADD("wd177x", bbc_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) /* software lists */ MCFG_SOFTWARE_LIST_REMOVE("cart_ls_m") diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c index 1d2db709a95..d01e623ed4c 100644 --- a/src/mess/drivers/cgenie.c +++ b/src/mess/drivers/cgenie.c @@ -529,6 +529,7 @@ static MACHINE_CONFIG_START( cgenie_common, cgenie_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) MCFG_FD1793_ADD("wd179x", cgenie_wd17xx_interface ) // TODO confirm type + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(cgenie_state,cgenie_fdc_intrq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(cgenie_floppy_interface) /* cartridge */ diff --git a/src/mess/drivers/dgn_beta.c b/src/mess/drivers/dgn_beta.c index 4a6a10cde18..8c9b27b57df 100644 --- a/src/mess/drivers/dgn_beta.c +++ b/src/mess/drivers/dgn_beta.c @@ -365,6 +365,8 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state ) MCFG_PIA_IRQB_HANDLER(WRITELINE(dgn_beta_state,d_pia2_irq_b)) MCFG_WD2797_ADD(FDC_TAG, dgnbeta_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(dgn_beta_state,dgnbeta_fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(dgn_beta_state,dgnbeta_fdc_drq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(dgnbeta_floppy_interface) diff --git a/src/mess/drivers/dragon.c b/src/mess/drivers/dragon.c index c41f1bbcc94..81c33bc1270 100644 --- a/src/mess/drivers/dragon.c +++ b/src/mess/drivers/dragon.c @@ -222,6 +222,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( dgnalpha, dragon_base, dragon_alpha_state ) // floppy MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface) MCFG_WD2797_ADD(WD2797_TAG, dragon_alpha_state::fdc_interface) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_drq_w)) // sound hardware MCFG_SOUND_ADD(AY8912_TAG, AY8912, 1000000) diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c index c07394a4cbc..822f49489c0 100644 --- a/src/mess/drivers/fm7.c +++ b/src/mess/drivers/fm7.c @@ -1966,8 +1966,6 @@ void fm7_state::machine_reset() static const wd17xx_interface fm7_mb8877a_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(fm7_state,fm7_fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(fm7_state,fm7_fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; @@ -2018,6 +2016,8 @@ static MACHINE_CONFIG_START( fm7, fm7_state ) MCFG_CASSETTE_INTERFACE("fm7_cass") MCFG_MB8877_ADD("fdc",fm7_mb8877a_interface) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state,fm7_fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state,fm7_fdc_drq_w)) MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_SLOT_OPTION_ADD( "dsjoy", DEMPA_SHINBUNSHA_JOYSTICK ) diff --git a/src/mess/drivers/hec2hrp.c b/src/mess/drivers/hec2hrp.c index 2c94abe48cc..a5833b04e73 100644 --- a/src/mess/drivers/hec2hrp.c +++ b/src/mess/drivers/hec2hrp.c @@ -392,8 +392,6 @@ DISCRETE_SOUND_END const wd17xx_interface hector_wd17xx_interface = { DEVCB_NULL, - DEVCB_NULL,// treatment for intrq line - DEVCB_NULL,// treatment for drq line {FLOPPY_0, NULL, NULL, NULL} // Only one floppy on the minidisc }; diff --git a/src/mess/drivers/jupiter.c b/src/mess/drivers/jupiter.c index 23fcbf10cc5..441e1f6b79c 100644 --- a/src/mess/drivers/jupiter.c +++ b/src/mess/drivers/jupiter.c @@ -194,8 +194,6 @@ static const floppy_interface jupiter_floppy_interface = static const wd17xx_interface fdc_intf = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, { FLOPPY_0, FLOPPY_1, NULL, NULL } }; diff --git a/src/mess/drivers/mbc200.c b/src/mess/drivers/mbc200.c index 6e3f93f04f6..f4381c3d354 100644 --- a/src/mess/drivers/mbc200.c +++ b/src/mess/drivers/mbc200.c @@ -178,8 +178,6 @@ WRITE8_MEMBER( mbc200_state::porta_w ) static const wd17xx_interface mbc200_mb8876_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, NULL, NULL} }; static const floppy_interface mbc200_floppy_interface = diff --git a/src/mess/drivers/mbc55x.c b/src/mess/drivers/mbc55x.c index ef03005dc55..3126c0a3ac3 100644 --- a/src/mess/drivers/mbc55x.c +++ b/src/mess/drivers/mbc55x.c @@ -280,6 +280,8 @@ static MACHINE_CONFIG_START( mbc55x, mbc55x_state ) /* Backing storage */ MCFG_FD1793_ADD(FDC_TAG, mbc55x_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(mbc55x_state, mbc55x_fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(mbc55x_state, mbc55x_fdc_drq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mbc55x_floppy_interface) /* Software list */ diff --git a/src/mess/drivers/ms0515.c b/src/mess/drivers/ms0515.c index 70bf766ce27..08d6a8a6792 100644 --- a/src/mess/drivers/ms0515.c +++ b/src/mess/drivers/ms0515.c @@ -137,8 +137,6 @@ INPUT_PORTS_END static const wd17xx_interface ms0515_wd17xx_interface = { DEVCB_LINE_VCC, - DEVCB_NULL, - DEVCB_NULL, { FLOPPY_0, NULL, NULL, NULL } }; diff --git a/src/mess/drivers/myb3k.c b/src/mess/drivers/myb3k.c index fdb867301e8..8341b4a3f3c 100644 --- a/src/mess/drivers/myb3k.c +++ b/src/mess/drivers/myb3k.c @@ -236,8 +236,6 @@ GFXDECODE_END static const wd17xx_interface myb3k_wd17xx_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, NULL, NULL} }; diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c index 25be5339e17..f5eb48d119c 100644 --- a/src/mess/drivers/mz2000.c +++ b/src/mess/drivers/mz2000.c @@ -779,8 +779,6 @@ READ8_MEMBER(mz2000_state::mz2000_pio1_porta_r) static const wd17xx_interface mz2000_mb8877a_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c index 36446977170..a1a42f95b24 100644 --- a/src/mess/drivers/mz2500.c +++ b/src/mess/drivers/mz2500.c @@ -1202,8 +1202,6 @@ WRITE8_MEMBER(mz2500_state::mz2500_fdc_w) static const wd17xx_interface mz2500_mb8877a_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/drivers/nascom1.c b/src/mess/drivers/nascom1.c index 539a09577bf..18252e77691 100644 --- a/src/mess/drivers/nascom1.c +++ b/src/mess/drivers/nascom1.c @@ -330,6 +330,8 @@ static MACHINE_CONFIG_DERIVED( nascom2, nascom1 ) MCFG_GFXDECODE_MODIFY("gfxdecode", nascom2) MCFG_FD1793_ADD("wd1793", nascom2_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(nascom1_state,nascom2_fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(nascom1_state,nascom2_fdc_drq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(nascom2_floppy_interface) MACHINE_CONFIG_END diff --git a/src/mess/drivers/pk8020.c b/src/mess/drivers/pk8020.c index 58340173c42..22fbb646233 100644 --- a/src/mess/drivers/pk8020.c +++ b/src/mess/drivers/pk8020.c @@ -158,8 +158,6 @@ static const floppy_interface pk8020_floppy_interface = static const wd17xx_interface pk8020_wd17xx_interface = { DEVCB_LINE_VCC, - DEVCB_NULL, - DEVCB_NULL, { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 } }; diff --git a/src/mess/drivers/ql.c b/src/mess/drivers/ql.c index eff423cfd46..c33acd94240 100644 --- a/src/mess/drivers/ql.c +++ b/src/mess/drivers/ql.c @@ -953,8 +953,6 @@ static const floppy_interface ql_floppy_interface = wd17xx_interface ql_wd17xx_interface = { DEVCB_DRIVER_LINE_MEMBER(ql_state,disk_io_dden_r), - DEVCB_DRIVER_LINE_MEMBER(ql_state,disk_io_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(ql_state,disk_io_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; @@ -1123,6 +1121,8 @@ static MACHINE_CONFIG_START( ql, ql_state ) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ql_floppy_interface) MCFG_WD1772_ADD(WD1772_TAG,ql_wd17xx_interface) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(ql_state,disk_io_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(ql_state,disk_io_drq_w)) MCFG_MICRODRIVE_ADD(MDV_1) MCFG_MICRODRIVE_COMMS_OUT_CALLBACK(DEVWRITELINE(MDV_2, microdrive_image_device, comms_in_w)) MCFG_MICRODRIVE_ADD(MDV_2) diff --git a/src/mess/drivers/rainbow.c b/src/mess/drivers/rainbow.c index 351631cd69f..5bacff27b8f 100644 --- a/src/mess/drivers/rainbow.c +++ b/src/mess/drivers/rainbow.c @@ -1197,8 +1197,6 @@ GFXDECODE_END const wd17xx_interface rainbow_wd17xx_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c index 33a1a258778..f5b7a46d5b5 100644 --- a/src/mess/drivers/smc777.c +++ b/src/mess/drivers/smc777.c @@ -1024,8 +1024,6 @@ PALETTE_INIT_MEMBER(smc777_state, smc777) static const wd17xx_interface smc777_mb8876_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(smc777_state, smc777_fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(smc777_state, smc777_fdc_drq_w), {FLOPPY_0, FLOPPY_1, NULL, NULL} }; @@ -1080,6 +1078,8 @@ static MACHINE_CONFIG_START( smc777, smc777_state ) MCFG_MC6845_CHAR_WIDTH(8) MCFG_MB8876_ADD("fdc",smc777_mb8876_interface) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(smc777_state, smc777_fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(smc777_state, smc777_fdc_drq_w)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(smc777_floppy_interface) MCFG_SOFTWARE_LIST_ADD("flop_list","smc777") diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c index 799b042cbd6..acb7d34a96b 100644 --- a/src/mess/drivers/svi318.c +++ b/src/mess/drivers/svi318.c @@ -324,6 +324,8 @@ static MACHINE_CONFIG_START( svi318, svi318_state ) MCFG_CASSETTE_INTERFACE("svi318_cass") MCFG_FD1793_ADD("wd179x", svi_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(svi318_state,svi_fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(svi318_state,svi_fdc_drq_w)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(svi318_floppy_interface) diff --git a/src/mess/drivers/swtpc09.c b/src/mess/drivers/swtpc09.c index cc91a1ab7b6..faae58d8139 100644 --- a/src/mess/drivers/swtpc09.c +++ b/src/mess/drivers/swtpc09.c @@ -170,6 +170,8 @@ static MACHINE_CONFIG_START( swtpc09, swtpc09_state ) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock)) MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_drq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface) diff --git a/src/mess/drivers/trs80.c b/src/mess/drivers/trs80.c index 93fbef23873..cfa49de0f4a 100644 --- a/src/mess/drivers/trs80.c +++ b/src/mess/drivers/trs80.c @@ -596,6 +596,7 @@ static MACHINE_CONFIG_DERIVED( model1, trs80 ) // model I, level II MCFG_QUICKLOAD_ADD("quickload", trs80_state, trs80_cmd, "cmd", 0.5) MCFG_FD1793_ADD("wd179x", trs80_wd17xx_interface ) // should be FD1771 or FD1791 but inverted data lines are too tricky to fix now + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(trs80_state,trs80_fdc_intrq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(trs80_floppy_interface) MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") diff --git a/src/mess/drivers/unixpc.c b/src/mess/drivers/unixpc.c index f153eb2894b..8a4a0934897 100644 --- a/src/mess/drivers/unixpc.c +++ b/src/mess/drivers/unixpc.c @@ -188,8 +188,6 @@ static const floppy_interface unixpc_floppy_interface = static const wd17xx_interface unixpc_wd17xx_intf = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(unixpc_state, wd2797_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(unixpc_state, wd2797_drq_w), { FLOPPY_0, NULL, NULL, NULL } }; @@ -216,6 +214,8 @@ static MACHINE_CONFIG_START( unixpc, unixpc_state ) // floppy MCFG_WD2797_ADD("wd2797", unixpc_wd17xx_intf) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_drq_w)) MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, unixpc_floppy_interface) MACHINE_CONFIG_END diff --git a/src/mess/drivers/vector06.c b/src/mess/drivers/vector06.c index e536e9b1844..f76a1c4a343 100644 --- a/src/mess/drivers/vector06.c +++ b/src/mess/drivers/vector06.c @@ -138,8 +138,6 @@ static const floppy_interface vector_floppy_interface = const wd17xx_interface vector06_wd17xx_interface = { DEVCB_LINE_VCC, - DEVCB_NULL, - DEVCB_NULL, { FLOPPY_0, FLOPPY_1, NULL, NULL} }; diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c index 53058a064a8..61084be6ffd 100644 --- a/src/mess/drivers/x1.c +++ b/src/mess/drivers/x1.c @@ -1052,8 +1052,6 @@ WRITE8_MEMBER( x1_state::x1_fdc_w ) static const wd17xx_interface x1_mb8877a_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; @@ -1065,8 +1063,6 @@ WRITE_LINE_MEMBER(x1_state::fdc_drq_w) static const wd17xx_interface x1turbo_mb8877a_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(x1_state,fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; @@ -2545,6 +2541,7 @@ static MACHINE_CONFIG_DERIVED( x1turbo, x1 ) MCFG_DEVICE_REMOVE("fdc") MCFG_MB8877_ADD("fdc",x1turbo_mb8877a_interface) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(x1_state,fdc_drq_w)) MCFG_YM2151_ADD("ym", MAIN_CLOCK/8) //option board MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c index 661f6613bdf..dd0bb133973 100644 --- a/src/mess/drivers/x1twin.c +++ b/src/mess/drivers/x1twin.c @@ -74,8 +74,6 @@ ADDRESS_MAP_END static const wd17xx_interface x1_mb8877a_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/drivers/z100.c b/src/mess/drivers/z100.c index 32ee9cc7deb..d280a68f44c 100644 --- a/src/mess/drivers/z100.c +++ b/src/mess/drivers/z100.c @@ -645,8 +645,6 @@ WRITE_LINE_MEMBER( z100_state::video_pia_CB2_w ) static const wd17xx_interface z207_interface = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, NULL, NULL} }; diff --git a/src/mess/includes/dgnalpha.h b/src/mess/includes/dgnalpha.h index a1607965ca9..1fbab1e2d30 100644 --- a/src/mess/includes/dgnalpha.h +++ b/src/mess/includes/dgnalpha.h @@ -57,6 +57,10 @@ public: DECLARE_READ8_MEMBER( psg_porta_read ); DECLARE_WRITE8_MEMBER( psg_porta_write ); + /* fdc */ + DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w ); + DECLARE_WRITE_LINE_MEMBER( fdc_drq_w ); + static const wd17xx_interface fdc_interface; protected: @@ -74,10 +78,6 @@ protected: private: UINT8 m_just_reset; - /* fdc */ - DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w ); - DECLARE_WRITE_LINE_MEMBER( fdc_drq_w ); - /* modem */ UINT8 modem_r(offs_t offset); void modem_w(offs_t offset, UINT8 data); diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index dc0b9a4c331..8dc9b0d9261 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -1605,8 +1605,6 @@ WRITE_LINE_MEMBER(bbc_state::bbc_wd177x_drq_w) const wd17xx_interface bbc_wd17xx_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbc_wd177x_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbc_wd177x_drq_w), {FLOPPY_0, FLOPPY_1, NULL, NULL} }; diff --git a/src/mess/machine/beta.c b/src/mess/machine/beta.c index 3ade699e28b..f786e181fee 100644 --- a/src/mess/machine/beta.c +++ b/src/mess/machine/beta.c @@ -96,8 +96,6 @@ WRITE_LINE_MEMBER(beta_disk_device::wd179x_drq_w) static const wd17xx_interface beta_wd17xx_interface = { DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, beta_disk_device, wd179x_intrq_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, beta_disk_device, wd179x_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; @@ -201,6 +199,8 @@ static const floppy_interface beta_floppy_interface = static MACHINE_CONFIG_FRAGMENT( beta_disk ) MCFG_WD2793_ADD("wd179x", beta_wd17xx_interface ) // KR1818VG93 clone of WD1793 + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(beta_disk_device, wd179x_intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(beta_disk_device, wd179x_drq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(beta_floppy_interface) MACHINE_CONFIG_END diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c index 193754b0cb3..ead2b22bddf 100644 --- a/src/mess/machine/cgenie.c +++ b/src/mess/machine/cgenie.c @@ -433,8 +433,6 @@ WRITE_LINE_MEMBER(cgenie_state::cgenie_fdc_intrq_w) const wd17xx_interface cgenie_wd17xx_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(cgenie_state,cgenie_fdc_intrq_w), - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/machine/concept_exp.c b/src/mess/machine/concept_exp.c index c9fe0088fd7..e990c200301 100644 --- a/src/mess/machine/concept_exp.c +++ b/src/mess/machine/concept_exp.c @@ -199,8 +199,6 @@ WRITE_LINE_MEMBER(concept_fdc_device::drq_w) const wd17xx_interface concept_wd17xx_interface = { DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, concept_fdc_device, intrq_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, concept_fdc_device, drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; @@ -324,6 +322,8 @@ static const floppy_interface concept_floppy_interface = static MACHINE_CONFIG_FRAGMENT( fdc ) MCFG_FD1793_ADD("wd179x", concept_wd17xx_interface ) + MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(concept_fdc_device, intrq_w)) + MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(concept_fdc_device, drq_w)) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(concept_floppy_interface) MACHINE_CONFIG_END diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c index 6854f8f6858..91512f7de6f 100644 --- a/src/mess/machine/dgn_beta.c +++ b/src/mess/machine/dgn_beta.c @@ -803,8 +803,6 @@ WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_drq_w) const wd17xx_interface dgnbeta_wd17xx_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,dgnbeta_fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,dgnbeta_fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/machine/dgnalpha.c b/src/mess/machine/dgnalpha.c index 8ec09a26daf..37054744e9b 100644 --- a/src/mess/machine/dgnalpha.c +++ b/src/mess/machine/dgnalpha.c @@ -382,7 +382,5 @@ WRITE_LINE_MEMBER( dragon_alpha_state::fdc_drq_w ) const wd17xx_interface dragon_alpha_state::fdc_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(dragon_alpha_state, fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(dragon_alpha_state, fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c index 33328e75c1a..12ce5501e95 100644 --- a/src/mess/machine/mbc55x.c +++ b/src/mess/machine/mbc55x.c @@ -39,8 +39,6 @@ static int instruction_hook(device_t &device, offs_t curpc); const wd17xx_interface mbc55x_wd17xx_interface = { DEVCB_LINE_GND, - DEVCB_DRIVER_LINE_MEMBER(mbc55x_state, mbc55x_fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(mbc55x_state, mbc55x_fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/machine/nascom1.c b/src/mess/machine/nascom1.c index e214f544f72..b324787fbfb 100644 --- a/src/mess/machine/nascom1.c +++ b/src/mess/machine/nascom1.c @@ -40,8 +40,6 @@ WRITE_LINE_MEMBER(nascom1_state::nascom2_fdc_drq_w) const wd17xx_interface nascom2_wd17xx_interface = { DEVCB_LINE_VCC, - DEVCB_DRIVER_LINE_MEMBER(nascom1_state,nascom2_fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(nascom1_state,nascom2_fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c index c8b6d41cc33..395c1ca25f7 100644 --- a/src/mess/machine/svi318.c +++ b/src/mess/machine/svi318.c @@ -254,8 +254,6 @@ WRITE_LINE_MEMBER(svi318_state::svi_fdc_drq_w) const wd17xx_interface svi_wd17xx_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi_fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi_fdc_drq_w), {FLOPPY_0, FLOPPY_1, NULL, NULL} }; diff --git a/src/mess/machine/swtpc09.c b/src/mess/machine/swtpc09.c index 48817bf8a00..7b561a7b450 100644 --- a/src/mess/machine/swtpc09.c +++ b/src/mess/machine/swtpc09.c @@ -249,8 +249,6 @@ void swtpc09_state::swtpc09_irq_handler(UINT8 peripheral, UINT8 state) const wd17xx_interface swtpc09_wd17xx_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(swtpc09_state, fdc_intrq_w), - DEVCB_DRIVER_LINE_MEMBER(swtpc09_state, fdc_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 } }; diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c index 3b8d1f605bd..d166dbd98e6 100644 --- a/src/mess/machine/trs80.c +++ b/src/mess/machine/trs80.c @@ -683,8 +683,6 @@ WRITE_LINE_MEMBER(trs80_state::trs80_fdc_intrq_w) const wd17xx_interface trs80_wd17xx_interface = { DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(trs80_state,trs80_fdc_intrq_w), - DEVCB_NULL, {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; |