diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-08-28 16:01:05 +0200 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-08-29 19:07:51 +0200 |
commit | 8ac98fea56b7c409f5917d78ceafa6bb7a97b653 (patch) | |
tree | fdbb7c373b0d0d437b8d906b997134a381e8620e | |
parent | 5d0aef3b01784fc567b2deb2457abd322d8c0a56 (diff) |
i2cmem,i7220,i80130,i8087,i8212,i8214,i82371sb,i8243: Removed MCFG, nw
38 files changed, 156 insertions, 307 deletions
diff --git a/src/devices/bus/lpci/i82371sb.h b/src/devices/bus/lpci/i82371sb.h index 0352b13e445..7411a6ebea2 100644 --- a/src/devices/bus/lpci/i82371sb.h +++ b/src/devices/bus/lpci/i82371sb.h @@ -24,8 +24,8 @@ public: // construction/destruction i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_smi_callback(Object &&cb) { return m_smi_callback.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_boot_state_hook(Object &&cb) { return m_boot_state_hook.set_callback(std::forward<Object>(cb)); } + auto smi() { return m_smi_callback.bind(); } + auto boot_state_hook() { return m_boot_state_hook.bind(); } virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; @@ -66,10 +66,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(I82371SB, i82371sb_device) -#define MCFG_I82371SB_SMI_CB(_devcb) \ - downcast<i82371sb_device &>(*device).set_smi_callback(DEVCB_##_devcb); - -#define MCFG_I82371SB_BOOT_STATE_HOOK(_devcb) \ - downcast<i82371sb_device &>(*device).set_boot_state_hook(DEVCB_##_devcb); - #endif // MAME_BUS_LPCI_I82371SB_H diff --git a/src/devices/machine/i2cmem.h b/src/devices/machine/i2cmem.h index 68bef6dde2f..32a40dba6af 100644 --- a/src/devices/machine/i2cmem.h +++ b/src/devices/machine/i2cmem.h @@ -91,13 +91,13 @@ public: // construction/destruction i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); - void set_address(int address) { m_slave_address = address; } - void set_page_size(int page_size) { m_page_size = page_size; } - void set_data_size(int data_size) { m_data_size = data_size; } - void set_e0(int e0) { m_e0 = e0; } - void set_e1(int e1) { m_e1 = e1; } - void set_e2(int e2) { m_e2 = e2; } - void set_wc(int wc) { m_wc = wc; } + i2cmem_device & set_address(int address) { m_slave_address = address; return *this; } + i2cmem_device & set_page_size(int page_size) { m_page_size = page_size; return *this; } + i2cmem_device & set_data_size(int data_size) { m_data_size = data_size; return *this; } + i2cmem_device & set_e0(int e0) { m_e0 = e0; return *this; } + i2cmem_device & set_e1(int e1) { m_e1 = e1; return *this; } + i2cmem_device & set_e2(int e2) { m_e2 = e2; return *this; } + i2cmem_device & set_wc(int wc) { m_wc = wc; return *this; } // I/O operations DECLARE_WRITE_LINE_MEMBER( write_e0 ); diff --git a/src/devices/machine/i7220.h b/src/devices/machine/i7220.h index 51eaf3ce917..0d142286092 100644 --- a/src/devices/machine/i7220.h +++ b/src/devices/machine/i7220.h @@ -37,28 +37,6 @@ #define I7110_MBM_SIZE (128 * 1024) // 1 megabit #define I7115_MBM_SIZE (512 * 1024) // 4 megabit - -///************************************************************************* -// INTERFACE CONFIGURATION MACROS -///************************************************************************* - -#define MCFG_I7220_IRQ_CALLBACK(_write) \ - downcast<i7220_device &>(*device).set_intrq_wr_callback(DEVCB_##_write); - -#define MCFG_I7220_DRQ_CALLBACK(_write) \ - downcast<i7220_device &>(*device).set_drq_wr_callback(DEVCB_##_write); - -#define MCFG_I7220_DATA_SIZE(data_size) \ - downcast<i7220_device &>(*device).set_data_size(data_size); - - - -///************************************************************************* -// TYPE DEFINITIONS -///************************************************************************* - -// ======================> i7220_device - class i7220_device : public device_t, public device_image_interface { @@ -66,8 +44,8 @@ public: // construction/destruction i7220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_intrq_wr_callback(Object &&cb) { return intrq_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_drq_wr_callback(Object &&cb) { return drq_cb.set_callback(std::forward<Object>(cb)); } + auto irq_callback() { return intrq_cb.bind(); } + auto drq_callback() { return drq_cb.bind(); } void set_data_size(int data_size) { m_data_size = data_size; } diff --git a/src/devices/machine/i80130.h b/src/devices/machine/i80130.h index c4ce3d855aa..27f6e9c582d 100644 --- a/src/devices/machine/i80130.h +++ b/src/devices/machine/i80130.h @@ -14,50 +14,18 @@ #include "machine/pic8259.h" #include "machine/pit8253.h" - - -///************************************************************************* -// INTERFACE CONFIGURATION MACROS -///************************************************************************* - -#define MCFG_I80130_IRQ_CALLBACK(_write) \ - downcast<i80130_device &>(*device).set_irq_wr_callback(DEVCB_##_write); - -#define MCFG_I80130_ACK_CALLBACK(_write) \ - downcast<i80130_device &>(*device).set_ack_wr_callback(DEVCB_##_write); - -#define MCFG_I80130_LIR_CALLBACK(_write) \ - downcast<i80130_device &>(*device).set_lir_wr_callback(DEVCB_##_write); - -#define MCFG_I80130_SYSTICK_CALLBACK(_write) \ - downcast<i80130_device &>(*device).set_systick_wr_callback(DEVCB_##_write); - -#define MCFG_I80130_DELAY_CALLBACK(_write) \ - downcast<i80130_device &>(*device).set_delay_wr_callback(DEVCB_##_write); - -#define MCFG_I80130_BAUD_CALLBACK(_write) \ - downcast<i80130_device &>(*device).set_baud_wr_callback(DEVCB_##_write); - - - -///************************************************************************* -// TYPE DEFINITIONS -///************************************************************************* - -// ======================> i80130_device - class i80130_device : public device_t { public: // construction/destruction i80130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_ack_wr_callback(Object &&cb) { return m_write_ack.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_lir_wr_callback(Object &&cb) { return m_write_lir.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_systick_wr_callback(Object &&cb) { return m_write_systick.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_delay_wr_callback(Object &&cb) { return m_write_delay.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_baud_wr_callback(Object &&cb) { return m_write_baud.set_callback(std::forward<Object>(cb)); } + auto irq() { return m_write_irq.bind(); } + auto ack() { return m_write_ack.bind(); } + auto lir() { return m_write_lir.bind(); } + auto systick() { return m_write_systick.bind(); } + auto delay() { return m_write_delay.bind(); } + auto baud() { return m_write_baud.bind(); } virtual void rom_map(address_map &map); virtual void io_map(address_map &map); diff --git a/src/devices/machine/i8087.h b/src/devices/machine/i8087.h index e0d5ab7e87e..290b9a95b16 100644 --- a/src/devices/machine/i8087.h +++ b/src/devices/machine/i8087.h @@ -8,15 +8,6 @@ #include "softfloat/softfloat.h" #endif -#define MCFG_I8087_DATA_WIDTH(_data_width) \ - downcast<i8087_device &>(*device).set_data_width(_data_width); - -#define MCFG_I8087_INT_HANDLER(_devcb) \ - downcast<i8087_device &>(*device).set_int(DEVCB_##_devcb); - -#define MCFG_I8087_BUSY_HANDLER(_devcb) \ - downcast<i8087_device &>(*device).set_busy(DEVCB_##_devcb); - DECLARE_DEVICE_TYPE(I8087, i8087_device) class i8087_device : public device_t, @@ -25,8 +16,8 @@ class i8087_device : public device_t, public: i8087_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); void set_data_width(u8 data_width) { m_data_width = data_width; } - template <class Object> devcb_base &set_int(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_busy(Object &&cb) { return m_busy_handler.set_callback(std::forward<Object>(cb)); } + auto irq() { return m_int_handler.bind(); } + auto busy() { return m_busy_handler.bind(); } DECLARE_WRITE32_MEMBER(insn_w); // the real 8087 sniffs the bus watching for esc, can't do that here so provide a poke spot DECLARE_WRITE32_MEMBER(addr_w); diff --git a/src/devices/machine/i8212.h b/src/devices/machine/i8212.h index 477f9d8689b..255a4edc469 100644 --- a/src/devices/machine/i8212.h +++ b/src/devices/machine/i8212.h @@ -26,33 +26,6 @@ #pragma once - - - -///************************************************************************* -// INTERFACE CONFIGURATION MACROS -///************************************************************************* - -#define MCFG_I8212_INT_CALLBACK(_write) \ - downcast<i8212_device &>(*device).set_int_wr_callback(DEVCB_##_write); - -#define MCFG_I8212_DI_CALLBACK(_read) \ - downcast<i8212_device &>(*device).set_di_rd_callback(DEVCB_##_read); - -#define MCFG_I8212_DO_CALLBACK(_write) \ - downcast<i8212_device &>(*device).set_do_wr_callback(DEVCB_##_write); - -#define MCFG_I8212_MD_CALLBACK(_read) \ - downcast<i8212_device &>(*device).set_md_rd_callback(DEVCB_##_read); - - - -///************************************************************************* -// TYPE DEFINITIONS -///************************************************************************* - -// ======================> i8212_device - class i8212_device : public device_t { enum class mode : u8 diff --git a/src/devices/machine/i8214.h b/src/devices/machine/i8214.h index dc609c24f15..6181fe05d81 100644 --- a/src/devices/machine/i8214.h +++ b/src/devices/machine/i8214.h @@ -26,34 +26,12 @@ #pragma once - - -///************************************************************************* -// INTERFACE CONFIGURATION MACROS -///************************************************************************* - -#define MCFG_I8214_INT_CALLBACK(_write) \ - downcast<i8214_device &>(*device).set_int_wr_callback(DEVCB_##_write); - -#define MCFG_I8214_ENLG_CALLBACK(_write) \ - downcast<i8214_device &>(*device).set_enlg_wr_callback(DEVCB_##_write); - - - -///************************************************************************* -// TYPE DEFINITIONS -///************************************************************************* - -// ======================> i8214_device - class i8214_device : public device_t { public: // construction/destruction i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_int_wr_callback(Object &&cb) { return m_write_int.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_enlg_wr_callback(Object &&cb) { return m_write_enlg.set_callback(std::forward<Object>(cb)); } auto int_wr_callback() { return m_write_int.bind(); } auto enlg_wr_callback() { return m_write_enlg.bind(); } diff --git a/src/devices/machine/i82371sb.h b/src/devices/machine/i82371sb.h index 5f39b9ed07f..ea7976ad845 100644 --- a/src/devices/machine/i82371sb.h +++ b/src/devices/machine/i82371sb.h @@ -24,18 +24,12 @@ #include "machine/am9517a.h" -#define MCFG_I82371SB_SMI_CB(_devcb) \ - downcast<i82371sb_isa_device &>(*device).set_smi_callback(DEVCB_##_devcb); - -#define MCFG_I82371SB_BOOT_STATE_HOOK(_devcb) \ - downcast<i82371sb_isa_device &>(*device).set_boot_state_hook(DEVCB_##_devcb); - class i82371sb_isa_device : public pci_device { public: i82371sb_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_smi_callback(Object &&cb) { return m_smi_callback.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_boot_state_hook(Object &&cb) { return m_boot_state_hook.set_callback(std::forward<Object>(cb)); } + auto smi() { return m_smi_callback.bind(); } + auto boot_state_hook() { return m_boot_state_hook.bind(); } DECLARE_WRITE_LINE_MEMBER(pc_pirqa_w); DECLARE_WRITE_LINE_MEMBER(pc_pirqb_w); @@ -207,22 +201,13 @@ private: DECLARE_DEVICE_TYPE(I82371SB_ISA, i82371sb_isa_device) -#define MCFG_I82371SB_IDE_IRQ_PRI_CB(_devcb) \ - downcast<i82371sb_ide_device &>(*device).set_irq_pri_callback(DEVCB_##_devcb); - -#define MCFG_I82371SB_IDE_IRQ_SEC_CB(_devcb) \ - downcast<i82371sb_ide_device &>(*device).set_irq_sec_callback(DEVCB_##_devcb); - -#define MCFG_I82371SB_IDE_INTERRUPTS(_tag, _dev, _irq_pri, _irq_sec) \ - MCFG_I82371SB_IDE_IRQ_PRI_CB(WRITELINE(_tag, _dev, _irq_pri)) \ - MCFG_I82371SB_IDE_IRQ_SEC_CB(WRITELINE(_tag, _dev, _irq_sec)) class i82371sb_ide_device : public pci_device { public: i82371sb_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_irq_pri_callback(Object &&cb) { return m_irq_pri_callback.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_irq_sec_callback(Object &&cb) { return m_irq_sec_callback.set_callback(std::forward<Object>(cb)); } + auto irq_pri() { return m_irq_pri_callback.bind(); } + auto irq_sec() { return m_irq_sec_callback.bind(); } protected: virtual void device_start() override; diff --git a/src/devices/machine/i8243.h b/src/devices/machine/i8243.h index 76c4b601bd8..cea6fe4f468 100644 --- a/src/devices/machine/i8243.h +++ b/src/devices/machine/i8243.h @@ -13,36 +13,15 @@ #pragma once - - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_I8243_ADD(_tag, _read, _write) \ - MCFG_DEVICE_ADD(_tag, I8243, 0) \ - MCFG_I8243_READHANDLER(_read) \ - MCFG_I8243_WRITEHANDLER(_write) -#define MCFG_I8243_READHANDLER(_devcb) \ - downcast<i8243_device &>(*device).set_read_handler(DEVCB_##_devcb); -#define MCFG_I8243_WRITEHANDLER(_devcb) \ - downcast<i8243_device &>(*device).set_write_handler(DEVCB_##_devcb); -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - - -// ======================> i8243_device - class i8243_device : public device_t { public: // construction/destruction - i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); // configuration helpers - template <class Object> devcb_base &set_read_handler(Object &&cb) { return m_readhandler.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_handler(Object &&cb) { return m_writehandler.set_callback(std::forward<Object>(cb)); } + auto read_handler() { return m_readhandler.bind(); } + auto write_handler() { return m_writehandler.bind(); } DECLARE_READ8_MEMBER(p2_r); DECLARE_WRITE8_MEMBER(p2_w); diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp index 4e83f39f723..0120a039723 100644 --- a/src/mame/audio/segag80r.cpp +++ b/src/mame/audio/segag80r.cpp @@ -703,9 +703,9 @@ MACHINE_CONFIG_START(monsterb_sound_device::device_add_mconfig) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, monsterb_sound_device, n7751_p2_w)) MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) - MCFG_DEVICE_ADD(m_i8243, I8243, 0) - MCFG_I8243_READHANDLER(CONSTANT(0)) - MCFG_I8243_WRITEHANDLER(WRITE8(*this, monsterb_sound_device, n7751_rom_control_w)) + I8243(config, m_i8243); + m_i8243->read_handler().set_constant(0); + m_i8243->write_handler().set(FUNC(monsterb_sound_device::n7751_rom_control_w)); MCFG_DEVICE_ADD(m_samples, SAMPLES) MCFG_SAMPLES_CHANNELS(2) diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp index 134c0984ad9..56652a50223 100644 --- a/src/mame/drivers/a7150.cpp +++ b/src/mame/drivers/a7150.cpp @@ -475,11 +475,11 @@ MACHINE_CONFIG_START(a7150_state::a7150) MCFG_I8086_ESC_OPCODE_HANDLER(WRITE32("i8087", i8087_device, insn_w)) MCFG_I8086_ESC_DATA_HANDLER(WRITE32("i8087", i8087_device, addr_w)) - MCFG_DEVICE_ADD("i8087", I8087, XTAL(9'832'000)/2) - MCFG_DEVICE_PROGRAM_MAP(a7150_mem) - MCFG_I8087_DATA_WIDTH(16) - MCFG_I8087_INT_HANDLER(WRITELINE("pic8259", pic8259_device, ir0_w)) - MCFG_I8087_BUSY_HANDLER(INPUTLINE("maincpu", INPUT_LINE_TEST)) + i8087_device &i8087(I8087(config, "i8087", XTAL(9'832'000)/2)); + i8087.set_addrmap(AS_PROGRAM, &a7150_state::a7150_mem); + i8087.set_data_width(16); + i8087.irq().set("pic8259", FUNC(pic8259_device::ir0_w)); + i8087.busy().set_inputline("maincpu", INPUT_LINE_TEST); MCFG_DEVICE_ADD("pic8259", PIC8259, 0) MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0)) diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp index 4264e183cea..0e88415e344 100644 --- a/src/mame/drivers/aa310.cpp +++ b/src/mame/drivers/aa310.cpp @@ -415,8 +415,7 @@ MACHINE_CONFIG_START(aa310_state::aa310) m_kart->out_tx_callback().set(FUNC(archimedes_state::a310_kart_tx_w)); m_kart->out_rx_callback().set(FUNC(archimedes_state::a310_kart_rx_w)); - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_DATA_SIZE(0x100) + I2CMEM(config, "i2cmem", 0).set_data_size(0x100); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index ffa5bd40d63..70338e2767d 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -2115,9 +2115,7 @@ MACHINE_CONFIG_START(cd32_state::cd32) ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000); - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_PAGE_SIZE(16) - MCFG_I2CMEM_DATA_SIZE(1024) + I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(1024); akiko_device &akiko(AKIKO(config, "akiko", 0)); akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r)); diff --git a/src/mame/drivers/atpci.cpp b/src/mame/drivers/atpci.cpp index 9e30991eac1..245457197dc 100644 --- a/src/mame/drivers/atpci.cpp +++ b/src/mame/drivers/atpci.cpp @@ -54,10 +54,9 @@ void at586_state::tx_config(device_t *device) void at586_state::sb_config(device_t *device) { - devcb_base *devcb = nullptr; - (void)devcb; - MCFG_I82371SB_BOOT_STATE_HOOK(WRITE8(":", at586_state, boot_state_w)) - MCFG_I82371SB_SMI_CB(INPUTLINE(":maincpu", INPUT_LINE_SMI)) + i82371sb_device &sb = *downcast<i82371sb_device *>(device); + sb.boot_state_hook().set(":", FUNC(at586_state::boot_state_w)); + sb.smi().set_inputline(":maincpu", INPUT_LINE_SMI); } diff --git a/src/mame/drivers/bitgraph.cpp b/src/mame/drivers/bitgraph.cpp index daa34c09570..81b5c99a942 100644 --- a/src/mame/drivers/bitgraph.cpp +++ b/src/mame/drivers/bitgraph.cpp @@ -565,7 +565,9 @@ MACHINE_CONFIG_START(bitgraph_state::bg_ppu) // MCFG_MCS48_PORT_T0_IN_CB(READLINE(*this, bitgraph_state, ppu_t0_r)) MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("i8243", i8243_device, prog_w)) - MCFG_I8243_ADD("i8243", NOOP, WRITE8(*this, bitgraph_state, ppu_i8243_w)) + i8243_device &i8243(I8243(config, "i8243")); + i8243.read_handler().set_nop(); + i8243.write_handler().set(FUNC(bitgraph_state::ppu_i8243_w)); MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit6)) diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp index 4f197fcdfff..32ec546c762 100644 --- a/src/mame/drivers/cmi.cpp +++ b/src/mame/drivers/cmi.cpp @@ -220,9 +220,7 @@ public: , m_midicpu(*this, "smptemidi") , m_cmi07cpu(*this, "cmi07cpu") , m_msm5832(*this, "msm5832") - , m_i8214_0(*this, "i8214_1") - , m_i8214_1(*this, "i8214_2") - , m_i8214_2(*this, "i8214_3") + , m_i8214(*this, "i8214_%u", 1U) , m_q133_pia(*this, "q133_pia_%u", 1U) , m_q133_ptm(*this, "q133_ptm") , m_q133_acia(*this, "q133_acia_%u", 0U) @@ -377,9 +375,7 @@ protected: required_device<mc6809e_device> m_cmi07cpu; required_device<msm5832_device> m_msm5832; - required_device<i8214_device> m_i8214_0; - required_device<i8214_device> m_i8214_1; - required_device<i8214_device> m_i8214_2; + required_device_array<i8214_device, 3> m_i8214; required_device_array<pia6821_device, 2> m_q133_pia; required_device<ptm6840_device> m_q133_ptm; required_device_array<mos6551_device, 4> m_q133_acia; @@ -1585,8 +1581,8 @@ WRITE8_MEMBER( cmi_state::cmi02_w ) case 0x30: m_maincpu1->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); data ^= 0xff; - m_i8214_2->sgs_w((data >> 3) & 1); - m_i8214_2->b_w(data & 0x7); + m_i8214[2]->sgs_w((data >> 3) & 1); + m_i8214[2]->b_w(data & 0x7); break; case 0x31: case 0x32: @@ -1625,8 +1621,8 @@ WRITE8_MEMBER( cmi_state::i8214_cpu1_w ) //printf("i8214_cpu1_w: %02x\n", data); m_maincpu1->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); data ^= 0xff; - m_i8214_0->sgs_w((data >> 3) & 1); - m_i8214_0->b_w(data & 0x7); + m_i8214[0]->sgs_w((data >> 3) & 1); + m_i8214[0]->b_w(data & 0x7); } @@ -1635,8 +1631,8 @@ WRITE8_MEMBER( cmi_state::i8214_cpu2_w ) //printf("i8214_cpu2_w: %02x\n", data); m_maincpu2->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); data ^= 0xff; - m_i8214_1->sgs_w((data >> 3) & 1); - m_i8214_1->b_w(data & 0x7); + m_i8214[1]->sgs_w((data >> 3) & 1); + m_i8214[1]->b_w(data & 0x7); } // TODO: replace with AM_SHARE @@ -1732,7 +1728,7 @@ IRQ_CALLBACK_MEMBER( cmi_state::cpu1_interrupt_callback ) if (irqline == INPUT_LINE_IRQ0) { int vector = (m_hp_int ? 0xffe0 : 0xffd0); - int level = (m_hp_int ? m_i8214_2->a_r() : m_i8214_0->a_r()) ^ 7; + int level = (m_hp_int ? m_i8214[2]->a_r() : m_i8214[0]->a_r()) ^ 7; m_irq_address[CPU_1][0] = m_cpu1space->read_byte(vector + level*2); m_irq_address[CPU_1][1] = m_cpu1space->read_byte(vector + level*2 + 1); @@ -1753,7 +1749,7 @@ IRQ_CALLBACK_MEMBER( cmi_state::cpu2_interrupt_callback ) if (irqline == INPUT_LINE_IRQ0) { - int level = m_i8214_1->a_r() ^ 0x7; + int level = m_i8214[1]->a_r() ^ 0x7; m_irq_address[CPU_2][0] = m_cpu2space->read_byte(0xffe0 + level*2); m_irq_address[CPU_2][1] = m_cpu2space->read_byte(0xffe0 + level*2 + 1); @@ -1769,7 +1765,7 @@ void cmi_state::set_interrupt(int cpunum, int level, int state) { //printf("CPU%d Int: %x State: %x\n", cpunum + 1, level, state); - i8214_device *i8214 = ((cpunum == CPU_2) ? m_i8214_1 : (level < 8 ? m_i8214_2 : m_i8214_0)); + i8214_device *i8214 = ((cpunum == CPU_2) ? m_i8214[1] : (level < 8 ? m_i8214[2] : m_i8214[0])); i8214->r_w(level & 7, state ? 0 : 1); } @@ -2063,12 +2059,12 @@ void cmi_state::machine_reset() m_qfc9_region_ptr = (uint8_t *)m_qfc9_region->base(); /* Set 8214 interrupt lines */ - m_i8214_0->etlg_w(1); - m_i8214_0->inte_w(1); - m_i8214_1->etlg_w(1); - m_i8214_1->inte_w(1); - m_i8214_2->etlg_w(1); - m_i8214_2->inte_w(1); + m_i8214[0]->etlg_w(1); + m_i8214[0]->inte_w(1); + m_i8214[1]->etlg_w(1); + m_i8214[1]->inte_w(1); + m_i8214[2]->etlg_w(1); + m_i8214[2]->inte_w(1); m_hblank_timer->adjust(m_screen->time_until_pos(0, HBLANK_START)); @@ -2203,13 +2199,13 @@ MACHINE_CONFIG_START(cmi_state::cmi2x) MCFG_DEVICE_ADD("msm5832", MSM5832, 32.768_kHz_XTAL) - MCFG_DEVICE_ADD("i8214_1", I8214, 1000000) // cmi_8214_intf_1 - MCFG_I8214_INT_CALLBACK(WRITELINE(*this, cmi_state, i8214_1_int_w)) - MCFG_DEVICE_ADD("i8214_2", I8214, 1000000) // cmi_8214_intf_2 - MCFG_I8214_INT_CALLBACK(WRITELINE(*this, cmi_state, i8214_2_int_w)) - MCFG_DEVICE_ADD("i8214_3", I8214, 1000000) // cmi_8214_intf_3 - MCFG_I8214_INT_CALLBACK(WRITELINE(*this, cmi_state, i8214_3_int_w)) - MCFG_I8214_ENLG_CALLBACK(WRITELINE(*this, cmi_state, i8214_3_enlg)) + I8214(config, m_i8214[0], 1000000); // cmi_8214_intf_1 + m_i8214[0]->int_wr_callback().set(FUNC(cmi_state::i8214_1_int_w)); + I8214(config, m_i8214[1], 1000000); // cmi_8214_intf_2 + m_i8214[1]->int_wr_callback().set(FUNC(cmi_state::i8214_2_int_w)); + I8214(config, m_i8214[2], 1000000); // cmi_8214_intf_3 + m_i8214[2]->int_wr_callback().set(FUNC(cmi_state::i8214_3_int_w)); + m_i8214[2]->enlg_wr_callback().set(FUNC(cmi_state::i8214_3_enlg)); PIA6821(config, m_q133_pia[0], 0); // pia_q133_1_config m_q133_pia[0]->readpa_handler().set(FUNC(cmi_state::q133_1_porta_r)); diff --git a/src/mame/drivers/compis.cpp b/src/mame/drivers/compis.cpp index af196a82eb9..70c73817d0e 100644 --- a/src/mame/drivers/compis.cpp +++ b/src/mame/drivers/compis.cpp @@ -761,11 +761,11 @@ MACHINE_CONFIG_START(compis_state::compis) MCFG_80186_TMROUT1_HANDLER(WRITELINE(DEVICE_SELF, compis_state, tmr1_w)) // devices - MCFG_DEVICE_ADD(I80130_TAG, I80130, 15.36_MHz_XTAL/2) - MCFG_I80130_IRQ_CALLBACK(WRITELINE(I80186_TAG, i80186_cpu_device, int0_w)) - MCFG_I80130_SYSTICK_CALLBACK(WRITELINE(I80130_TAG, i80130_device, ir3_w)) - MCFG_I80130_DELAY_CALLBACK(WRITELINE(I80130_TAG, i80130_device, ir7_w)) - MCFG_I80130_BAUD_CALLBACK(WRITELINE(*this, compis_state, tmr2_w)) + I80130(config, m_osp, 15.36_MHz_XTAL/2); + m_osp->irq().set(I80186_TAG, FUNC(i80186_cpu_device::int0_w)); + m_osp->systick().set(I80130_TAG, FUNC(i80130_device::ir3_w)); + m_osp->delay().set(I80130_TAG, FUNC(i80130_device::ir7_w)); + m_osp->baud().set(FUNC(compis_state::tmr2_w)); MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0) MCFG_PIT8253_CLK0(15.36_MHz_XTAL/8) diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp index 5dfa7551b87..2eafaa32783 100644 --- a/src/mame/drivers/cubo.cpp +++ b/src/mame/drivers/cubo.cpp @@ -1038,9 +1038,7 @@ MACHINE_CONFIG_START(cubo_state::cubo) ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000); - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_PAGE_SIZE(16) - MCFG_I2CMEM_DATA_SIZE(1024) + I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(1024); akiko_device &akiko(AKIKO(config, "akiko", 0)); akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r)); diff --git a/src/mame/drivers/cxhumax.cpp b/src/mame/drivers/cxhumax.cpp index c76d565ca51..d64bc10c2ec 100644 --- a/src/mame/drivers/cxhumax.cpp +++ b/src/mame/drivers/cxhumax.cpp @@ -1061,8 +1061,7 @@ MACHINE_CONFIG_START(cxhumax_state::cxhumax) MCFG_INTEL_28F320J3D_ADD("flash") - MCFG_I2CMEM_ADD("eeprom") - MCFG_I2CMEM_DATA_SIZE(0x2000) + I2CMEM(config, "eeprom", 0).set_data_size(0x2000); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp index 1d507ef9632..902a606b914 100644 --- a/src/mame/drivers/ertictac.cpp +++ b/src/mame/drivers/ertictac.cpp @@ -229,9 +229,8 @@ MACHINE_CONFIG_START(ertictac_state::ertictac) MCFG_DEVICE_PROGRAM_MAP(ertictac_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(ertictac_state, ertictac_podule_irq, 60) // FIXME: timing of this - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_PAGE_SIZE(NVRAM_PAGE_SIZE) - MCFG_I2CMEM_DATA_SIZE(NVRAM_SIZE) + I2CMEM(config, "i2cmem", 0).set_page_size(NVRAM_PAGE_SIZE).set_data_size(NVRAM_SIZE); + // AAKART(config, m_kart, XTAL(24'000'000)/3); // TODO: frequency MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/fanucspmg.cpp b/src/mame/drivers/fanucspmg.cpp index 77a503c283b..840934afffa 100644 --- a/src/mame/drivers/fanucspmg.cpp +++ b/src/mame/drivers/fanucspmg.cpp @@ -975,11 +975,11 @@ MACHINE_CONFIG_START(fanucspmg_state::fanucspmg) MCFG_I8086_ESC_OPCODE_HANDLER(WRITE32("i8087", i8087_device, insn_w)) MCFG_I8086_ESC_DATA_HANDLER(WRITE32("i8087", i8087_device, addr_w)) - MCFG_DEVICE_ADD("i8087", I8087, XTAL(15'000'000)/3) - MCFG_DEVICE_PROGRAM_MAP(maincpu_mem) - MCFG_I8087_DATA_WIDTH(16) - //MCFG_I8087_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) // TODO: presumably this is connected to the pic - MCFG_I8087_BUSY_HANDLER(INPUTLINE("maincpu", INPUT_LINE_TEST)) + i8087_device &i8087(I8087(config, "i8087", XTAL(15'000'000)/3)); + i8087.set_addrmap(AS_PROGRAM, &fanucspmg_state::maincpu_mem); + i8087.set_data_width(16); + //i8087.irq().set_inputline("maincpu", INPUT_LINE_NMI); // TODO: presumably this is connected to the pic + i8087.busy().set_inputline("maincpu", INPUT_LINE_TEST); MCFG_DEVICE_ADD(SUBCPU_TAG, I8085A, XTAL(16'000'000)/2/2) MCFG_DEVICE_PROGRAM_MAP(subcpu_mem) diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp index 7af9e8f97be..db0f270340a 100644 --- a/src/mame/drivers/fidelz80.cpp +++ b/src/mame/drivers/fidelz80.cpp @@ -1786,12 +1786,14 @@ MACHINE_CONFIG_START(fidelz80_state::vbrc) MCFG_DEVICE_ADD("mcu", I8041, 5_MHz_XTAL) MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, fidelz80_state, vbrc_mcu_p1_w)) MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, fidelz80_state, vbrc_mcu_p2_r)) - MCFG_MCS48_PORT_P2_OUT_CB(WRITE8("i8243", i8243_device, p2_w)) - MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("i8243", i8243_device, prog_w)) + MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(m_i8243, i8243_device, p2_w)) + MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) MCFG_MCS48_PORT_T0_IN_CB(READLINE(*this, fidelz80_state, vbrc_mcu_t0_r)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, fidelz80_state, vbrc_mcu_t1_r)) - MCFG_I8243_ADD("i8243", CONSTANT(0), WRITE8(*this, fidelz80_state, vbrc_ioexp_port_w)) + I8243(config, m_i8243); + m_i8243->read_handler().set_constant(0); + m_i8243->write_handler().set(FUNC(fidelz80_state::vbrc_ioexp_port_w)); MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) config.set_default_layout(layout_fidel_vbrc); diff --git a/src/mame/drivers/gammagic.cpp b/src/mame/drivers/gammagic.cpp index 251e97e26e1..da8ff25b76d 100644 --- a/src/mame/drivers/gammagic.cpp +++ b/src/mame/drivers/gammagic.cpp @@ -138,7 +138,7 @@ MACHINE_CONFIG_START(gammagic_state::gammagic) pcat_common(config); -// MCFG_I82371SB_ADD("i82371sb") +// I82371SB(config, "i82371sb", 0); // MCFG_I82439TX_ADD("i82439tx", "maincpu", "user") MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) // MCFG_PCI_BUS_DEVICE(0, "i82439tx", i82439tx_pci_read, i82439tx_pci_write) diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp index f63b608a318..462886ab01a 100644 --- a/src/mame/drivers/ghosteo.cpp +++ b/src/mame/drivers/ghosteo.cpp @@ -634,7 +634,7 @@ MACHINE_CONFIG_START(ghosteo_state::ghosteo) // MCFG_NAND_TYPE(NAND_CHIP_K9F5608U0D) // or another variant with ID 0xEC 0x75 ? // MCFG_NAND_RNB_CALLBACK(WRITELINE("s3c2410", s3c2410_device, s3c24xx_pin_frnb_w)) -// MCFG_I2CMEM_ADD("i2cmem", 0xA0, 0, 0x100, nullptr) +// I2CMEM(config, "i2cmem", 0, 0xA0, 0, 0x100, nullptr); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -658,16 +658,14 @@ MACHINE_CONFIG_START(ghosteo_state::bballoon) ghosteo(config); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(bballoon_map) - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_DATA_SIZE(256) + I2CMEM(config, "i2cmem", 0).set_data_size(256); MACHINE_CONFIG_END MACHINE_CONFIG_START(ghosteo_state::touryuu) ghosteo(config); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(touryuu_map) - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_DATA_SIZE(1024) + I2CMEM(config, "i2cmem", 0).set_data_size(1024); MACHINE_CONFIG_END diff --git a/src/mame/drivers/gridcomp.cpp b/src/mame/drivers/gridcomp.cpp index d18a022bd1b..02a19f116fa 100644 --- a/src/mame/drivers/gridcomp.cpp +++ b/src/mame/drivers/gridcomp.cpp @@ -376,8 +376,8 @@ MACHINE_CONFIG_START(gridcomp_state::grid1101) MCFG_MACHINE_START_OVERRIDE(gridcomp_state, gridcomp) MCFG_MACHINE_RESET_OVERRIDE(gridcomp_state, gridcomp) - MCFG_DEVICE_ADD(I80130_TAG, I80130, XTAL(15'000'000)/3) - MCFG_I80130_IRQ_CALLBACK(INPUTLINE("maincpu", 0)) + I80130(config, m_osp, XTAL(15'000'000)/3); + m_osp->irq().set_inputline("maincpu", 0); SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) @@ -394,10 +394,10 @@ MACHINE_CONFIG_START(gridcomp_state::grid1101) MCFG_DEVICE_ADD("keyboard", GRID_KEYBOARD, 0) MCFG_GRID_KEYBOARD_CB(PUT(gridcomp_state, kbd_put)) - MCFG_DEVICE_ADD("i7220", I7220, XTAL(4'000'000)) - MCFG_I7220_DATA_SIZE(3) // 3 1-Mbit MBM's - MCFG_I7220_IRQ_CALLBACK(WRITELINE(I80130_TAG, i80130_device, ir1_w)) - MCFG_I7220_DRQ_CALLBACK(WRITELINE(I80130_TAG, i80130_device, ir1_w)) + i7220_device &i7220(I7220(config, "i7220", XTAL(4'000'000))); + i7220.set_data_size(3); // 3 1-Mbit MBM's + i7220.irq_callback().set(I80130_TAG, FUNC(i80130_device::ir1_w)); + i7220.drq_callback().set(I80130_TAG, FUNC(i80130_device::ir1_w)); MCFG_DEVICE_ADD("hpib", TMS9914, XTAL(4'000'000)) MCFG_TMS9914_INT_WRITE_CB(WRITELINE(I80130_TAG, i80130_device, ir5_w)) diff --git a/src/mame/drivers/konin.cpp b/src/mame/drivers/konin.cpp index 07671e183ce..51f517c0dda 100644 --- a/src/mame/drivers/konin.cpp +++ b/src/mame/drivers/konin.cpp @@ -140,13 +140,13 @@ MACHINE_CONFIG_START(konin_state::konin) MCFG_I8085A_INTE(WRITELINE("picu", i8214_device, inte_w)) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("intlatch", i8212_device, inta_cb) - MCFG_DEVICE_ADD("intlatch", I8212, 0) - MCFG_I8212_MD_CALLBACK(CONSTANT(0)) - MCFG_I8212_DI_CALLBACK(READ8("picu", i8214_device, vector_r)) - MCFG_I8212_INT_CALLBACK(INPUTLINE("maincpu", I8085_INTR_LINE)) + i8212_device &intlatch(I8212(config, "intlatch", 0)); + intlatch.md_rd_callback().set_constant(0); + intlatch.di_rd_callback().set(m_picu, FUNC(i8214_device::vector_r)); + intlatch.int_wr_callback().set_inputline("maincpu", I8085_INTR_LINE); - MCFG_DEVICE_ADD("picu", I8214, XTAL(4'000'000)) - MCFG_I8214_INT_CALLBACK(WRITELINE("intlatch", i8212_device, stb_w)) + I8214(config, m_picu, XTAL(4'000'000)); + m_picu->int_wr_callback().set("intlatch", FUNC(i8212_device::stb_w)); pit8253_device &mainpit(PIT8253(config, "mainpit", 0)); // wild guess at UART clock and source diff --git a/src/mame/drivers/ms6102.cpp b/src/mame/drivers/ms6102.cpp index c45d912776f..cac9d0c1a91 100644 --- a/src/mame/drivers/ms6102.cpp +++ b/src/mame/drivers/ms6102.cpp @@ -312,8 +312,8 @@ MACHINE_CONFIG_START(ms6102_state::ms6102) MCFG_I8085A_INTE(WRITELINE("i8214", i8214_device, inte_w)) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(ms6102_state, ms6102_int_ack) - MCFG_DEVICE_ADD("i8214", I8214, XTAL(18'432'000) / 9) - MCFG_I8214_INT_CALLBACK(WRITELINE(*this, ms6102_state, irq_w)) + I8214(config, m_pic, XTAL(18'432'000) / 9); + m_pic->int_wr_callback().set(FUNC(ms6102_state::irq_w)); MCFG_DEVICE_ADD("earom", KR1601RR1, 0) diff --git a/src/mame/drivers/odyssey2.cpp b/src/mame/drivers/odyssey2.cpp index fe6c53ce6b7..d5530db733b 100644 --- a/src/mame/drivers/odyssey2.cpp +++ b/src/mame/drivers/odyssey2.cpp @@ -753,12 +753,12 @@ MACHINE_CONFIG_START(g7400_state::g7400) MCFG_MCS48_PORT_BUS_OUT_CB(WRITE8(*this, g7400_state, bus_write)) MCFG_MCS48_PORT_T0_IN_CB(READLINE("cartslot", o2_cart_slot_device, t0_read)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, g7400_state, t1_read)) - MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("i8243", i8243_device, prog_w)) + MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) MCFG_QUANTUM_TIME(attotime::from_hz(60)) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS( 3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8245_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT ) + MCFG_SCREEN_RAW_PARAMS(3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8245_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT) MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2) MCFG_SCREEN_PALETTE("palette") @@ -766,12 +766,14 @@ MACHINE_CONFIG_START(g7400_state::g7400) MCFG_PALETTE_ADD("palette", 16) MCFG_PALETTE_INIT_OWNER(g7400_state, g7400) - MCFG_I8243_ADD( "i8243", CONSTANT(0), WRITE8(*this, g7400_state,i8243_port_w)) + I8243(config, m_i8243); + m_i8243->read_handler().set_constant(0); + m_i8243->write_handler().set(FUNC(g7400_state::i8243_port_w)); - MCFG_EF9340_1_ADD( "ef9340_1", 3540000, "screen" ) + MCFG_EF9340_1_ADD("ef9340_1", 3540000, "screen") SPEAKER(config, "mono").front_center(); - MCFG_I8245_ADD( "i8244", 3540000 * 2, "screen", INPUTLINE( "maincpu", 0 ), WRITE16( *this, g7400_state, scanline_postprocess ) ) + MCFG_I8245_ADD("i8244", 3540000 * 2, "screen", INPUTLINE("maincpu", 0), WRITE16(*this, g7400_state, scanline_postprocess)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) odyssey2_cartslot(config); @@ -794,12 +796,12 @@ MACHINE_CONFIG_START(g7400_state::odyssey3) MCFG_MCS48_PORT_BUS_OUT_CB(WRITE8(*this, g7400_state, bus_write)) MCFG_MCS48_PORT_T0_IN_CB(READLINE("cartslot", o2_cart_slot_device, t0_read)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, g7400_state, t1_read)) - MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("i8243", i8243_device, prog_w)) + MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) MCFG_QUANTUM_TIME(attotime::from_hz(60)) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS( 3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8244_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT ) + MCFG_SCREEN_RAW_PARAMS(3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8244_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT) MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2) MCFG_SCREEN_PALETTE("palette") @@ -807,12 +809,14 @@ MACHINE_CONFIG_START(g7400_state::odyssey3) MCFG_PALETTE_ADD("palette", 16) MCFG_PALETTE_INIT_OWNER(g7400_state, g7400) - MCFG_I8243_ADD( "i8243", CONSTANT(0), WRITE8(*this, g7400_state,i8243_port_w)) + I8243(config, m_i8243); + m_i8243->read_handler().set_constant(0); + m_i8243->write_handler().set(FUNC(g7400_state::i8243_port_w)); - MCFG_EF9340_1_ADD( "ef9340_1", 3540000, "screen" ) + MCFG_EF9340_1_ADD("ef9340_1", 3540000, "screen") SPEAKER(config, "mono").front_center(); - MCFG_I8244_ADD( "i8244", 3540000 * 2, "screen", INPUTLINE( "maincpu", 0 ), WRITE16( *this, g7400_state, scanline_postprocess ) ) + MCFG_I8244_ADD("i8244", 3540000 * 2, "screen", INPUTLINE("maincpu", 0), WRITE16(*this, g7400_state, scanline_postprocess)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) odyssey2_cartslot(config); diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp index b0790562582..21b4dd7a93d 100644 --- a/src/mame/drivers/othello.cpp +++ b/src/mame/drivers/othello.cpp @@ -418,7 +418,9 @@ MACHINE_CONFIG_START(othello_state::othello) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, othello_state, n7751_p2_w)) MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) - MCFG_I8243_ADD(m_i8243, CONSTANT(0), WRITE8(*this, othello_state, n7751_rom_control_w)) + I8243(config, m_i8243); + m_i8243->read_handler().set_constant(0); + m_i8243->write_handler().set(FUNC(othello_state::n7751_rom_control_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/pc8801.cpp b/src/mame/drivers/pc8801.cpp index fe3444e183c..3a6603dacdc 100644 --- a/src/mame/drivers/pc8801.cpp +++ b/src/mame/drivers/pc8801.cpp @@ -2375,7 +2375,7 @@ MACHINE_CONFIG_START(pc8801_state::pc8801) MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0)) #if USE_PROPER_I8214 - MCFG_I8214_ADD(I8214_TAG, MASTER_CLOCK, pic_intf) + I8214(config, I8214_TAG, MASTER_CLOCK); #endif MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL(32'768), NOOP, NOOP) //MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") diff --git a/src/mame/drivers/pcipc.cpp b/src/mame/drivers/pcipc.cpp index bfc4bec7796..29b5524545c 100644 --- a/src/mame/drivers/pcipc.cpp +++ b/src/mame/drivers/pcipc.cpp @@ -508,11 +508,14 @@ MACHINE_CONFIG_START(pcipc_state::pcipc) MCFG_DEVICE_ADD( ":pci", PCI_ROOT, 0) MCFG_DEVICE_ADD( ":pci:00.0", I82439HX, 0, "maincpu", 256*1024*1024) - MCFG_DEVICE_ADD( ":pci:07.0", I82371SB_ISA, 0) - MCFG_I82371SB_BOOT_STATE_HOOK(WRITE8(*this, pcipc_state, boot_state_phoenix_ver40_rev6_w)) - MCFG_I82371SB_SMI_CB(INPUTLINE(":maincpu", INPUT_LINE_SMI)) - MCFG_DEVICE_ADD( ":pci:07.1", I82371SB_IDE, 0) - MCFG_I82371SB_IDE_INTERRUPTS(":pci:07.0", i82371sb_isa_device, pc_irq14_w, pc_irq15_w) + + i82371sb_isa_device &isa(I82371SB_ISA(config, ":pci:07.0", 0)); + isa.boot_state_hook().set(FUNC(pcipc_state::boot_state_phoenix_ver40_rev6_w)); + isa.smi().set_inputline(":maincpu", INPUT_LINE_SMI); + + i82371sb_ide_device &ide(I82371SB_IDE(config, ":pci:07.1", 0)); + ide.irq_pri().set(":pci:07.0", FUNC(i82371sb_isa_device::pc_irq14_w)); + ide.irq_sec().set(":pci:07.0", FUNC(i82371sb_isa_device::pc_irq15_w)); // MCFG_DEVICE_ADD( ":pci:12.0", MGA2064W, 0) MCFG_DEVICE_ADD("board4", ISA16_SLOT, 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true) @@ -542,8 +545,9 @@ MACHINE_CONFIG_START(pcipc_state::pcipctx) MCFG_DEVICE_ADD( ":pci", PCI_ROOT, 0) MCFG_DEVICE_ADD( ":pci:00.0", I82439TX, 0, ":maincpu", 256*1024*1024) - MCFG_DEVICE_ADD( ":pci:07.0", I82371SB_ISA, 0) - MCFG_I82371SB_BOOT_STATE_HOOK(WRITE8(*this, pcipc_state, boot_state_award_w)) + + i82371sb_isa_device &isa(I82371SB_ISA(config, ":pci:07.0", 0)); + isa.boot_state_hook().set(FUNC(pcipc_state::boot_state_award_w)); // MCFG_DEVICE_ADD( ":pci:07.1", IDE_PCI, 0, 0x80867010, 0x03, 0x00000000) MCFG_DEVICE_ADD( ":pci:12.0", MGA2064W, 0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/pokemini.cpp b/src/mame/drivers/pokemini.cpp index f5f6d2ba509..876bf19c340 100644 --- a/src/mame/drivers/pokemini.cpp +++ b/src/mame/drivers/pokemini.cpp @@ -1767,8 +1767,7 @@ MACHINE_CONFIG_START(pokemini_state::pokemini) MCFG_QUANTUM_TIME(attotime::from_hz(60)) - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_DATA_SIZE(0x2000) + I2CMEM(config, "i2cmem", 0).set_data_size(0x2000); /* This still needs to be improved to actually match the hardware */ MCFG_SCREEN_ADD("screen", LCD) diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp index 7c23c8544a0..4e8f52d3d2f 100644 --- a/src/mame/drivers/segas16a.cpp +++ b/src/mame/drivers/segas16a.cpp @@ -1981,7 +1981,9 @@ MACHINE_CONFIG_START(segas16a_state::system16a) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, segas16a_state, n7751_p2_w)) MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("n7751_8243", i8243_device, prog_w)) - MCFG_I8243_ADD("n7751_8243", CONSTANT(0), WRITE8(*this, segas16a_state,n7751_rom_offset_w)) + I8243(config, m_n7751_i8243); + m_n7751_i8243->read_handler().set_constant(0); + m_n7751_i8243->write_handler().set(FUNC(segas16a_state::n7751_rom_offset_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/drivers/supstarf.cpp b/src/mame/drivers/supstarf.cpp index 194f8846d35..938e728e0e6 100644 --- a/src/mame/drivers/supstarf.cpp +++ b/src/mame/drivers/supstarf.cpp @@ -187,13 +187,13 @@ MACHINE_CONFIG_START(supstarf_state::supstarf) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, supstarf_state, port2_w)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, supstarf_state, phase_detect_r)) - MCFG_DEVICE_ADD("soundlatch1", I8212, 0) - MCFG_I8212_MD_CALLBACK(CONSTANT(0)) - MCFG_I8212_INT_CALLBACK(INPUTLINE("maincpu", I8085_RST55_LINE)) + I8212(config, m_soundlatch[0], 0); + m_soundlatch[0]->md_rd_callback().set_constant(0); + m_soundlatch[0]->int_wr_callback().set_inputline("maincpu", I8085_RST55_LINE); - MCFG_DEVICE_ADD("soundlatch2", I8212, 0) - MCFG_I8212_MD_CALLBACK(CONSTANT(0)) - MCFG_I8212_INT_CALLBACK(INPUTLINE("soundcpu", MCS48_INPUT_IRQ)) + I8212(config, m_soundlatch[1], 0); + m_soundlatch[1]->md_rd_callback().set_constant(0); + m_soundlatch[1]->int_wr_callback().set_inputline("soundcpu", MCS48_INPUT_IRQ); //MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("maincpu", I8085_READY_LINE)) SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp index e8cdb594cfb..0ff4e056b1e 100644 --- a/src/mame/drivers/twinkle.cpp +++ b/src/mame/drivers/twinkle.cpp @@ -1143,11 +1143,11 @@ MACHINE_CONFIG_START(twinkle_state::twinklex) MCFG_X76F041_ADD( "security" ) MACHINE_CONFIG_END -MACHINE_CONFIG_START(twinkle_state::twinklei) +void twinkle_state::twinklei(machine_config &config) +{ twinkle(config); - MCFG_I2CMEM_ADD( "security" ) - MCFG_I2CMEM_DATA_SIZE( 0x100 ) -MACHINE_CONFIG_END + I2CMEM(config, "security", 0).set_data_size(0x100); +} static INPUT_PORTS_START( twinkle ) diff --git a/src/mame/drivers/v1050.cpp b/src/mame/drivers/v1050.cpp index 1777f08866b..f80a152f79d 100644 --- a/src/mame/drivers/v1050.cpp +++ b/src/mame/drivers/v1050.cpp @@ -1044,8 +1044,8 @@ MACHINE_CONFIG_START(v1050_state::v1050) v1050_video(config); // devices - MCFG_DEVICE_ADD(UPB8214_TAG, I8214, 16_MHz_XTAL/4) - MCFG_I8214_INT_CALLBACK(WRITELINE(*this, v1050_state, pic_int_w)) + I8214(config, m_pic, 16_MHz_XTAL/4); + m_pic->int_wr_callback().set(FUNC(v1050_state::pic_int_w)); MCFG_DEVICE_ADD(MSM58321RS_TAG, MSM58321, 32.768_kHz_XTAL) MCFG_MSM58321_D0_HANDLER(WRITELINE(*this, v1050_state, rtc_ppi_pa_0_w)) diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp index a51582c960b..d4a8d2a3b1f 100644 --- a/src/mame/drivers/vii.cpp +++ b/src/mame/drivers/vii.cpp @@ -1452,11 +1452,11 @@ MACHINE_CONFIG_START(spg2xx_cart_state::vsmile) MCFG_SOFTWARE_LIST_ADD("cart_list","vsmile_cart") MACHINE_CONFIG_END -MACHINE_CONFIG_START(spg2xx_game_state::batman) +void spg2xx_game_state::batman(machine_config &config) +{ spg2xx_base(config); - MCFG_I2CMEM_ADD("i2cmem") - MCFG_I2CMEM_DATA_SIZE(0x200) -MACHINE_CONFIG_END + I2CMEM(config, "i2cmem", 0).set_data_size(0x200); +} void spg2xx_cart_state::init_vii() diff --git a/src/mame/machine/ms7004.cpp b/src/mame/machine/ms7004.cpp index bbfb59fbfd7..5eb66f2c64f 100644 --- a/src/mame/machine/ms7004.cpp +++ b/src/mame/machine/ms7004.cpp @@ -63,9 +63,11 @@ MACHINE_CONFIG_START(ms7004_device::device_add_mconfig) MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, ms7004_device, p1_w)) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, ms7004_device, p2_w)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, ms7004_device, t1_r)) - MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("i8243", i8243_device, prog_w)) + MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) - MCFG_I8243_ADD("i8243", CONSTANT(0), WRITE8(*this, ms7004_device, i8243_port_w)) + I8243(config, m_i8243); + m_i8243->read_handler().set_constant(0); + m_i8243->write_handler().set(FUNC(ms7004_device::i8243_port_w)); SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD(MS7004_SPK_TAG, BEEP, 3250) |