diff options
author | 2019-01-26 13:28:26 -0500 | |
---|---|---|
committer | 2019-01-26 13:28:32 -0500 | |
commit | ca56b2a6f82711ec5b29525af9b4f506475ee0fe (patch) | |
tree | 5b6799e92fca5f020ef60028fdb82934507a6806 | |
parent | 6af25d6ca54f710671faa72264872e241f709d0a (diff) |
bus/abcbus: Remove MCFG_ macros; add bus clocks (presumed same as CPUs) (nw)
-rw-r--r-- | src/devices/bus/abcbus/abc890.cpp | 112 | ||||
-rw-r--r-- | src/devices/bus/abcbus/abcbus.h | 72 | ||||
-rw-r--r-- | src/mame/drivers/abc1600.cpp | 30 | ||||
-rw-r--r-- | src/mame/drivers/abc80.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/abc80x.cpp | 2 |
5 files changed, 96 insertions, 122 deletions
diff --git a/src/devices/bus/abcbus/abc890.cpp b/src/devices/bus/abcbus/abc890.cpp index 4807a09a9f5..27530439929 100644 --- a/src/devices/bus/abcbus/abc890.cpp +++ b/src/devices/bus/abcbus/abc890.cpp @@ -27,89 +27,95 @@ DEFINE_DEVICE_TYPE(ABC856, abc856_device, "abc856", "ABC // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(abc890_device::device_add_mconfig) - MCFG_ABCBUS_SLOT_ADD("io1", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io2", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io3", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io4", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("mem1", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("mem2", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("mem3", abcbus_cards, nullptr) -MACHINE_CONFIG_END +void abc890_device::device_add_mconfig(machine_config &config) +{ + ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "mem1", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "mem2", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "mem3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); +} //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(abc_expansion_unit_device::device_add_mconfig) - MCFG_ABCBUS_SLOT_ADD("io1", abc80_cards, "abc830") - MCFG_ABCBUS_SLOT_ADD("io2", abc80_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io3", abc80_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io4", abc80_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("mem1", abc80_cards, "memcard") - MCFG_ABCBUS_SLOT_ADD("mem2", abc80_cards, "16k") - MCFG_ABCBUS_SLOT_ADD("mem3", abc80_cards, nullptr) -MACHINE_CONFIG_END +void abc_expansion_unit_device::device_add_mconfig(machine_config &config) +{ + ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abc80_cards, "abc830"); + ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abc80_cards, nullptr); + ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abc80_cards, nullptr); + ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abc80_cards, nullptr); + ABCBUS_SLOT(config, "mem1", DERIVED_CLOCK(1, 1), abc80_cards, "memcard"); + ABCBUS_SLOT(config, "mem2", DERIVED_CLOCK(1, 1), abc80_cards, "16k"); + ABCBUS_SLOT(config, "mem3", DERIVED_CLOCK(1, 1), abc80_cards, nullptr); +} //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(abc894_device::device_add_mconfig) - MCFG_ABCBUS_SLOT_ADD("io1", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io2", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io3", abcbus_cards, nullptr) -MACHINE_CONFIG_END +void abc894_device::device_add_mconfig(machine_config &config) +{ + ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); +} //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(abc850_device::device_add_mconfig) - MCFG_ABCBUS_SLOT_ADD("io1", abcbus_cards, "abc850fdd") - MCFG_ABCBUS_SLOT_ADD("io2", abcbus_cards, "xebec") - MCFG_SLOT_OPTION_DEFAULT_BIOS("xebec", "ro202") - MCFG_ABCBUS_SLOT_ADD("io3", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io4", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io5", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io6", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io7", abcbus_cards, nullptr) -MACHINE_CONFIG_END +void abc850_device::device_add_mconfig(machine_config &config) +{ + ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, "abc850fdd"); + ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, "xebec") + .set_option_default_bios("xebec", "ro202"); + ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io5", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io6", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io7", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); +} //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(abc852_device::device_add_mconfig) - MCFG_ABCBUS_SLOT_ADD("io1", abcbus_cards, "abc850fdd") - MCFG_ABCBUS_SLOT_ADD("io2", abcbus_cards, "xebec") - MCFG_SLOT_OPTION_DEFAULT_BIOS("xebec", "basf6185") - MCFG_ABCBUS_SLOT_ADD("io3", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io4", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io5", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io6", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io7", abcbus_cards, nullptr) -MACHINE_CONFIG_END +void abc852_device::device_add_mconfig(machine_config &config) +{ + ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, "abc850fdd"); + ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, "xebec") + .set_option_default_bios("xebec", "basf6185"); + ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io5", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io6", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io7", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); +} //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(abc856_device::device_add_mconfig) - MCFG_ABCBUS_SLOT_ADD("io1", abcbus_cards, "abc850fdd") - MCFG_ABCBUS_SLOT_ADD("io2", abcbus_cards, "xebec") - MCFG_SLOT_OPTION_DEFAULT_BIOS("xebec", "micr1325") - MCFG_ABCBUS_SLOT_ADD("io3", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io4", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io5", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io6", abcbus_cards, nullptr) - MCFG_ABCBUS_SLOT_ADD("io7", abcbus_cards, nullptr) -MACHINE_CONFIG_END +void abc856_device::device_add_mconfig(machine_config &config) +{ + ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, "abc850fdd"); + ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, "xebec") + .set_option_default_bios("xebec", "micr1325"); + ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io5", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io6", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); + ABCBUS_SLOT(config, "io7", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr); +} diff --git a/src/devices/bus/abcbus/abcbus.h b/src/devices/bus/abcbus/abcbus.h index 5bd338b05d7..2388fbc73cf 100644 --- a/src/devices/bus/abcbus/abcbus.h +++ b/src/devices/bus/abcbus/abcbus.h @@ -111,47 +111,6 @@ //************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_ABCBUS_SLOT_ADD(_tag, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, ABCBUS_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - - -#define MCFG_ABCBUS_SLOT_IRQ_CALLBACK(_irq) \ - downcast<abcbus_slot_device *>(device)->set_irq_callback(DEVCB_##_irq); - -#define MCFG_ABCBUS_SLOT_NMI_CALLBACK(_nmi) \ - downcast<abcbus_slot_device *>(device)->set_nmi_callback(DEVCB_##_nmi); - -#define MCFG_ABCBUS_SLOT_RDY_CALLBACK(_rdy) \ - downcast<abcbus_slot_device *>(device)->set_rdy_callback(DEVCB_##_rdy); - -#define MCFG_ABCBUS_SLOT_RESIN_CALLBACK(_resin) \ - downcast<abcbus_slot_device *>(device)->set_resin_callback(DEVCB_##_resin); - -#define MCFG_ABCBUS_SLOT_PREN_CALLBACK(_pren) \ - downcast<abcbus_slot_device *>(device)->set_pren_callback(DEVCB_##_pren); - -#define MCFG_ABCBUS_SLOT_TRRQ_CALLBACK(_trrq) \ - downcast<abcbus_slot_device *>(device)->set_trrq_callback(DEVCB_##_trrq); - -#define MCFG_ABCBUS_SLOT_XINT2_CALLBACK(_xint2) \ - downcast<abcbus_slot_device *>(device)->set_xint2_callback(DEVCB_##_xint2); - -#define MCFG_ABCBUS_SLOT_XINT3_CALLBACK(_xint3) \ - downcast<abcbus_slot_device *>(device)->set_xint3_callback(DEVCB_##_xint3); - -#define MCFG_ABCBUS_SLOT_XINT4_CALLBACK(_xint4) \ - downcast<abcbus_slot_device *>(device)->set_xint4_callback(DEVCB_##_xint4); - -#define MCFG_ABCBUS_SLOT_XINT5_CALLBACK(_xint5) \ - downcast<abcbus_slot_device *>(device)->set_xint5_callback(DEVCB_##_xint5); - - - -//************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -207,17 +166,26 @@ class abcbus_slot_device : public device_t, public: // construction/destruction abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_nmi_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_rdy_callback(Object &&cb) { return m_write_rdy.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_resin_callback(Object &&cb) { return m_write_resin.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_pren_callback(Object &&cb) { return m_write_pren.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_trrq_callback(Object &&cb) { return m_write_trrq.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_xint2_callback(Object &&cb) { return m_write_xint2.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_xint3_callback(Object &&cb) { return m_write_xint3.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_xint4_callback(Object &&cb) { return m_write_xint4.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_xint5_callback(Object &&cb) { return m_write_xint5.set_callback(std::forward<Object>(cb)); } + template <typename T> + abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&opts, const char *dflt) + : abcbus_slot_device(mconfig, tag, owner, clock) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + + auto irq_callback() { return m_write_irq.bind(); } + auto nmi_callback() { return m_write_nmi.bind(); } + auto rdy_callback() { return m_write_rdy.bind(); } + auto resin_callback() { return m_write_resin.bind(); } + auto pren_callback() { return m_write_pren.bind(); } + auto trrq_callback() { return m_write_trrq.bind(); } + auto xint2_callback() { return m_write_xint2.bind(); } + auto xint3_callback() { return m_write_xint3.bind(); } + auto xint4_callback() { return m_write_xint4.bind(); } + auto xint5_callback() { return m_write_xint5.bind(); } // computer interface void write_cs(uint8_t data) { if (m_card) m_card->abcbus_cs(data); } diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp index 6c07edd8d8b..872ebc4bf9c 100644 --- a/src/mame/drivers/abc1600.cpp +++ b/src/mame/drivers/abc1600.cpp @@ -953,21 +953,21 @@ MACHINE_CONFIG_START(abc1600_state::abc1600) MCFG_ABC_KEYBOARD_OUT_TRXC_HANDLER(WRITELINE(m_dart, z80dart_device, rxtxcb_w)) MCFG_ABC_KEYBOARD_OUT_KEYDOWN_HANDLER(WRITELINE(m_dart, z80dart_device, dcdb_w)) - MCFG_ABCBUS_SLOT_ADD("bus0i", abc1600bus_cards, nullptr) - MCFG_ABCBUS_SLOT_IRQ_CALLBACK(WRITELINE(m_cio, z8536_device, pa7_w)) - MCFG_ABCBUS_SLOT_ADD("bus0x", abc1600bus_cards, nullptr) - MCFG_ABCBUS_SLOT_IRQ_CALLBACK(WRITELINE(m_cio, z8536_device, pa6_w)) - MCFG_ABCBUS_SLOT_NMI_CALLBACK(WRITELINE(*this, abc1600_state, nmi_w)) - MCFG_ABCBUS_SLOT_XINT2_CALLBACK(WRITELINE(m_cio, z8536_device, pa2_w)) - MCFG_ABCBUS_SLOT_XINT3_CALLBACK(WRITELINE(m_cio, z8536_device, pa3_w)) - MCFG_ABCBUS_SLOT_XINT4_CALLBACK(WRITELINE(m_cio, z8536_device, pa4_w)) - MCFG_ABCBUS_SLOT_XINT5_CALLBACK(WRITELINE(m_cio, z8536_device, pa5_w)) - MCFG_ABCBUS_SLOT_ADD("bus1", abc1600bus_cards, nullptr) - MCFG_ABCBUS_SLOT_IRQ_CALLBACK(WRITELINE(m_cio, z8536_device, pa1_w)) - MCFG_ABCBUS_SLOT_ADD("bus2", abc1600bus_cards, "4105") - MCFG_ABCBUS_SLOT_IRQ_CALLBACK(WRITELINE(m_cio, z8536_device, pa0_w)) - //MCFG_ABCBUS_SLOT_PREN_CALLBACK(WRITELINE(Z8410AB1_2_TAG, z80dma_device, iei_w)) - MCFG_ABCBUS_SLOT_TRRQ_CALLBACK(WRITELINE(Z8410AB1_2_TAG, z80dma_device, rdy_w)) + abcbus_slot_device &bus0i(ABCBUS_SLOT(config, "bus0i", 64_MHz_XTAL / 16, abc1600bus_cards, nullptr)); + bus0i.irq_callback().set(m_cio, FUNC(z8536_device::pa7_w)); + abcbus_slot_device &bus0x(ABCBUS_SLOT(config, "bus0x", 64_MHz_XTAL / 16, abc1600bus_cards, nullptr)); + bus0x.irq_callback().set(m_cio, FUNC(z8536_device::pa6_w)); + bus0x.nmi_callback().set(FUNC(abc1600_state::nmi_w)); + bus0x.xint2_callback().set(m_cio, FUNC(z8536_device::pa2_w)); + bus0x.xint3_callback().set(m_cio, FUNC(z8536_device::pa3_w)); + bus0x.xint4_callback().set(m_cio, FUNC(z8536_device::pa4_w)); + bus0x.xint5_callback().set(m_cio, FUNC(z8536_device::pa5_w)); + abcbus_slot_device &bus1(ABCBUS_SLOT(config, "bus1", 64_MHz_XTAL / 16, abc1600bus_cards, nullptr)); + bus1.irq_callback().set(m_cio, FUNC(z8536_device::pa1_w)); + abcbus_slot_device &bus2(ABCBUS_SLOT(config, "bus2", 64_MHz_XTAL / 16, abc1600bus_cards, "4105")); + bus2.irq_callback().set(m_cio, FUNC(z8536_device::pa0_w)); + //bus2.pren_callback().set(Z8410AB1_2_TAG, FUNC(z80dma_device::iei_w)); + bus2.trrq_callback().set(Z8410AB1_2_TAG, FUNC(z80dma_device::rdy_w)); // internal ram RAM(config, RAM_TAG).set_default_size("1M"); diff --git a/src/mame/drivers/abc80.cpp b/src/mame/drivers/abc80.cpp index 7854e115004..32863da241f 100644 --- a/src/mame/drivers/abc80.cpp +++ b/src/mame/drivers/abc80.cpp @@ -525,7 +525,7 @@ MACHINE_CONFIG_START(abc80_state::abc80) ABC80_KEYBOARD(config, m_kb, 0); m_kb->keydown_wr_callback().set(FUNC(abc80_state::keydown_w)); - MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abc80_cards, "abcexp") + ABCBUS_SLOT(config, ABCBUS_TAG, XTAL(11'980'800)/2/2, abc80_cards, "abcexp"); RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr); generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, KEYBOARD_TAG, 0)); diff --git a/src/mame/drivers/abc80x.cpp b/src/mame/drivers/abc80x.cpp index d97036b38f1..8315caa431a 100644 --- a/src/mame/drivers/abc80x.cpp +++ b/src/mame/drivers/abc80x.cpp @@ -1102,7 +1102,7 @@ MACHINE_CONFIG_START(abc800_state::common) MCFG_ABC_KEYBOARD_OUT_TRXC_HANDLER(WRITELINE(m_dart, z80dart_device, rxtxcb_w)) MCFG_ABC_KEYBOARD_OUT_KEYDOWN_HANDLER(WRITELINE(m_dart, z80dart_device, dcdb_w)) - MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abcbus_cards, nullptr) + ABCBUS_SLOT(config, ABCBUS_TAG, ABC800_X01/2/2, abcbus_cards, nullptr); // sound hardware SPEAKER(config, "mono").front_center(); |