From 1db10c9857414d0d8528b86400de08ee67df21f8 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Wed, 15 Aug 2018 18:37:51 +0200 Subject: [PATCH] -amigafdc, at29x, at45dbxx, at_keybc, ataintf, atmel_arm_aic, pci-ide: MCFG removal, nw --- src/devices/bus/a1bus/a1cffa.cpp | 7 +- src/devices/bus/a2bus/a2cffa.cpp | 7 +- src/devices/bus/a2bus/a2vulcan.cpp | 7 +- src/devices/bus/a2bus/a2zipdrive.cpp | 7 +- src/devices/bus/adam/ide.cpp | 12 ++-- src/devices/bus/amiga/zorro/buddha.cpp | 14 ++-- src/devices/bus/c64/ide64.cpp | 11 +-- src/devices/bus/cpc/symbfac2.cpp | 11 +-- src/devices/bus/isa/ide.cpp | 15 ++-- src/devices/bus/isa/side116.cpp | 9 +-- src/devices/bus/isa/xtide.cpp | 11 +-- src/devices/bus/kc/d004.cpp | 47 ++++++------ src/devices/bus/kc/d004.h | 3 +- src/devices/bus/lpci/southbridge.cpp | 25 +++---- src/devices/bus/ql/qubide.cpp | 7 +- src/devices/bus/ti99/peb/hsgpl.cpp | 10 +-- src/devices/bus/ti99/peb/tn_ide.cpp | 27 +++---- src/devices/bus/ti99/peb/tn_ide.h | 2 +- src/devices/machine/amigafdc.h | 20 ------ src/devices/machine/at29x.h | 15 +--- src/devices/machine/at45dbxx.h | 19 +---- src/devices/machine/at_keybc.h | 34 ++------- src/devices/machine/ataintf.cpp | 2 +- src/devices/machine/ataintf.h | 74 ++++++++++++------- src/devices/machine/atmel_arm_aic.h | 9 +-- src/devices/machine/eeprompar.h | 2 +- src/devices/machine/i82371sb.cpp | 17 ++--- src/devices/machine/idectrl.cpp | 1 - src/devices/machine/idectrl.h | 98 +++++++++++++++++--------- src/devices/machine/pci-ide.cpp | 24 ++++--- src/devices/machine/pci-ide.h | 22 +++--- src/devices/machine/rtc65271.h | 1 + src/devices/machine/sis85c496.cpp | 13 ++-- src/devices/machine/vt83c461.h | 35 +++++---- src/mame/drivers/alg.cpp | 13 ++-- src/mame/drivers/amiga.cpp | 22 +++--- src/mame/drivers/arsystems.cpp | 12 ++-- src/mame/drivers/at.cpp | 21 +++--- src/mame/drivers/atlantis.cpp | 8 +-- src/mame/drivers/calchase.cpp | 8 +-- src/mame/drivers/chihiro.cpp | 2 +- src/mame/drivers/cmmb.cpp | 2 +- src/mame/drivers/cobra.cpp | 4 +- src/mame/drivers/csplayh5.cpp | 4 +- src/mame/drivers/ct486.cpp | 12 ++-- src/mame/drivers/cubo.cpp | 12 ++-- src/mame/drivers/cybiko.cpp | 4 +- src/mame/drivers/dccons.cpp | 4 +- src/mame/drivers/djmain.cpp | 4 +- src/mame/drivers/firebeat.cpp | 12 ++-- src/mame/drivers/fruitpc.cpp | 4 +- src/mame/drivers/funkball.cpp | 4 +- src/mame/drivers/gamecstl.cpp | 4 +- src/mame/drivers/geneve.cpp | 4 +- src/mame/drivers/jaguar.cpp | 4 +- src/mame/drivers/kinst.cpp | 4 +- src/mame/drivers/ksys573.cpp | 2 +- src/mame/drivers/mediagx.cpp | 4 +- src/mame/drivers/midqslvr.cpp | 4 +- src/mame/drivers/midvunit.cpp | 2 +- src/mame/drivers/mquake.cpp | 12 ++-- src/mame/drivers/pc9801.cpp | 8 +-- src/mame/drivers/pgm2.cpp | 3 +- src/mame/drivers/photoply.cpp | 8 +-- src/mame/drivers/pinball2k.cpp | 4 +- src/mame/drivers/qdrmfgp.cpp | 8 +-- src/mame/drivers/queen.cpp | 8 +-- src/mame/drivers/savquest.cpp | 8 +-- src/mame/drivers/swtpc09.cpp | 7 +- src/mame/drivers/taitotz.cpp | 4 +- src/mame/drivers/turrett.cpp | 2 +- src/mame/drivers/twinkle.cpp | 6 +- src/mame/drivers/upscope.cpp | 12 ++-- src/mame/drivers/vegas.cpp | 6 +- src/mame/drivers/viper.cpp | 2 +- src/mame/drivers/voyager.cpp | 4 +- src/mame/drivers/vp101.cpp | 6 +- src/mame/drivers/zn.cpp | 8 +-- src/mame/includes/midvunit.h | 2 +- src/mame/machine/at.cpp | 12 ++-- src/mame/machine/xbox_pci.cpp | 11 +-- 81 files changed, 470 insertions(+), 469 deletions(-) diff --git a/src/devices/bus/a1bus/a1cffa.cpp b/src/devices/bus/a1bus/a1cffa.cpp index ec81e60a6b2..105abba1eff 100644 --- a/src/devices/bus/a1bus/a1cffa.cpp +++ b/src/devices/bus/a1bus/a1cffa.cpp @@ -33,9 +33,10 @@ ROM_END // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(a1bus_cffa_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD(CFFA_ATA_TAG, ata_devices, "hdd", nullptr, false) -MACHINE_CONFIG_END +void a1bus_cffa_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); +} const tiny_rom_entry *a1bus_cffa_device::device_rom_region() const { diff --git a/src/devices/bus/a2bus/a2cffa.cpp b/src/devices/bus/a2bus/a2cffa.cpp index ceb88fe9e65..4eb5c7d2d98 100644 --- a/src/devices/bus/a2bus/a2cffa.cpp +++ b/src/devices/bus/a2bus/a2cffa.cpp @@ -51,12 +51,13 @@ ROM_END // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(a2bus_cffa2000_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD(CFFA2_ATA_TAG, ata_devices, "hdd", nullptr, false) +void a2bus_cffa2000_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); // not yet, the core explodes // MCFG_SOFTWARE_LIST_ADD("hdd_list", "apple2gs_hdd") -MACHINE_CONFIG_END +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/a2bus/a2vulcan.cpp b/src/devices/bus/a2bus/a2vulcan.cpp index 705764f1e87..1f1080c4ace 100644 --- a/src/devices/bus/a2bus/a2vulcan.cpp +++ b/src/devices/bus/a2bus/a2vulcan.cpp @@ -86,9 +86,10 @@ ROM_END // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(a2bus_vulcanbase_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD(VULCAN_ATA_TAG, ata_devices, "hdd", nullptr, false) -MACHINE_CONFIG_END +void a2bus_vulcanbase_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/a2bus/a2zipdrive.cpp b/src/devices/bus/a2bus/a2zipdrive.cpp index 15620d5f951..aaeb6ed6219 100644 --- a/src/devices/bus/a2bus/a2zipdrive.cpp +++ b/src/devices/bus/a2bus/a2zipdrive.cpp @@ -46,9 +46,10 @@ ROM_END // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(a2bus_zipdrivebase_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD(ZIPDRIVE_ATA_TAG, ata_devices, "hdd", nullptr, false) -MACHINE_CONFIG_END +void a2bus_zipdrivebase_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/adam/ide.cpp b/src/devices/bus/adam/ide.cpp index d5f403f3d10..fe97b7be512 100644 --- a/src/devices/bus/adam/ide.cpp +++ b/src/devices/bus/adam/ide.cpp @@ -62,12 +62,14 @@ const tiny_rom_entry *powermate_ide_device::device_rom_region() const // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(powermate_ide_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD(ATA_TAG, ata_devices, "hdd", nullptr, false) - MCFG_DEVICE_ADD(CENTRONICS_TAG, CENTRONICS, centronics_devices, "printer") +void powermate_ide_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); + centronics_device ¢ronics(CENTRONICS(config, CENTRONICS_TAG, centronics_devices, "printer")); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) -MACHINE_CONFIG_END + OUTPUT_LATCH(config, m_cent_data_out); + centronics.set_output_latch(*m_cent_data_out); +} diff --git a/src/devices/bus/amiga/zorro/buddha.cpp b/src/devices/bus/amiga/zorro/buddha.cpp index bbddd4aa203..b82f2d8818b 100644 --- a/src/devices/bus/amiga/zorro/buddha.cpp +++ b/src/devices/bus/amiga/zorro/buddha.cpp @@ -58,12 +58,14 @@ void buddha_device::mmio_map(address_map &map) // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(buddha_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD("ata_0", ata_devices, nullptr, nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, buddha_device, ide_0_interrupt_w)) - MCFG_ATA_INTERFACE_ADD("ata_1", ata_devices, nullptr, nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, buddha_device, ide_1_interrupt_w)) -MACHINE_CONFIG_END +void buddha_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata_0).options(ata_devices, nullptr, nullptr, false); + m_ata_0->irq_handler().set(FUNC(buddha_device::ide_0_interrupt_w)); + + ATA_INTERFACE(config, m_ata_1).options(ata_devices, nullptr, nullptr, false); + m_ata_1->irq_handler().set(FUNC(buddha_device::ide_1_interrupt_w)); +} //------------------------------------------------- // rom_region - device-specific ROM region diff --git a/src/devices/bus/c64/ide64.cpp b/src/devices/bus/c64/ide64.cpp index e85048cc318..f70ca03c10a 100644 --- a/src/devices/bus/c64/ide64.cpp +++ b/src/devices/bus/c64/ide64.cpp @@ -46,12 +46,13 @@ DEFINE_DEVICE_TYPE(C64_IDE64, c64_ide64_cartridge_device, "c64_ide64", "C64 IDE6 // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(c64_ide64_cartridge_device::device_add_mconfig) - MCFG_ATMEL_29C010_ADD(AT29C010A_TAG) - MCFG_DEVICE_ADD(DS1302_TAG, DS1302, 32.768_kHz_XTAL) +void c64_ide64_cartridge_device::device_add_mconfig(machine_config &config) +{ + ATMEL_29C010(config, m_flash_rom); + DS1302(config, m_rtc, 32.768_kHz_XTAL); - MCFG_ATA_INTERFACE_ADD(ATA_TAG, ata_devices, "hdd", nullptr, false) -MACHINE_CONFIG_END + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); +} //------------------------------------------------- diff --git a/src/devices/bus/cpc/symbfac2.cpp b/src/devices/bus/cpc/symbfac2.cpp index 3b9e6d7554b..f7577de8851 100644 --- a/src/devices/bus/cpc/symbfac2.cpp +++ b/src/devices/bus/cpc/symbfac2.cpp @@ -51,12 +51,13 @@ static INPUT_PORTS_START(cpc_symbiface2) INPUT_PORTS_END // device machine config -MACHINE_CONFIG_START(cpc_symbiface2_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD("ide", ata_devices, "hdd", nullptr, false) - MCFG_DS12885_ADD("rtc") - MCFG_NVRAM_ADD_1FILL("nvram") +void cpc_symbiface2_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false); + DS12885(config, m_rtc, XTAL(32'768)); + NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); // no pass-through -MACHINE_CONFIG_END +} ioport_constructor cpc_symbiface2_device::device_input_ports() const { diff --git a/src/devices/bus/isa/ide.cpp b/src/devices/bus/isa/ide.cpp index 47dfee2b479..1fe270399bb 100644 --- a/src/devices/bus/isa/ide.cpp +++ b/src/devices/bus/isa/ide.cpp @@ -70,18 +70,17 @@ DEFINE_DEVICE_TYPE(ISA16_IDE, isa16_ide_device, "isa_ide", "IDE Fixed Drive Adap // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(isa16_ide_device::device_add_mconfig) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, isa16_ide_device, ide_interrupt)) +void isa16_ide_device::device_add_mconfig(machine_config &config) +{ + IDE_CONTROLLER(config, m_ide).options(ata_devices, "hdd", nullptr, false); + m_ide->irq_handler().set(FUNC(isa16_ide_device::ide_interrupt)); SPEAKER(config, "lheadphone").front_left(); SPEAKER(config, "rheadphone").front_right(); - MCFG_DEVICE_MODIFY("ide:0") - MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_headphones) - MCFG_DEVICE_MODIFY("ide:1") - MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_headphones) -MACHINE_CONFIG_END + m_ide->slot(0).set_option_machine_config("cdrom", cdrom_headphones); + m_ide->slot(1).set_option_machine_config("cdrom", cdrom_headphones); +} //------------------------------------------------- // input_ports - device-specific input ports diff --git a/src/devices/bus/isa/side116.cpp b/src/devices/bus/isa/side116.cpp index 1e0fa3a9883..19c806ec8be 100644 --- a/src/devices/bus/isa/side116.cpp +++ b/src/devices/bus/isa/side116.cpp @@ -22,10 +22,11 @@ DEFINE_DEVICE_TYPE(ISA8_SIDE116, side116_device, "side116", "Acculogic sIDE-1/16 // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(side116_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, side116_device, ide_interrupt)) -MACHINE_CONFIG_END +void side116_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); + m_ata->irq_handler().set(FUNC(side116_device::ide_interrupt)); +} //------------------------------------------------- diff --git a/src/devices/bus/isa/xtide.cpp b/src/devices/bus/isa/xtide.cpp index d9be27f3d0d..756ebd188f9 100644 --- a/src/devices/bus/isa/xtide.cpp +++ b/src/devices/bus/isa/xtide.cpp @@ -262,12 +262,13 @@ DEFINE_DEVICE_TYPE(ISA8_XTIDE, xtide_device, "xtide", "XT-IDE Fixed Drive Adapte // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(xtide_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, xtide_device, ide_interrupt)) +void xtide_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); + m_ata->irq_handler().set(FUNC(xtide_device::ide_interrupt)); - MCFG_EEPROM_2864_ADD("eeprom") -MACHINE_CONFIG_END + EEPROM_PARALLEL_2864(config, m_eeprom); +} //------------------------------------------------- // input_ports - device-specific input ports diff --git a/src/devices/bus/kc/d004.cpp b/src/devices/bus/kc/d004.cpp index 833eea294dc..b2345db03dc 100644 --- a/src/devices/bus/kc/d004.cpp +++ b/src/devices/bus/kc/d004.cpp @@ -150,25 +150,28 @@ void kc_d004_device::device_reset() // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(kc_d004_device::device_add_mconfig) - MCFG_DEVICE_ADD(Z80_TAG, Z80, XTAL(8'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(kc_d004_mem) - MCFG_DEVICE_IO_MAP(kc_d004_io) - MCFG_Z80_DAISY_CHAIN(kc_d004_daisy_chain) +void kc_d004_device::device_add_mconfig(machine_config &config) +{ + Z80(config, m_cpu, XTAL(8'000'000)/2); + m_cpu->set_addrmap(AS_PROGRAM, &kc_d004_device::kc_d004_mem); + m_cpu->set_addrmap(AS_IO, &kc_d004_device::kc_d004_io); + m_cpu->set_daisy_config(kc_d004_daisy_chain); - MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, XTAL(8'000'000)/2) - MCFG_Z80CTC_INTR_CB(INPUTLINE(Z80_TAG, 0)) - MCFG_Z80CTC_ZC0_CB(WRITELINE(Z80CTC_TAG, z80ctc_device, trg1)) - MCFG_Z80CTC_ZC1_CB(WRITELINE(Z80CTC_TAG, z80ctc_device, trg2)) - MCFG_Z80CTC_ZC2_CB(WRITELINE(Z80CTC_TAG, z80ctc_device, trg3)) + z80ctc_device &ctc(Z80CTC(config, Z80CTC_TAG, XTAL(8'000'000)/2)); + ctc.intr_callback().set_inputline(Z80_TAG, 0); + ctc.zc_callback<0>().set(Z80CTC_TAG, FUNC(z80ctc_device::trg1)); + ctc.zc_callback<1>().set(Z80CTC_TAG, FUNC(z80ctc_device::trg2)); + ctc.zc_callback<2>().set(Z80CTC_TAG, FUNC(z80ctc_device::trg3)); - MCFG_UPD765A_ADD(UPD765_TAG, false, false) - MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(*this, kc_d004_device, fdc_irq)) - MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", kc_d004_floppies, "525qd", kc_d004_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", kc_d004_floppies, "525qd", kc_d004_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":2", kc_d004_floppies, "525qd", kc_d004_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":3", kc_d004_floppies, "525qd", kc_d004_device::floppy_formats) -MACHINE_CONFIG_END + UPD765A(config, m_fdc, 0); + m_fdc->set_ready_line_connected(false); + m_fdc->set_select_lines_connected(false); + m_fdc->intrq_wr_callback().set(FUNC(kc_d004_device::fdc_irq)); + FLOPPY_CONNECTOR(config, m_floppy0, kc_d004_floppies, "525qd", kc_d004_device::floppy_formats); + FLOPPY_CONNECTOR(config, m_floppy1, kc_d004_floppies, "525qd", kc_d004_device::floppy_formats); + FLOPPY_CONNECTOR(config, m_floppy2, kc_d004_floppies, "525qd", kc_d004_device::floppy_formats); + FLOPPY_CONNECTOR(config, m_floppy3, kc_d004_floppies, "525qd", kc_d004_device::floppy_formats); +} //------------------------------------------------- // device_rom_region @@ -374,14 +377,14 @@ kc_d004_gide_device::kc_d004_gide_device(const machine_config &mconfig, const ch // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(kc_d004_gide_device::device_add_mconfig) +void kc_d004_gide_device::device_add_mconfig(machine_config &config) +{ kc_d004_device::device_add_mconfig(config); - MCFG_DEVICE_MODIFY(Z80_TAG) - MCFG_DEVICE_IO_MAP(kc_d004_gide_io) + m_cpu->set_addrmap(AS_IO, &kc_d004_gide_device::kc_d004_gide_io); - MCFG_ATA_INTERFACE_ADD(ATA_TAG, ata_devices, "hdd", nullptr, false) -MACHINE_CONFIG_END + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); +} //------------------------------------------------- diff --git a/src/devices/bus/kc/d004.h b/src/devices/bus/kc/d004.h index e85d12c6aee..e82f44646d0 100644 --- a/src/devices/bus/kc/d004.h +++ b/src/devices/bus/kc/d004.h @@ -50,6 +50,8 @@ protected: DECLARE_WRITE8_MEMBER(fdd_select_w); DECLARE_WRITE8_MEMBER(hw_terminal_count_w); + required_device m_cpu; + private: DECLARE_FLOPPY_FORMATS( floppy_formats ); @@ -60,7 +62,6 @@ private: static const device_timer_id TIMER_RESET = 0; - required_device m_cpu; required_device m_fdc; required_device m_floppy0; required_device m_floppy1; diff --git a/src/devices/bus/lpci/southbridge.cpp b/src/devices/bus/lpci/southbridge.cpp index a600109f560..e1d64cb4966 100644 --- a/src/devices/bus/lpci/southbridge.cpp +++ b/src/devices/bus/lpci/southbridge.cpp @@ -76,13 +76,13 @@ MACHINE_CONFIG_START(southbridge_device::device_add_mconfig) m_pic8259_slave->out_int_callback().set(m_pic8259_master, FUNC(pic8259_device::ir2_w)); m_pic8259_slave->in_sp_callback().set_constant(0); - MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_slave", pic8259_device, ir6_w)) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) + BUS_MASTER_IDE_CONTROLLER(config, m_ide).options(ata_devices, "hdd", nullptr, false); + m_ide->irq_handler().set("pic8259_slave", FUNC(pic8259_device::ir6_w)); + m_ide->set_bus_master_space(":maincpu", AS_PROGRAM); - MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide2", ata_devices, "cdrom", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_slave", pic8259_device, ir7_w)) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) + BUS_MASTER_IDE_CONTROLLER(config, m_ide2).options(ata_devices, "cdrom", nullptr, false); + m_ide2->irq_handler().set("pic8259_slave", FUNC(pic8259_device::ir7_w)); + m_ide2->set_bus_master_space(":maincpu", AS_PROGRAM); // sound hardware SPEAKER(config, "mono").front_center(); @@ -509,12 +509,13 @@ static void pc_isa_onboard(device_slot_interface &device) MACHINE_CONFIG_START(southbridge_extended_device::device_add_mconfig) southbridge_device::device_add_mconfig(config); - MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL(12'000'000)) - MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(INPUTLINE(":maincpu", INPUT_LINE_RESET)) - MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(INPUTLINE(":maincpu", INPUT_LINE_A20)) - MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(WRITELINE("pic8259_master", pic8259_device, ir1_w)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(WRITELINE("pc_kbdc", pc_kbdc_device, clock_write_from_mb)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(WRITELINE("pc_kbdc", pc_kbdc_device, data_write_from_mb)) + at_keyboard_controller_device &keybc(AT_KEYBOARD_CONTROLLER(config, "keybc", XTAL(12'000'000))); + keybc.system_reset_cb().set_inputline(":maincpu", INPUT_LINE_RESET); + keybc.gate_a20_cb().set_inputline(":maincpu", INPUT_LINE_A20); + keybc.input_buffer_full_cb().set("pic8259_master", FUNC(pic8259_device::ir1_w)); + keybc.keyboard_clock_cb().set("pc_kbdc", FUNC(pc_kbdc_device::clock_write_from_mb)); + keybc.keyboard_data_cb().set("pc_kbdc", FUNC(pc_kbdc_device::data_write_from_mb)); + MCFG_DEVICE_ADD("pc_kbdc", PC_KBDC, 0) MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_clock_w)) MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_data_w)) diff --git a/src/devices/bus/ql/qubide.cpp b/src/devices/bus/ql/qubide.cpp index d1c0314670d..e88493048d9 100644 --- a/src/devices/bus/ql/qubide.cpp +++ b/src/devices/bus/ql/qubide.cpp @@ -92,9 +92,10 @@ const tiny_rom_entry *qubide_device::device_rom_region() const // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(qubide_device::device_add_mconfig) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) -MACHINE_CONFIG_END +void qubide_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); +} diff --git a/src/devices/bus/ti99/peb/hsgpl.cpp b/src/devices/bus/ti99/peb/hsgpl.cpp index 321303a1956..f339b9a6c48 100644 --- a/src/devices/bus/ti99/peb/hsgpl.cpp +++ b/src/devices/bus/ti99/peb/hsgpl.cpp @@ -702,13 +702,15 @@ INPUT_PORTS_START( ti99_hsgpl) INPUT_PORTS_END MACHINE_CONFIG_START(snug_high_speed_gpl_device::device_add_mconfig) - MCFG_AT29C040A_ADD( DSR_EEPROM ) - MCFG_AT29C040A_ADD( GROM_B_EEPROM ) - MCFG_AT29C040A_ADD( GROM_A_EEPROM ) - MCFG_AT29C040A_ADD( ROM6_EEPROM ) + AT29C040A(config, DSR_EEPROM); + AT29C040A(config, GROM_B_EEPROM); + AT29C040A(config, GROM_A_EEPROM); + AT29C040A(config, ROM6_EEPROM); + MCFG_RAM_ADD(RAM6_TAG) MCFG_RAM_DEFAULT_SIZE("128k") MCFG_RAM_DEFAULT_VALUE(0) + MCFG_RAM_ADD(GRAM_TAG) MCFG_RAM_DEFAULT_SIZE("128k") MCFG_RAM_DEFAULT_VALUE(0) diff --git a/src/devices/bus/ti99/peb/tn_ide.cpp b/src/devices/bus/ti99/peb/tn_ide.cpp index f512c722635..243450fd34f 100644 --- a/src/devices/bus/ti99/peb/tn_ide.cpp +++ b/src/devices/bus/ti99/peb/tn_ide.cpp @@ -54,8 +54,10 @@ enum nouspikel_ide_interface_device::nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_IDE, tag, owner, clock), device_ti99_peribox_card_interface(mconfig, *this), - m_cru_register(0), m_rtc(nullptr), - m_ata(*this, "ata"), m_clk_irq(false), m_sram_enable(false), + m_cru_register(0), + m_rtc(*this, "ide_rtc"), + m_ata(*this, "ata"), + m_clk_irq(false), m_sram_enable(false), m_sram_enable_dip(false), m_cur_page(0), m_tms9995_mode(false), m_input_latch(0), m_output_latch(0), m_ram(*this, RAMREGION) { @@ -307,7 +309,6 @@ WRITE_LINE_MEMBER(nouspikel_ide_interface_device::clock_interrupt_callback) void nouspikel_ide_interface_device::device_start() { - m_rtc = subdevice("ide_rtc"); m_sram_enable_dip = false; // TODO: what is this? save_item(NAME(m_ata_irq)); @@ -366,16 +367,18 @@ INPUT_PORTS_START( tn_ide ) PORT_DIPSETTING( 0x1f00, "1F00" ) INPUT_PORTS_END -MACHINE_CONFIG_START(nouspikel_ide_interface_device::device_add_mconfig) - MCFG_DEVICE_ADD( "ide_rtc", RTC65271, 0 ) - MCFG_RTC65271_INTERRUPT_CB(WRITELINE(*this, nouspikel_ide_interface_device, clock_interrupt_callback)) - MCFG_ATA_INTERFACE_ADD( "ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, nouspikel_ide_interface_device, ide_interrupt_callback)) +void nouspikel_ide_interface_device::device_add_mconfig(machine_config &config) +{ + RTC65271(config, m_rtc, 0); + m_rtc->interrupt_cb().set(FUNC(nouspikel_ide_interface_device::clock_interrupt_callback)); - MCFG_RAM_ADD(RAMREGION) - MCFG_RAM_DEFAULT_SIZE("512K") - MCFG_RAM_DEFAULT_VALUE(0) -MACHINE_CONFIG_END + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); + m_ata->irq_handler().set(FUNC(nouspikel_ide_interface_device::ide_interrupt_callback)); + + RAM(config, m_ram); + m_ram->set_default_size("512K"); + m_ram->set_default_value(0); +} ioport_constructor nouspikel_ide_interface_device::device_input_ports() const { diff --git a/src/devices/bus/ti99/peb/tn_ide.h b/src/devices/bus/ti99/peb/tn_ide.h index b039d29cf57..b4aa66f2fe3 100644 --- a/src/devices/bus/ti99/peb/tn_ide.h +++ b/src/devices/bus/ti99/peb/tn_ide.h @@ -47,7 +47,7 @@ private: DECLARE_WRITE_LINE_MEMBER(clock_interrupt_callback); DECLARE_WRITE_LINE_MEMBER(ide_interrupt_callback); - rtc65271_device* m_rtc; + required_device m_rtc; required_device m_ata; bool m_clk_irq; diff --git a/src/devices/machine/amigafdc.h b/src/devices/machine/amigafdc.h index 3fa813b1f96..cebb4dc221c 100644 --- a/src/devices/machine/amigafdc.h +++ b/src/devices/machine/amigafdc.h @@ -7,30 +7,10 @@ #include "imagedev/floppy.h" -#define MCFG_AMIGA_FDC_INDEX_CALLBACK(_write) \ - downcast(*device).set_index_wr_callback(DEVCB_##_write); - -#define MCFG_AMIGA_FDC_READ_DMA_CALLBACK(_read) \ - downcast(*device).set_dma_rd_callback(DEVCB_##_read); - -#define MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(_write) \ - downcast(*device).set_dma_wr_callback(DEVCB_##_write); - -#define MCFG_AMIGA_FDC_DSKBLK_CALLBACK(_write) \ - downcast(*device).set_dskblk_wr_callback(DEVCB_##_write); - -#define MCFG_AMIGA_FDC_DSKSYN_CALLBACK(_write) \ - downcast(*device).set_dsksyn_wr_callback(DEVCB_##_write); - class amiga_fdc_device : public device_t { public: amiga_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_index_wr_callback(Object &&cb) { return m_write_index.set_callback(std::forward(cb)); } - template devcb_base &set_dma_rd_callback(Object &&cb) { return m_read_dma.set_callback(std::forward(cb)); } - template devcb_base &set_dma_wr_callback(Object &&cb) { return m_write_dma.set_callback(std::forward(cb)); } - template devcb_base &set_dskblk_wr_callback(Object &&cb) { return m_write_dskblk.set_callback(std::forward(cb)); } - template devcb_base &set_dsksyn_wr_callback(Object &&cb) { return m_write_dsksyn.set_callback(std::forward(cb)); } auto index_callback() { return m_write_index.bind(); } auto read_dma_callback() { return m_read_dma.bind(); } auto write_dma_callback() { return m_write_dma.bind(); } diff --git a/src/devices/machine/at29x.h b/src/devices/machine/at29x.h index bb7711458bf..435bcaafabc 100644 --- a/src/devices/machine/at29x.h +++ b/src/devices/machine/at29x.h @@ -91,28 +91,19 @@ private: class at29c020_device : public at29x_device { public: - at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class at29c040_device : public at29x_device { public: - at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class at29c040a_device : public at29x_device { public: - at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; -#define MCFG_AT29C020_ADD(_tag ) \ - MCFG_DEVICE_ADD(_tag, AT29C020, 0) - -#define MCFG_AT29C040_ADD(_tag ) \ - MCFG_DEVICE_ADD(_tag, AT29C040, 0) - -#define MCFG_AT29C040A_ADD(_tag ) \ - MCFG_DEVICE_ADD(_tag, AT29C040A, 0) - #endif // MAME_MACHINE_AT29X_H diff --git a/src/devices/machine/at45dbxx.h b/src/devices/machine/at45dbxx.h index c0df28a49f4..ecea6472c46 100644 --- a/src/devices/machine/at45dbxx.h +++ b/src/devices/machine/at45dbxx.h @@ -18,23 +18,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_AT45DB041_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, AT45DB041, 0) - -#define MCFG_AT45DB081_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, AT45DB081, 0) - -#define MCFG_AT45DB161_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, AT45DB161, 0) - -#define MCFG_AT45DBXXX_SO_CALLBACK(_cb) \ - downcast(*device).set_so_cb(DEVCB_##_cb); - - // ======================> at45db041_device class at45db041_device : public device_t, @@ -50,7 +33,7 @@ public: uint8_t *get_ptr() { return &m_data[0]; } - template devcb_base &set_so_cb(Object &&cb) { return write_so.set_callback(std::forward(cb)); } + auto so_callback() { return write_so.bind(); } protected: at45db041_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/devices/machine/at_keybc.h b/src/devices/machine/at_keybc.h index a80887d2918..b47336dacf4 100644 --- a/src/devices/machine/at_keybc.h +++ b/src/devices/machine/at_keybc.h @@ -14,28 +14,6 @@ #include "cpu/mcs48/mcs48.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(_devcb) \ - downcast(*device).set_system_reset_callback(DEVCB_##_devcb); - -#define MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(_devcb) \ - downcast(*device).set_gate_a20_callback(DEVCB_##_devcb); - -#define MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(_devcb) \ - downcast(*device).set_input_buffer_full_callback(DEVCB_##_devcb); - -#define MCFG_AT_KEYBOARD_CONTROLLER_OUTPUT_BUFFER_EMPTY_CB(_devcb) \ - downcast(*device).set_output_buffer_empty_callback(DEVCB_##_devcb); - -#define MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(_devcb) \ - downcast(*device).set_keyboard_clock_callback(DEVCB_##_devcb); - -#define MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(_devcb) \ - downcast(*device).set_keyboard_data_callback(DEVCB_##_devcb); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -48,12 +26,12 @@ public: // construction/destruction at_keyboard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_system_reset_callback(Object &&cb) { return m_system_reset_cb.set_callback(std::forward(cb)); } - template devcb_base &set_gate_a20_callback(Object &&cb) { return m_gate_a20_cb.set_callback(std::forward(cb)); } - template devcb_base &set_input_buffer_full_callback(Object &&cb) { return m_input_buffer_full_cb.set_callback(std::forward(cb)); } - template devcb_base &set_output_buffer_empty_callback(Object &&cb) { return m_output_buffer_empty_cb.set_callback(std::forward(cb)); } - template devcb_base &set_keyboard_clock_callback(Object &&cb) { return m_keyboard_clock_cb.set_callback(std::forward(cb)); } - template devcb_base &set_keyboard_data_callback(Object &&cb) { return m_keyboard_data_cb.set_callback(std::forward(cb)); } + auto system_reset_cb() { return m_system_reset_cb.bind(); } + auto gate_a20_cb() { return m_gate_a20_cb.bind(); } + auto input_buffer_full_cb() { return m_input_buffer_full_cb.bind(); } + auto output_buffer_empty_cb() { return m_output_buffer_empty_cb.bind(); } + auto keyboard_clock_cb() { return m_keyboard_clock_cb.bind(); } + auto keyboard_data_cb() { return m_keyboard_data_cb.bind(); } // interface to the host pc DECLARE_READ8_MEMBER( data_r ); diff --git a/src/devices/machine/ataintf.cpp b/src/devices/machine/ataintf.cpp index 8f2db0ba0d3..5f658824c78 100644 --- a/src/devices/machine/ataintf.cpp +++ b/src/devices/machine/ataintf.cpp @@ -16,7 +16,6 @@ #include "debugger.h" - void abstract_ata_interface_device::set_default_ata_devices(const char* _master, const char* _slave) { for (size_t slot_index = 0; slot_index < SLOT_COUNT; slot_index++) @@ -244,6 +243,7 @@ ata_interface_device::ata_interface_device(const machine_config &mconfig, const { } + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/ataintf.h b/src/devices/machine/ataintf.h index acd65a21b3f..ca0eb3b5a6a 100644 --- a/src/devices/machine/ataintf.h +++ b/src/devices/machine/ataintf.h @@ -42,33 +42,8 @@ private: // device type definition DECLARE_DEVICE_TYPE(ATA_SLOT, ata_slot_device) -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -#define MCFG_ATA_INTERFACE_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - -#define MCFG_ATA_INTERFACE_DMARQ_HANDLER(_devcb) \ - downcast(*device).set_dmarq_handler(DEVCB_##_devcb); - -#define MCFG_ATA_INTERFACE_DASP_HANDLER(_devcb) \ - downcast(*device).set_dasp_handler(DEVCB_##_devcb); - void ata_devices(device_slot_interface &device); -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_ATA_INTERFACE_ADD(_tag, _slot_intf, _master, _slave, _fixed) \ - MCFG_DEVICE_ADD(_tag, ATA_INTERFACE, 0) \ - MCFG_DEVICE_MODIFY(_tag ":0") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \ - MCFG_DEVICE_MODIFY(_tag ":1") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \ - MCFG_DEVICE_MODIFY(_tag) - /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ @@ -86,6 +61,32 @@ public: auto dmarq_handler() { return m_dmarq_handler.bind(); } auto dasp_handler() { return m_dasp_handler.bind(); } + template abstract_ata_interface_device &set_slot_options(int index, T &&opts, const char *dflt, bool fixed) + { + ata_slot_device &dev = slot(index); + dev.option_reset(); + opts(dev); + dev.set_default_option(dflt); + dev.set_fixed(fixed); + return *this; + } + template abstract_ata_interface_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + set_slot(0, std::forward(opts), dflt, fixed); + return *this; + } + template abstract_ata_interface_device &slave(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + set_slot(1, std::forward(opts), dflt, fixed); + return *this; + } + template abstract_ata_interface_device &options(T &&opts, const char *master_default = nullptr, const char *slave_default = nullptr, bool fixed = false) + { + set_slot_options(0, std::forward(opts), master_default, fixed); + set_slot_options(1, std::forward(opts), slave_default, fixed); + return *this; + } + ata_slot_device &slot(int index); virtual void set_default_ata_devices(const char* _master, const char* _slave); @@ -142,7 +143,28 @@ private: class ata_interface_device : public abstract_ata_interface_device { public: - ata_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ata_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + template ata_interface_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::master(std::forward(opts), dflt, fixed); + return *this; + } + template ata_interface_device &slave(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::slave(std::forward(opts), dflt, fixed); + return *this; + } + template ata_interface_device &options(T &&opts, const char *master_default = nullptr, const char *slave_default = nullptr, bool fixed = false) + { + abstract_ata_interface_device::options(std::forward(opts), master_default, slave_default, fixed); + return *this; + } + template ata_interface_device &set_slot_options(int index, T &&opts, const char *dflt, bool fixed) + { + abstract_ata_interface_device::set_slot_options(index, std::forward(opts), dflt, fixed); + return *this; + } uint16_t read_cs0(offs_t offset, uint16_t mem_mask = 0xffff) { return internal_read_cs0(offset, mem_mask); } uint16_t read_cs1(offs_t offset, uint16_t mem_mask = 0xffff) { return internal_read_cs1(offset, mem_mask); } diff --git a/src/devices/machine/atmel_arm_aic.h b/src/devices/machine/atmel_arm_aic.h index b91c1b2598f..5c766e8319e 100644 --- a/src/devices/machine/atmel_arm_aic.h +++ b/src/devices/machine/atmel_arm_aic.h @@ -8,12 +8,6 @@ DECLARE_DEVICE_TYPE(ARM_AIC, arm_aic_device) -#define MCFG_ARM_AIC_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, ARM_AIC, 0) - -#define MCFG_IRQ_LINE_CB(_devcb) \ - downcast(*device).set_line_callback(DEVCB_##_devcb); - class arm_aic_device : public device_t { public: @@ -24,8 +18,7 @@ public: { } - // configuration - template devcb_base &set_line_callback(Object &&cb) { return m_irq_out.set_callback(std::forward(cb)); } + auto irq_callback() { return m_irq_out.bind(); } void regs_map(address_map &map); diff --git a/src/devices/machine/eeprompar.h b/src/devices/machine/eeprompar.h index 12f42e55b87..75651850d22 100644 --- a/src/devices/machine/eeprompar.h +++ b/src/devices/machine/eeprompar.h @@ -108,7 +108,7 @@ private: class eeprom_parallel_##_lowercase##_device : public eeprom_parallel_##_baseclass##_device \ { \ public: \ - eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); \ + eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); \ }; \ DECLARE_DEVICE_TYPE(EEPROM_PARALLEL_##_uppercase, eeprom_parallel_##_lowercase##_device) diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp index 6cd1b331255..aa75113c634 100644 --- a/src/devices/machine/i82371sb.cpp +++ b/src/devices/machine/i82371sb.cpp @@ -751,15 +751,16 @@ void i82371sb_ide_device::internal_io_map(address_map &map) map(0x03f6, 0x03f6).rw(FUNC(i82371sb_ide_device::ide1_read_cs1_r), FUNC(i82371sb_ide_device::ide1_write_cs1_w)); } -MACHINE_CONFIG_START(i82371sb_ide_device::device_add_mconfig) - MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide1", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, i82371sb_ide_device, primary_int)) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) +void i82371sb_ide_device::device_add_mconfig(machine_config &config) +{ + BUS_MASTER_IDE_CONTROLLER(config, m_ide1).options(ata_devices, "hdd", nullptr, false); + m_ide1->irq_handler().set(FUNC(i82371sb_ide_device::primary_int)); + m_ide1->set_bus_master_space(":maincpu", AS_PROGRAM); - MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide2", ata_devices, "cdrom", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, i82371sb_ide_device, secondary_int)) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) -MACHINE_CONFIG_END + BUS_MASTER_IDE_CONTROLLER(config, m_ide2).options(ata_devices, "cdrom", nullptr, false); + m_ide2->irq_handler().set(FUNC(i82371sb_ide_device::secondary_int)); + m_ide2->set_bus_master_space(":maincpu", AS_PROGRAM); +} i82371sb_ide_device::i82371sb_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, I82371SB_IDE, tag, owner, clock) diff --git a/src/devices/machine/idectrl.cpp b/src/devices/machine/idectrl.cpp index 17e92488511..b8ab541fc8d 100644 --- a/src/devices/machine/idectrl.cpp +++ b/src/devices/machine/idectrl.cpp @@ -214,7 +214,6 @@ void ide_controller_32_device::write_cs1(offs_t offset, uint32_t data, uint32_t } } - #define IDE_BUSMASTER_STATUS_ACTIVE 0x01 #define IDE_BUSMASTER_STATUS_ERROR 0x02 #define IDE_BUSMASTER_STATUS_IRQ 0x04 diff --git a/src/devices/machine/idectrl.h b/src/devices/machine/idectrl.h index de5579d3b49..3a0886a5185 100644 --- a/src/devices/machine/idectrl.h +++ b/src/devices/machine/idectrl.h @@ -15,23 +15,32 @@ #include "ataintf.h" -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_IDE_CONTROLLER_ADD(_tag, _slot_intf, _master, _slave, _fixed) \ - MCFG_DEVICE_ADD(_tag, IDE_CONTROLLER, 0) \ - MCFG_DEVICE_MODIFY(_tag ":0") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \ - MCFG_DEVICE_MODIFY(_tag ":1") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \ - MCFG_DEVICE_MODIFY(_tag) - class ide_controller_device : public abstract_ata_interface_device { public: ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + template ide_controller_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::master(std::forward(opts), dflt, fixed); + return *this; + } + template ide_controller_device &slave(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::slave(std::forward(opts), dflt, fixed); + return *this; + } + template ide_controller_device &options(T &&opts, const char *master_default = nullptr, const char *slave_default = nullptr, bool fixed = false) + { + abstract_ata_interface_device::options(std::forward(opts), master_default, slave_default, fixed); + return *this; + } + template ide_controller_device &set_slot_options(int index, T &&opts, const char *dflt, bool fixed) + { + abstract_ata_interface_device::set_slot_options(index, std::forward(opts), dflt, fixed); + return *this; + } + uint16_t read_cs0(offs_t offset, uint16_t mem_mask = 0xffff); uint16_t read_cs1(offs_t offset, uint16_t mem_mask = 0xffff); void write_cs0(offs_t offset, uint16_t data, uint16_t mem_mask = 0xffff); @@ -49,18 +58,31 @@ protected: DECLARE_DEVICE_TYPE(IDE_CONTROLLER, ide_controller_device) -#define MCFG_IDE_CONTROLLER_32_ADD(_tag, _slot_intf, _master, _slave, _fixed) \ - MCFG_DEVICE_ADD(_tag, IDE_CONTROLLER_32, 0) \ - MCFG_DEVICE_MODIFY(_tag ":0") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \ - MCFG_DEVICE_MODIFY(_tag ":1") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \ - MCFG_DEVICE_MODIFY(_tag) - class ide_controller_32_device : public abstract_ata_interface_device { public: - ide_controller_32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ide_controller_32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + template ide_controller_32_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::master(std::forward(opts), dflt, fixed); + return *this; + } + template ide_controller_32_device &slave(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::slave(std::forward(opts), dflt, fixed); + return *this; + } + template ide_controller_32_device &options(T &&opts, const char *master_default = nullptr, const char *slave_default = nullptr, bool fixed = false) + { + abstract_ata_interface_device::options(std::forward(opts), master_default, slave_default, fixed); + return *this; + } + template ide_controller_32_device &set_slot_options(int index, T &&opts, const char *dflt, bool fixed) + { + abstract_ata_interface_device::set_slot_options(index, std::forward(opts), dflt, fixed); + return *this; + } uint32_t read_cs0(offs_t offset, uint32_t mem_mask = 0xffffffff); uint32_t read_cs1(offs_t offset, uint32_t mem_mask = 0xffffffff); @@ -79,23 +101,33 @@ protected: DECLARE_DEVICE_TYPE(IDE_CONTROLLER_32, ide_controller_32_device) -#define MCFG_BUS_MASTER_IDE_CONTROLLER_ADD(_tag, _slot_intf, _master, _slave, _fixed) \ - MCFG_DEVICE_ADD(_tag, BUS_MASTER_IDE_CONTROLLER, 0) \ - MCFG_DEVICE_MODIFY(_tag ":0") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \ - MCFG_DEVICE_MODIFY(_tag ":1") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \ - MCFG_DEVICE_MODIFY(_tag) - -#define MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(bmcpu, bmspace) \ - downcast(*device).set_bus_master_space(bmcpu, bmspace); - class bus_master_ide_controller_device : public ide_controller_32_device { public: - bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); void set_bus_master_space(const char *bmcpu, uint32_t bmspace) { m_bmcpu = bmcpu; m_bmspace = bmspace; } + template bus_master_ide_controller_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::master(std::forward(opts), dflt, fixed); + return *this; + } + template bus_master_ide_controller_device &slave(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::slave(std::forward(opts), dflt, fixed); + return *this; + } + template bus_master_ide_controller_device &options(T &&opts, const char *master_default = nullptr, const char *slave_default = nullptr, bool fixed = false) + { + abstract_ata_interface_device::options(std::forward(opts), master_default, slave_default, fixed); + return *this; + } + template bus_master_ide_controller_device &set_slot_options(int index, T &&opts, const char *dflt, bool fixed) + { + abstract_ata_interface_device::set_slot_options(index, std::forward(opts), dflt, fixed); + return *this; + } + DECLARE_READ32_MEMBER( bmdma_r ); DECLARE_WRITE32_MEMBER( bmdma_w ); diff --git a/src/devices/machine/pci-ide.cpp b/src/devices/machine/pci-ide.cpp index 3b24f4f5964..39d359a2905 100644 --- a/src/devices/machine/pci-ide.cpp +++ b/src/devices/machine/pci-ide.cpp @@ -11,7 +11,9 @@ ide_pci_device::ide_pci_device(const machine_config &mconfig, const char *tag, d m_ide2(*this, "ide2"), m_irq_handler(*this), m_legacy_top(0x000), - m_pif(0x8a) + m_pif(0x8a), + m_bus_master_tag(":pci:00.0"), + m_bus_master_space(AS_DATA) { } @@ -52,16 +54,16 @@ void ide_pci_device::bus_master_map(address_map &map) map(0x8, 0xf).rw("ide2", FUNC(bus_master_ide_controller_device::bmdma_r), FUNC(bus_master_ide_controller_device::bmdma_w)); } -MACHINE_CONFIG_START(ide_pci_device::device_add_mconfig) - MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", "cdrom", true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, ide_pci_device, ide_interrupt)) - //MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":pci:00.0", AS_DATA) - MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide2", ata_devices, "hdd", "cdrom", true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, ide_pci_device, ide_interrupt)) - //MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":pci:00.0", AS_DATA) -MACHINE_CONFIG_END +void ide_pci_device::device_add_mconfig(machine_config &config) +{ + BUS_MASTER_IDE_CONTROLLER(config, m_ide).options(ata_devices, "hdd", "cdrom", true); + m_ide->irq_handler().set(FUNC(ide_pci_device::ide_interrupt)); + m_ide->set_bus_master_space(m_bus_master_tag, m_bus_master_space); + + BUS_MASTER_IDE_CONTROLLER(config, m_ide2).options(ata_devices, "hdd", "cdrom", true); + m_ide2->irq_handler().set(FUNC(ide_pci_device::ide_interrupt)); + m_ide2->set_bus_master_space(m_bus_master_tag, m_bus_master_space); +} void ide_pci_device::device_start() { diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h index 4a7519a531e..4d226069f09 100644 --- a/src/devices/machine/pci-ide.h +++ b/src/devices/machine/pci-ide.h @@ -19,29 +19,25 @@ TODO: #include "pci.h" #include "idectrl.h" -#define MCFG_IDE_PCI_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - -// This will set the top 12 bits for address decoding in legacy mode. Needed for seattle driver. -#define MCFG_IDE_PCI_SET_LEGACY_TOP(_val) \ - downcast(*device).set_legacy_top(_val); - -// Sets the default Programming Interface (PIF) register -#define MCFG_IDE_PCI_SET_PIF(_val) \ - downcast(*device).set_pif(_val); - class ide_pci_device : public pci_device { public: - ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t main_id, uint32_t revision, uint32_t subdevice_id) + ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t main_id, uint32_t revision, uint32_t subdevice_id + , const char *bmtag = ":pci:00.0", uint32_t bmspace = AS_DATA) : ide_pci_device(mconfig, tag, owner, clock) { set_ids(main_id, revision, 0x01018a, subdevice_id); + m_bus_master_tag = bmtag; + m_bus_master_space = bmspace; } ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } auto irq_handler() { return m_irq_handler.bind(); } + + // This will set the top 12 bits for address decoding in legacy mode. Needed for seattle driver. void set_legacy_top(int val) { m_legacy_top = val & 0xfff; }; + + // Sets the default Programming Interface (PIF) register void set_pif(int val) { m_pif = val & 0xff; }; protected: @@ -74,6 +70,8 @@ private: // Bits 31-20 for legacy mode hack uint32_t m_legacy_top; uint32_t m_pif; + const char* m_bus_master_tag; + uint32_t m_bus_master_space; uint32_t m_config_data[0x10]; void chan1_data_command_map(address_map &map); diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h index 3042c738659..b6d5c3b5803 100644 --- a/src/devices/machine/rtc65271.h +++ b/src/devices/machine/rtc65271.h @@ -28,6 +28,7 @@ public: rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template devcb_base &set_interrupt_callback(Object &&cb) { return m_interrupt_cb.set_callback(std::forward(cb)); } + auto interrupt_cb() { return m_interrupt_cb.bind(); } DECLARE_READ8_MEMBER( rtc_r ); DECLARE_READ8_MEMBER( xram_r ); diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp index eb4b1377ca2..372d99a756c 100644 --- a/src/devices/machine/sis85c496.cpp +++ b/src/devices/machine/sis85c496.cpp @@ -96,12 +96,13 @@ MACHINE_CONFIG_START(sis85c496_host_device::device_add_mconfig) m_pic8259_slave->out_int_callback().set(m_pic8259_master, FUNC(pic8259_device::ir2_w)); m_pic8259_slave->in_sp_callback().set_constant(0); - MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL(12'000'000)) - MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(WRITELINE(*this, sis85c496_host_device, cpu_reset_w)) - MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(WRITELINE(*this, sis85c496_host_device, cpu_a20_w)) - MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(WRITELINE("pic8259_master", pic8259_device, ir1_w)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(WRITELINE("pc_kbdc", pc_kbdc_device, clock_write_from_mb)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(WRITELINE("pc_kbdc", pc_kbdc_device, data_write_from_mb)) + AT_KEYBOARD_CONTROLLER(config, m_keybc, XTAL(12'000'000)); + m_keybc->system_reset_cb().set(FUNC(sis85c496_host_device::cpu_reset_w)); + m_keybc->gate_a20_cb().set(FUNC(sis85c496_host_device::cpu_a20_w)); + m_keybc->input_buffer_full_cb().set("pic8259_master", FUNC(pic8259_device::ir1_w)); + m_keybc->keyboard_clock_cb().set("pc_kbdc", FUNC(pc_kbdc_device::clock_write_from_mb)); + m_keybc->keyboard_data_cb().set("pc_kbdc", FUNC(pc_kbdc_device::data_write_from_mb)); + MCFG_DEVICE_ADD("pc_kbdc", PC_KBDC, 0) MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_clock_w)) MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_data_w)) diff --git a/src/devices/machine/vt83c461.h b/src/devices/machine/vt83c461.h index 863abdf54f3..3587ccea5a8 100644 --- a/src/devices/machine/vt83c461.h +++ b/src/devices/machine/vt83c461.h @@ -15,22 +15,31 @@ #include "idectrl.h" -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_VT83C461_ADD(_tag, _slot_intf, _master, _slave, _fixed) \ - MCFG_DEVICE_ADD(_tag, VT83C461, 0) \ - MCFG_DEVICE_MODIFY(_tag ":0") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \ - MCFG_DEVICE_MODIFY(_tag ":1") \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \ - MCFG_DEVICE_MODIFY(_tag) - class vt83c461_device : public ide_controller_32_device { public: - vt83c461_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + vt83c461_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + template vt83c461_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::master(std::forward(opts), dflt, fixed); + return *this; + } + template vt83c461_device &slave(T &&opts, const char *dflt = nullptr, bool fixed = false) + { + abstract_ata_interface_device::slave(std::forward(opts), dflt, fixed); + return *this; + } + template vt83c461_device &options(T &&opts, const char *master_default = nullptr, const char *slave_default = nullptr, bool fixed = false) + { + abstract_ata_interface_device::options(std::forward(opts), master_default, slave_default, fixed); + return *this; + } + template vt83c461_device &set_slot_options(int index, T &&opts, const char *dflt, bool fixed) + { + abstract_ata_interface_device::set_slot_options(std::forward(opts), dflt, fixed); + return *this; + } uint32_t read_config(offs_t offset); void write_config(offs_t offset, uint32_t data); diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp index fdd41d73f63..ae03f05360b 100644 --- a/src/mame/drivers/alg.cpp +++ b/src/mame/drivers/alg.cpp @@ -356,13 +356,12 @@ MACHINE_CONFIG_START(alg_state::alg_r1) MCFG_DEVICE_ADD("cia_1", MOS8520, amiga_state::CLK_E_NTSC) MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(*this, amiga_state, cia_1_irq)) - /* fdc */ - MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_NTSC) - MCFG_AMIGA_FDC_INDEX_CALLBACK(WRITELINE("cia_1", mos8520_device, flag_w)) - MCFG_AMIGA_FDC_READ_DMA_CALLBACK(READ16(*this, amiga_state, chip_ram_r)) - MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(WRITE16(*this, amiga_state, chip_ram_w)) - MCFG_AMIGA_FDC_DSKBLK_CALLBACK(WRITELINE(*this, amiga_state, fdc_dskblk_w)) - MCFG_AMIGA_FDC_DSKSYN_CALLBACK(WRITELINE(*this, amiga_state, fdc_dsksyn_w)) + AMIGA_FDC(config, m_fdc, amiga_state::CLK_7M_NTSC); + m_fdc->index_callback().set("cia_1", FUNC(mos8520_device::flag_w)); + m_fdc->read_dma_callback().set(FUNC(amiga_state::chip_ram_r)); + m_fdc->write_dma_callback().set(FUNC(amiga_state::chip_ram_w)); + m_fdc->dskblk_callback().set(FUNC(amiga_state::fdc_dskblk_w)); + m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index 61a441aeb6e..d2ee7a12079 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -1407,11 +1407,11 @@ MACHINE_CONFIG_START(amiga_state::amiga_base) paula.int_cb().set(FUNC(amiga_state::paula_int_w)); // floppy drives - MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_PAL) - MCFG_AMIGA_FDC_READ_DMA_CALLBACK(READ16(*this, amiga_state, chip_ram_r)) - MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(WRITE16(*this, amiga_state, chip_ram_w)) - MCFG_AMIGA_FDC_DSKBLK_CALLBACK(WRITELINE(*this, amiga_state, fdc_dskblk_w)) - MCFG_AMIGA_FDC_DSKSYN_CALLBACK(WRITELINE(*this, amiga_state, fdc_dsksyn_w)) + AMIGA_FDC(config, m_fdc, amiga_state::CLK_7M_PAL); + m_fdc->read_dma_callback().set(FUNC(amiga_state::chip_ram_r)); + m_fdc->write_dma_callback().set(FUNC(amiga_state::chip_ram_w)); + m_fdc->dskblk_callback().set(FUNC(amiga_state::fdc_dskblk_w)); + m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w)); MCFG_FLOPPY_DRIVE_ADD("fdc:0", amiga_floppies, "35dd", amiga_fdc_device::floppy_formats) MCFG_FLOPPY_DRIVE_SOUND(true) MCFG_FLOPPY_DRIVE_ADD("fdc:1", amiga_floppies, nullptr, amiga_fdc_device::floppy_formats) @@ -1742,8 +1742,8 @@ MACHINE_CONFIG_START(a600_state::a600) MCFG_GAYLE_CS1_READ_HANDLER(READ16("ata", ata_interface_device, cs1_r)) MCFG_GAYLE_CS1_WRITE_HANDLER(WRITE16("ata", ata_interface_device, cs1_w)) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("gayle", gayle_device, ide_interrupt_w)) + ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, false)); + ata.irq_handler().set("gayle", FUNC(gayle_device::ide_interrupt_w)); // todo: pcmcia @@ -1797,8 +1797,8 @@ MACHINE_CONFIG_START(a1200_state::a1200) MCFG_GAYLE_CS1_READ_HANDLER(READ16("ata", ata_interface_device, cs1_r)) MCFG_GAYLE_CS1_WRITE_HANDLER(WRITE16("ata", ata_interface_device, cs1_w)) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("gayle", gayle_device, ide_interrupt_w)) + ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, false)); + ata.irq_handler().set("gayle", FUNC(gayle_device::ide_interrupt_w)); // keyboard #if 0 @@ -1859,8 +1859,8 @@ MACHINE_CONFIG_START(a4000_state::a4000) MCFG_DEVICE_ADD("rtc", RP5C01, XTAL(32'768)) // ide - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, a4000_state, ide_interrupt_w)) + ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, false)); + ata.irq_handler().set(FUNC(a4000_state::ide_interrupt_w)); // todo: zorro3 diff --git a/src/mame/drivers/arsystems.cpp b/src/mame/drivers/arsystems.cpp index 181c560c3fb..29f85b86350 100644 --- a/src/mame/drivers/arsystems.cpp +++ b/src/mame/drivers/arsystems.cpp @@ -346,12 +346,12 @@ MACHINE_CONFIG_START(arcadia_amiga_state::arcadia) MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(*this, amiga_state, cia_1_irq)) /* fdc */ - MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_NTSC) - MCFG_AMIGA_FDC_INDEX_CALLBACK(WRITELINE("cia_1", mos8520_device, flag_w)) - MCFG_AMIGA_FDC_READ_DMA_CALLBACK(READ16(*this, amiga_state, chip_ram_r)) - MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(WRITE16(*this, amiga_state, chip_ram_w)) - MCFG_AMIGA_FDC_DSKBLK_CALLBACK(WRITELINE(*this, amiga_state, fdc_dskblk_w)) - MCFG_AMIGA_FDC_DSKSYN_CALLBACK(WRITELINE(*this, amiga_state, fdc_dsksyn_w)) + AMIGA_FDC(config, m_fdc, amiga_state::CLK_7M_NTSC); + m_fdc->index_callback().set("cia_1", FUNC(mos8520_device::flag_w)); + m_fdc->read_dma_callback().set(FUNC(amiga_state::chip_ram_r)); + m_fdc->write_dma_callback().set(FUNC(amiga_state::chip_ram_w)); + m_fdc->dskblk_callback().set(FUNC(amiga_state::fdc_dskblk_w)); + m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(arcadia_amiga_state::argh) diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp index 0960bf87bd4..f6e2d6de791 100644 --- a/src/mame/drivers/at.cpp +++ b/src/mame/drivers/at.cpp @@ -680,12 +680,13 @@ MACHINE_CONFIG_START(megapc_state::megapc) // ISA cards MCFG_DEVICE_ADD("isa1", ISA16_SLOT, 0, "isabus", pc_isa16_cards, nullptr, false) - MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, 12_MHz_XTAL) - MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(WRITELINE("wd7600", wd7600_device, kbrst_w)) - MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(WRITELINE("wd7600", wd7600_device, gatea20_w)) - MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(WRITELINE("wd7600", wd7600_device, irq01_w)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(WRITELINE("pc_kbdc", pc_kbdc_device, clock_write_from_mb)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(WRITELINE("pc_kbdc", pc_kbdc_device, data_write_from_mb)) + at_keyboard_controller_device &keybc(AT_KEYBOARD_CONTROLLER(config, "keybc", 12_MHz_XTAL)); + keybc.system_reset_cb().set("wd7600", FUNC(wd7600_device::kbrst_w)); + keybc.gate_a20_cb().set("wd7600", FUNC(wd7600_device::gatea20_w)); + keybc.input_buffer_full_cb().set("wd7600", FUNC(wd7600_device::irq01_w)); + keybc.keyboard_clock_cb().set("pc_kbdc", FUNC(pc_kbdc_device::clock_write_from_mb)); + keybc.keyboard_data_cb().set("pc_kbdc", FUNC(pc_kbdc_device::data_write_from_mb)); + MCFG_DEVICE_ADD("pc_kbdc", PC_KBDC, 0) MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_clock_w)) MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_data_w)) @@ -773,10 +774,10 @@ MACHINE_CONFIG_START(at_state::ficpio2) MCFG_DEVICE_ADD("board2", ISA16_SLOT, 0, "mb:isabus", pc_isa16_cards, "comat", true) MCFG_DEVICE_ADD("board3", ISA16_SLOT, 0, "mb:isabus", pc_isa16_cards, "lpt", true) - MCFG_IDE_CONTROLLER_32_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("mb:pic8259_slave", pic8259_device, ir6_w)) - MCFG_IDE_CONTROLLER_32_ADD("ide2", ata_devices, "cdrom", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("mb:pic8259_slave", pic8259_device, ir7_w)) + ide_controller_32_device &ide(IDE_CONTROLLER_32(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("mb:pic8259_slave", FUNC(pic8259_device::ir6_w)); + ide_controller_32_device &ide2(IDE_CONTROLLER_32(config, "ide2").options(ata_devices, "cdrom", nullptr, true)); + ide2.irq_handler().set("mb:pic8259_slave", FUNC(pic8259_device::ir7_w)); MCFG_PCI_BUS_ADD("pcibus", 0) MCFG_PCI_BUS_DEVICE("pcibus:0", pci_devices, "vt82c505", true) diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp index 160f26db830..9dda8a2eb5a 100644 --- a/src/mame/drivers/atlantis.cpp +++ b/src/mame/drivers/atlantis.cpp @@ -832,13 +832,7 @@ MACHINE_CONFIG_START(atlantis_state::mwskins) m_rtc->reset_cb().set(FUNC(atlantis_state::watchdog_reset)); m_rtc->irq_cb().set(FUNC(atlantis_state::watchdog_irq)); - MCFG_DEVICE_ADD(m_ide, IDE_PCI, 0, 0x10950646, 0x07, 0x0) - MCFG_IDE_PCI_IRQ_HANDLER(WRITELINE(*this, atlantis_state, ide_irq)) - // The pci-ide by default expects the system controller to be pci:00.0 so need to fix here - MCFG_DEVICE_MODIFY(PCI_ID_IDE":ide") - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(PCI_ID_NILE, AS_DATA) - MCFG_DEVICE_MODIFY(PCI_ID_IDE":ide2") - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(PCI_ID_NILE, AS_DATA) + IDE_PCI(config, m_ide, 0, 0x10950646, 0x07, 0x0, PCI_ID_NILE, AS_DATA).irq_handler().set(FUNC(atlantis_state::ide_irq)); /* video hardware */ MCFG_DEVICE_ADD(m_zeus, ZEUS2, ZEUS2_VIDEO_CLOCK) diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp index 7ebf8c49ff9..23ad807611d 100644 --- a/src/mame/drivers/calchase.cpp +++ b/src/mame/drivers/calchase.cpp @@ -685,8 +685,8 @@ MACHINE_CONFIG_START(calchase_state::calchase) pcat_common(config); - MCFG_IDE_CONTROLLER_32_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_32_device &ide(IDE_CONTROLLER_32(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, calchase_state, intel82439tx_pci_r, intel82439tx_pci_w) @@ -718,8 +718,8 @@ MACHINE_CONFIG_START(calchase_state::hostinv) pcat_common(config); - MCFG_IDE_CONTROLLER_32_ADD("ide", ata_devices, "cdrom", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_32_device &ide(IDE_CONTROLLER_32(config, "ide").options(ata_devices, "cdrom", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, calchase_state, intel82439tx_pci_r, intel82439tx_pci_w) diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp index de2b9eb50a7..82ffd715e36 100644 --- a/src/mame/drivers/chihiro.cpp +++ b/src/mame/drivers/chihiro.cpp @@ -1860,7 +1860,7 @@ MACHINE_CONFIG_START(chihiro_state::chihiro_base) MCFG_DEVICE_PROGRAM_MAP(chihiro_map) MCFG_DEVICE_IO_MAP(chihiro_map_io) - //MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide", ide_baseboard, nullptr, "bb", true) + //BUS_MASTER_IDE_CONTROLLER(config, "ide").options(ide_baseboard, nullptr, "bb", true); MCFG_DEVICE_MODIFY(":pci:09.0:ide:0") MCFG_DEVICE_SLOT_INTERFACE(ide_baseboard, nullptr, true) MCFG_DEVICE_MODIFY(":pci:09.0:ide:1") diff --git a/src/mame/drivers/cmmb.cpp b/src/mame/drivers/cmmb.cpp index 2491c380e25..9a8dc85aed7 100644 --- a/src/mame/drivers/cmmb.cpp +++ b/src/mame/drivers/cmmb.cpp @@ -415,7 +415,7 @@ MACHINE_CONFIG_START(cmmb_state::cmmb) MCFG_DEVICE_PROGRAM_MAP(cmmb_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cmmb_state, vblank_irq) - MCFG_AT29C020_ADD("at29c020") + AT29C020(config, "at29c020"); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 8e924473206..32f17399c14 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -3299,8 +3299,8 @@ MACHINE_CONFIG_START(cobra_state::cobra) MCFG_PCI_BUS_LEGACY_ADD(m_legacy_pci, 0) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, cobra_state, mpc106_pci_r, mpc106_pci_w) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, cobra_state, ide_interrupt)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); + m_ata->irq_handler().set(FUNC(cobra_state::ide_interrupt)); /* video hardware */ diff --git a/src/mame/drivers/csplayh5.cpp b/src/mame/drivers/csplayh5.cpp index 70aa07bf9e4..6fa587b4dc6 100644 --- a/src/mame/drivers/csplayh5.cpp +++ b/src/mame/drivers/csplayh5.cpp @@ -378,8 +378,8 @@ MACHINE_CONFIG_START(csplayh5_state::csplayh5) MCFG_DEVICE_PROGRAM_MAP(csplayh5_sub_map) MCFG_DEVICE_IO_MAP(csplayh5_sub_io_map) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) // dvd - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, csplayh5_state, ide_irq)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); // dvd + ide.irq_handler().set(FUNC(csplayh5_state::ide_irq)); #endif MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/ct486.cpp b/src/mame/drivers/ct486.cpp index ff160bd398a..dda503fb45e 100644 --- a/src/mame/drivers/ct486.cpp +++ b/src/mame/drivers/ct486.cpp @@ -134,12 +134,12 @@ MACHINE_CONFIG_START(ct486_state::ct486) MCFG_RAM_DEFAULT_SIZE("4M") MCFG_RAM_EXTRA_OPTIONS("1M,2M,8M,16M,32M,64M") - MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL(12'000'000)) - MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(WRITELINE("cs4031", cs4031_device, kbrst_w)) - MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(WRITELINE("cs4031", cs4031_device, gatea20_w)) - MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(WRITELINE("cs4031", cs4031_device, irq01_w)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(WRITELINE("pc_kbdc", pc_kbdc_device, clock_write_from_mb)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(WRITELINE("pc_kbdc", pc_kbdc_device, data_write_from_mb)) + at_keyboard_controller_device &keybc(AT_KEYBOARD_CONTROLLER(config, "keybc", XTAL(12'000'000))); + keybc.system_reset_cb().set("cs4031", FUNC(cs4031_device::kbrst_w)); + keybc.gate_a20_cb().set("cs4031", FUNC(cs4031_device::gatea20_w)); + keybc.input_buffer_full_cb().set("cs4031", FUNC(cs4031_device::irq01_w)); + keybc.keyboard_clock_cb().set("pc_kbdc", FUNC(pc_kbdc_device::clock_write_from_mb)); + keybc.keyboard_data_cb().set("pc_kbdc", FUNC(pc_kbdc_device::data_write_from_mb)); MCFG_DEVICE_ADD("pc_kbdc", PC_KBDC, 0) MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_clock_w)) MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_data_w)) diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp index daf21ada40b..10fb1c3c6e1 100644 --- a/src/mame/drivers/cubo.cpp +++ b/src/mame/drivers/cubo.cpp @@ -1094,12 +1094,12 @@ MACHINE_CONFIG_START(cubo_state::cubo) MCFG_CDROM_INTERFACE("cd32_cdrom") /* fdc */ - MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_PAL) - MCFG_AMIGA_FDC_INDEX_CALLBACK(WRITELINE("cia_1", mos8520_device, flag_w)) - MCFG_AMIGA_FDC_READ_DMA_CALLBACK(READ16(*this, amiga_state, chip_ram_r)) - MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(WRITE16(*this, amiga_state, chip_ram_w)) - MCFG_AMIGA_FDC_DSKBLK_CALLBACK(WRITELINE(*this, amiga_state, fdc_dskblk_w)) - MCFG_AMIGA_FDC_DSKSYN_CALLBACK(WRITELINE(*this, amiga_state, fdc_dsksyn_w)) + AMIGA_FDC(config, m_fdc, amiga_state::CLK_7M_PAL); + m_fdc->index_callback().set("cia_1", FUNC(mos8520_device::flag_w)); + m_fdc->read_dma_callback().set(FUNC(amiga_state::chip_ram_r)); + m_fdc->write_dma_callback().set(FUNC(amiga_state::chip_ram_w)); + m_fdc->dskblk_callback().set(FUNC(amiga_state::fdc_dskblk_w)); + m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/cybiko.cpp b/src/mame/drivers/cybiko.cpp index e95b97985b0..f43b81ccb20 100644 --- a/src/mame/drivers/cybiko.cpp +++ b/src/mame/drivers/cybiko.cpp @@ -415,8 +415,8 @@ MACHINE_CONFIG_START(cybiko_state::cybikov1) // machine /* rtc */ MCFG_PCF8593_ADD("rtc") - MCFG_AT45DB041_ADD("flash1") - MCFG_AT45DBXXX_SO_CALLBACK(WRITELINE("maincpu:sci1", h8_sci_device, rx_w)) + AT45DB041(config, m_flash1, 0); + m_flash1->so_callback().set("maincpu:sci1", FUNC(h8_sci_device::rx_w)); MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp index 2c2d9801727..0da87cd39f4 100644 --- a/src/mame/drivers/dccons.cpp +++ b/src/mame/drivers/dccons.cpp @@ -631,8 +631,8 @@ MACHINE_CONFIG_START(dc_cons_state::dc) AICARTC(config, "aicartc", XTAL(32'768)); - MCFG_DEVICE_ADD("ata", ATA_INTERFACE, 0) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, dc_cons_state, ata_interrupt)) + ATA_INTERFACE(config, m_ata, 0); + m_ata->irq_handler().set(FUNC(dc_cons_state::ata_interrupt)); MCFG_DEVICE_MODIFY("ata:0") MCFG_SLOT_OPTION_ADD("gdrom", GDROM) diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp index 14c28a8c0ab..11b99468f56 100644 --- a/src/mame/drivers/djmain.cpp +++ b/src/mame/drivers/djmain.cpp @@ -1388,8 +1388,8 @@ MACHINE_CONFIG_START(djmain_state::djmainj) MCFG_DEVICE_PROGRAM_MAP(maincpu_djmainj) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", djmain_state, vb_interrupt) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, djmain_state, ide_interrupt)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); + m_ata->irq_handler().set(FUNC(djmain_state::ide_interrupt)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp index 4fa62b074ef..40cdc1c55ff 100644 --- a/src/mame/drivers/firebeat.cpp +++ b/src/mame/drivers/firebeat.cpp @@ -1191,8 +1191,8 @@ MACHINE_CONFIG_START(firebeat_state::firebeat) MCFG_FUJITSU_29F016A_ADD("flash_snd1") MCFG_FUJITSU_29F016A_ADD("flash_snd2") - MCFG_ATA_INTERFACE_ADD("ata", firebeat_ata_devices, "cdrom", "cdrom", true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, firebeat_state, ata_interrupt)) + ATA_INTERFACE(config, m_ata).options(firebeat_ata_devices, "cdrom", "cdrom", true); + m_ata->irq_handler().set(FUNC(firebeat_state::ata_interrupt)); MCFG_DEVICE_MODIFY("ata:1") MCFG_SLOT_OPTION_MACHINE_CONFIG( "cdrom", cdrom_config ) @@ -1249,8 +1249,8 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2) MCFG_FUJITSU_29F016A_ADD("flash_snd1") MCFG_FUJITSU_29F016A_ADD("flash_snd2") - MCFG_ATA_INTERFACE_ADD("ata", firebeat_ata_devices, "cdrom", "cdrom", true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, firebeat_state, ata_interrupt)) + ATA_INTERFACE(config, m_ata).options(firebeat_ata_devices, "cdrom", "cdrom", true); + m_ata->irq_handler().set(FUNC(firebeat_state::ata_interrupt)); MCFG_DEVICE_MODIFY("ata:1") MCFG_SLOT_OPTION_MACHINE_CONFIG( "cdrom", cdrom_config ) @@ -1317,8 +1317,8 @@ MACHINE_CONFIG_START(firebeat_state::firebeat_spu) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - MCFG_ATA_INTERFACE_ADD("spu_ata", firebeat_ata_devices, "cdrom", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, firebeat_state, spu_ata_interrupt)) + ATA_INTERFACE(config, m_spuata).options(firebeat_ata_devices, "cdrom", nullptr, true); + m_spuata->irq_handler().set(FUNC(firebeat_state::spu_ata_interrupt)); MACHINE_CONFIG_END /*****************************************************************************/ diff --git a/src/mame/drivers/fruitpc.cpp b/src/mame/drivers/fruitpc.cpp index 603a050949a..5556be5820f 100644 --- a/src/mame/drivers/fruitpc.cpp +++ b/src/mame/drivers/fruitpc.cpp @@ -123,8 +123,8 @@ MACHINE_CONFIG_START(fruitpc_state::fruitpc) pcat_common(config); - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); /* video hardware */ pcvideo_vga(config); diff --git a/src/mame/drivers/funkball.cpp b/src/mame/drivers/funkball.cpp index 5a1da62df52..f5a27b97ee9 100644 --- a/src/mame/drivers/funkball.cpp +++ b/src/mame/drivers/funkball.cpp @@ -775,8 +775,8 @@ MACHINE_CONFIG_START(funkball_state::funkball) MCFG_PCI_BUS_LEGACY_DEVICE(7, DEVICE_SELF, funkball_state, voodoo_0_pci_r, voodoo_0_pci_w) MCFG_PCI_BUS_LEGACY_DEVICE(18, DEVICE_SELF, funkball_state, cx5510_pci_r, cx5510_pci_w) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); MCFG_DEVICE_ADD("flashbank", ADDRESS_MAP_BANK, 0) MCFG_DEVICE_PROGRAM_MAP(flashbank_map) diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp index 3f4b5d0473a..45a9ffbc1da 100644 --- a/src/mame/drivers/gamecstl.cpp +++ b/src/mame/drivers/gamecstl.cpp @@ -457,8 +457,8 @@ MACHINE_CONFIG_START(gamecstl_state::gamecstl) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, gamecstl_state, intel82439tx_pci_r, intel82439tx_pci_w) MCFG_PCI_BUS_LEGACY_DEVICE(7, DEVICE_SELF, gamecstl_state, intel82371ab_pci_r, intel82371ab_pci_w) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp index a12566ccddc..7bf524ca98b 100644 --- a/src/mame/drivers/geneve.cpp +++ b/src/mame/drivers/geneve.cpp @@ -773,8 +773,8 @@ MACHINE_CONFIG_START(geneve_state::geneve_common) m_colorbus->configure_slot(); // PFM expansion - MCFG_AT29C040_ADD( GENEVE_PFM512_TAG ) - MCFG_AT29C040A_ADD( GENEVE_PFM512A_TAG ) + AT29C040(config, GENEVE_PFM512_TAG); + AT29C040A(config, GENEVE_PFM512A_TAG); // DRAM 512K MCFG_RAM_ADD(GENEVE_DRAM_TAG) diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index 3d2cec851b1..99f643a799b 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -1857,8 +1857,8 @@ MACHINE_CONFIG_START(jaguar_state::cojagr3k) MCFG_WATCHDOG_ADD("watchdog") - MCFG_VT83C461_ADD("ide", cojag_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, jaguar_state, external_int)) + VT83C461(config, m_ide).options(cojag_devices, "hdd", nullptr, true); + m_ide->irq_handler().set(FUNC(jaguar_state::external_int)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp index 8a40c968940..2f0fb213fcf 100644 --- a/src/mame/drivers/kinst.cpp +++ b/src/mame/drivers/kinst.cpp @@ -727,8 +727,8 @@ MACHINE_CONFIG_START(kinst_state::kinst) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", kinst_state, irq0_start) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(INPUTLINE("maincpu", 1)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); + m_ata->irq_handler().set_inputline("maincpu", 1); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp index 853d249cdf7..f2d42f9538c 100644 --- a/src/mame/drivers/ksys573.cpp +++ b/src/mame/drivers/ksys573.cpp @@ -2102,7 +2102,7 @@ MACHINE_CONFIG_START(ksys573_state::konami573) MCFG_DEVICE_ADD( m_duart, MB89371, 0 ) MCFG_DEVICE_ADD( m_ata, ATA_INTERFACE, 0 ) - MCFG_ATA_INTERFACE_IRQ_HANDLER( WRITELINE( *this, ksys573_state, ata_interrupt ) ) + m_ata->irq_handler().set( FUNC( ksys573_state::ata_interrupt ) ); MCFG_DEVICE_MODIFY( "ata:0" ) MCFG_SLOT_OPTION_ADD( "cr589", CR589 ) diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp index 22167e58778..ea2bf537ca8 100644 --- a/src/mame/drivers/mediagx.cpp +++ b/src/mame/drivers/mediagx.cpp @@ -893,8 +893,8 @@ MACHINE_CONFIG_START(mediagx_state::mediagx) MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) MCFG_PCI_BUS_LEGACY_DEVICE(18, DEVICE_SELF, mediagx_state, cx5510_pci_r, cx5510_pci_w) - MCFG_IDE_CONTROLLER_32_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(m_pic8259_2, pic8259_device, ir6_w)) + ide_controller_32_device &ide(IDE_CONTROLLER_32(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set(m_pic8259_2, FUNC(pic8259_device::ir6_w)); MCFG_TIMER_DRIVER_ADD("sound_timer", mediagx_state, sound_timer_callback) diff --git a/src/mame/drivers/midqslvr.cpp b/src/mame/drivers/midqslvr.cpp index 0ab33bda09c..20024e51f4c 100644 --- a/src/mame/drivers/midqslvr.cpp +++ b/src/mame/drivers/midqslvr.cpp @@ -429,8 +429,8 @@ MACHINE_CONFIG_START(midqslvr_state::midqslvr) MCFG_PCI_BUS_LEGACY_DEVICE( 0, DEVICE_SELF, midqslvr_state, intel82439tx_pci_r, intel82439tx_pci_w) MCFG_PCI_BUS_LEGACY_DEVICE(31, DEVICE_SELF, midqslvr_state, intel82371ab_pci_r, intel82371ab_pci_w) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); /* video hardware */ pcvideo_vga(config); diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp index 4ac71bffc5c..2ce3734d360 100644 --- a/src/mame/drivers/midvunit.cpp +++ b/src/mame/drivers/midvunit.cpp @@ -1127,7 +1127,7 @@ MACHINE_CONFIG_START(midvunit_state::midvplus) MCFG_MACHINE_RESET_OVERRIDE(midvunit_state,midvplus) MCFG_DEVICE_REMOVE("nvram") - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) MCFG_MIDWAY_IOASIC_SHUFFLE(0) diff --git a/src/mame/drivers/mquake.cpp b/src/mame/drivers/mquake.cpp index 241a7865f3e..ceb4b934394 100644 --- a/src/mame/drivers/mquake.cpp +++ b/src/mame/drivers/mquake.cpp @@ -363,12 +363,12 @@ MACHINE_CONFIG_START(mquake_state::mquake) MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(*this, amiga_state, cia_1_irq)) /* fdc */ - MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_NTSC) - MCFG_AMIGA_FDC_INDEX_CALLBACK(WRITELINE("cia_1", mos8520_device, flag_w)) - MCFG_AMIGA_FDC_READ_DMA_CALLBACK(READ16(*this, amiga_state, chip_ram_r)) - MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(WRITE16(*this, amiga_state, chip_ram_w)) - MCFG_AMIGA_FDC_DSKBLK_CALLBACK(WRITELINE(*this, amiga_state, fdc_dskblk_w)) - MCFG_AMIGA_FDC_DSKSYN_CALLBACK(WRITELINE(*this, amiga_state, fdc_dsksyn_w)) + AMIGA_FDC(config, m_fdc, amiga_state::CLK_7M_NTSC); + m_fdc->index_callback().set("cia_1", FUNC(mos8520_device::flag_w)); + m_fdc->read_dma_callback().set(FUNC(amiga_state::chip_ram_r)); + m_fdc->write_dma_callback().set(FUNC(amiga_state::chip_ram_w)); + m_fdc->dskblk_callback().set(FUNC(amiga_state::fdc_dskblk_w)); + m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w)); MACHINE_CONFIG_END diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index e4604029231..14c86896569 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -2292,10 +2292,10 @@ void pc9801_state::cdrom_headphones(device_t *device) MACHINE_CONFIG_START(pc9801_state::pc9801_ide) SPEAKER(config, "lheadphone").front_left(); SPEAKER(config, "rheadphone").front_right(); - MCFG_ATA_INTERFACE_ADD("ide1", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("ideirq", input_merger_device, in_w<0>)) - MCFG_ATA_INTERFACE_ADD("ide2", pc9801_atapi_devices, "pc9801_cd", nullptr, false) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("ideirq", input_merger_device, in_w<1>)) + ATA_INTERFACE(config, m_ide[0]).options(ata_devices, "hdd", nullptr, false); + m_ide[0]->irq_handler().set("ideirq", FUNC(input_merger_device::in_w<0>)); + ATA_INTERFACE(config, m_ide[1]).options(pc9801_atapi_devices, "pc9801_cd", nullptr, false); + m_ide[1]->irq_handler().set("ideirq", FUNC(input_merger_device::in_w<1>)); MCFG_DEVICE_MODIFY("ide2:0") MCFG_SLOT_OPTION_MACHINE_CONFIG("pc9801_cd", cdrom_headphones) diff --git a/src/mame/drivers/pgm2.cpp b/src/mame/drivers/pgm2.cpp index 8f57ccbbfa6..b368cf2c839 100644 --- a/src/mame/drivers/pgm2.cpp +++ b/src/mame/drivers/pgm2.cpp @@ -780,8 +780,7 @@ MACHINE_CONFIG_START(pgm2_state::pgm2) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", pgm2_state, igs_interrupt) MCFG_TIMER_DRIVER_ADD("mcu_timer", pgm2_state, igs_interrupt2) - MCFG_ARM_AIC_ADD("arm_aic") - MCFG_IRQ_LINE_CB(WRITELINE(*this, pgm2_state, irq)) + ARM_AIC(config, "arm_aic", 0).irq_callback().set(FUNC(pgm2_state::irq)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/photoply.cpp b/src/mame/drivers/photoply.cpp index 9b6d1968a3a..eab794054d8 100644 --- a/src/mame/drivers/photoply.cpp +++ b/src/mame/drivers/photoply.cpp @@ -311,11 +311,11 @@ MACHINE_CONFIG_START(photoply_state::photoply) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "vga", gfx_photoply) - MCFG_IDE_CONTROLLER_32_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_32_device &ide(IDE_CONTROLLER_32(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); - MCFG_IDE_CONTROLLER_32_ADD("ide2", ata_devices, nullptr, nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir7_w)) + ide_controller_32_device &ide2(IDE_CONTROLLER_32(config, "ide2").options(ata_devices, nullptr, nullptr, true)); + ide2.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir7_w)); MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) MCFG_PCI_BUS_LEGACY_DEVICE(5, DEVICE_SELF, photoply_state, sis_pcm_r, sis_pcm_w) diff --git a/src/mame/drivers/pinball2k.cpp b/src/mame/drivers/pinball2k.cpp index 97e3dde8212..a4b8db29fd8 100644 --- a/src/mame/drivers/pinball2k.cpp +++ b/src/mame/drivers/pinball2k.cpp @@ -615,8 +615,8 @@ MACHINE_CONFIG_START(pinball2k_state::mediagx) MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) MCFG_PCI_BUS_LEGACY_DEVICE(18, DEVICE_SELF, pinball2k_state, cx5510_pci_r, cx5510_pci_w) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette") diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp index 058902cb7ec..4bade35c9a4 100644 --- a/src/mame/drivers/qdrmfgp.cpp +++ b/src/mame/drivers/qdrmfgp.cpp @@ -533,8 +533,8 @@ MACHINE_CONFIG_START(qdrmfgp_state::qdrmfgp) MCFG_MACHINE_START_OVERRIDE(qdrmfgp_state,qdrmfgp) MCFG_NVRAM_ADD_1FILL("nvram") - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, qdrmfgp_state, ide_interrupt)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); + m_ata->irq_handler().set(FUNC(qdrmfgp_state::ide_interrupt)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -579,8 +579,8 @@ MACHINE_CONFIG_START(qdrmfgp_state::qdrmfgp2) MCFG_MACHINE_START_OVERRIDE(qdrmfgp_state,qdrmfgp2) MCFG_NVRAM_ADD_1FILL("nvram") - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, qdrmfgp_state, gp2_ide_interrupt)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); + m_ata->irq_handler().set(FUNC(qdrmfgp_state::gp2_ide_interrupt)); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/queen.cpp b/src/mame/drivers/queen.cpp index 55606f37207..ff1e9cf2af0 100644 --- a/src/mame/drivers/queen.cpp +++ b/src/mame/drivers/queen.cpp @@ -294,11 +294,11 @@ MACHINE_CONFIG_START(queen_state::queen) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, queen_state, intel82439tx_pci_r, intel82439tx_pci_w) MCFG_PCI_BUS_LEGACY_DEVICE(7, DEVICE_SELF, queen_state, intel82371ab_pci_r, intel82371ab_pci_w) - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); - MCFG_IDE_CONTROLLER_32_ADD("ide2", ata_devices, nullptr, nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir7_w)) + ide_controller_32_device &ide2(IDE_CONTROLLER_32(config, "ide2").options(ata_devices, nullptr, nullptr, true)); + ide2.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir7_w)); /* video hardware */ pcvideo_vga(config); diff --git a/src/mame/drivers/savquest.cpp b/src/mame/drivers/savquest.cpp index baac98042b9..6a6f110c601 100644 --- a/src/mame/drivers/savquest.cpp +++ b/src/mame/drivers/savquest.cpp @@ -827,11 +827,11 @@ MACHINE_CONFIG_START(savquest_state::savquest) MCFG_PCI_BUS_LEGACY_DEVICE(7, DEVICE_SELF, savquest_state, intel82371ab_pci_r, intel82371ab_pci_w) MCFG_PCI_BUS_LEGACY_DEVICE(13, DEVICE_SELF, savquest_state, pci_3dfx_r, pci_3dfx_w) - MCFG_IDE_CONTROLLER_32_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); - MCFG_IDE_CONTROLLER_32_ADD("ide2", ata_devices, nullptr, nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir7_w)) + ide_controller_device &ide2(IDE_CONTROLLER(config, "ide2").options(ata_devices, nullptr, nullptr, true)); + ide2.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir7_w)); /* sound hardware */ diff --git a/src/mame/drivers/swtpc09.cpp b/src/mame/drivers/swtpc09.cpp index 1f9c77774ee..82404f1f10c 100644 --- a/src/mame/drivers/swtpc09.cpp +++ b/src/mame/drivers/swtpc09.cpp @@ -223,12 +223,7 @@ void swtpc09_state::swtpc09i(machine_config &config) PIA6821(config, "piaide", 0); -/* old start to adding ide support, needs major updating */ -/* this is to support an add on card driving IDE from a PIA */ -// MCFG_HARDDISK_ADD("harddisk") -// MCFG_IDE_CONTROLLER_ADD("ide", nullptr) -// MCFG_IDE_CONTROLLER_REGIONS("harddisk", nullptr) -// MCFG_IDE_CONTROLLER_ADD( "ide", ide_intf, "hdd", nullptr, false ) /* FIXME */ bebox + /* TODO: add ide support, via add-on card driving IDE from a PIA */ } diff --git a/src/mame/drivers/taitotz.cpp b/src/mame/drivers/taitotz.cpp index bc33331eaa2..5771e51318f 100644 --- a/src/mame/drivers/taitotz.cpp +++ b/src/mame/drivers/taitotz.cpp @@ -2598,8 +2598,8 @@ MACHINE_CONFIG_START(taitotz_state::taitotz) MCFG_QUANTUM_TIME(attotime::from_hz(120)) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, taitotz_state, ide_interrupt)) + ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, true)); + ata.irq_handler().set(FUNC(taitotz_state::ide_interrupt)); MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/turrett.cpp b/src/mame/drivers/turrett.cpp index 38d3e8d548d..68302a3c43b 100644 --- a/src/mame/drivers/turrett.cpp +++ b/src/mame/drivers/turrett.cpp @@ -364,7 +364,7 @@ MACHINE_CONFIG_START(turrett_state::turrett) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", turrett_state, vblank) MCFG_DEVICE_PERIODIC_INT_DRIVER(turrett_state, adc, 60) - MCFG_ATA_INTERFACE_ADD("ata", turrett_devices, "hdd", nullptr, true) + ATA_INTERFACE(config, m_ata).options(turrett_devices, "hdd", nullptr, true); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp index 22cae34fbc0..6f2b73c5d1b 100644 --- a/src/mame/drivers/twinkle.cpp +++ b/src/mame/drivers/twinkle.cpp @@ -1099,9 +1099,9 @@ MACHINE_CONFIG_START(twinkle_state::twinkle) m_am53cf96->set_scsi_port("scsi"); m_am53cf96->irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10)); - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, twinkle_state, spu_ata_irq)) - MCFG_ATA_INTERFACE_DMARQ_HANDLER(WRITELINE(*this, twinkle_state, spu_ata_dmarq)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); + m_ata->irq_handler().set(FUNC(twinkle_state::spu_ata_irq)); + m_ata->dmarq_handler().set(FUNC(twinkle_state::spu_ata_dmarq)); MCFG_DEVICE_ADD("rtc", RTC65271, 0) diff --git a/src/mame/drivers/upscope.cpp b/src/mame/drivers/upscope.cpp index 9cae714bb41..ef32eb61460 100644 --- a/src/mame/drivers/upscope.cpp +++ b/src/mame/drivers/upscope.cpp @@ -312,12 +312,12 @@ MACHINE_CONFIG_START(upscope_state::upscope) MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(*this, upscope_state, upscope_cia_1_porta_w)) /* fdc */ - MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_NTSC) - MCFG_AMIGA_FDC_INDEX_CALLBACK(WRITELINE("cia_1", mos8520_device, flag_w)) - MCFG_AMIGA_FDC_READ_DMA_CALLBACK(READ16(*this, amiga_state, chip_ram_r)) - MCFG_AMIGA_FDC_WRITE_DMA_CALLBACK(WRITE16(*this, amiga_state, chip_ram_w)) - MCFG_AMIGA_FDC_DSKBLK_CALLBACK(WRITELINE(*this, amiga_state, fdc_dskblk_w)) - MCFG_AMIGA_FDC_DSKSYN_CALLBACK(WRITELINE(*this, amiga_state, fdc_dsksyn_w)) + AMIGA_FDC(config, m_fdc, amiga_state::CLK_7M_NTSC); + m_fdc->index_callback().set("cia_1", FUNC(mos8520_device::flag_w)); + m_fdc->read_dma_callback().set(FUNC(amiga_state::chip_ram_r)); + m_fdc->write_dma_callback().set(FUNC(amiga_state::chip_ram_w)); + m_fdc->dskblk_callback().set(FUNC(amiga_state::fdc_dskblk_w)); + m_fdc->dsksyn_callback().set(FUNC(amiga_state::fdc_dsksyn_w)); // i/o extension MCFG_DEVICE_ADD("ppi", I8255, 0) diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp index 06d8c39e83c..cc348f3766f 100644 --- a/src/mame/drivers/vegas.cpp +++ b/src/mame/drivers/vegas.cpp @@ -1757,9 +1757,9 @@ MACHINE_CONFIG_START(vegas_state::vegascore) MCFG_VRC5074_SET_CS(6, vegas_state::vegas_cs6_map) MCFG_VRC5074_SET_CS(7, vegas_state::vegas_cs7_map) - MCFG_DEVICE_ADD(PCI_ID_IDE, IDE_PCI, 0, 0x10950646, 0x05, 0x0) - MCFG_IDE_PCI_IRQ_HANDLER(WRITELINE(PCI_ID_NILE, vrc5074_device, pci_intr_d)) - //MCFG_IDE_PCI_SET_PIF(0x8f) + ide_pci_device &ide(IDE_PCI(config, PCI_ID_IDE, 0, 0x10950646, 0x05, 0x0)); + ide.irq_handler().set(PCI_ID_NILE, FUNC(vrc5074_device::pci_intr_d)); + //ide.set_pif(0x8f); MCFG_DEVICE_ADD(PCI_ID_VIDEO, VOODOO_2_PCI, 0, m_maincpu, "screen") MCFG_VOODOO_PCI_FBMEM(2) diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 914b1f9546c..4e7abd4c6ce 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -2397,7 +2397,7 @@ MACHINE_CONFIG_START(viper_state::viper) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, viper_state, mpc8240_pci_r, mpc8240_pci_w) MCFG_PCI_BUS_LEGACY_DEVICE(12, DEVICE_SELF, viper_state, voodoo3_pci_r, voodoo3_pci_w) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); MCFG_DEVICE_ADD("voodoo", VOODOO_3, STD_VOODOO_3_CLOCK) MCFG_VOODOO_FBMEM(8) diff --git a/src/mame/drivers/voyager.cpp b/src/mame/drivers/voyager.cpp index e15ca551947..7b3ceb1a561 100644 --- a/src/mame/drivers/voyager.cpp +++ b/src/mame/drivers/voyager.cpp @@ -510,8 +510,8 @@ MACHINE_CONFIG_START(voyager_state::voyager) pcat_common(config); - MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w)) + ide_controller_device &ide(IDE_CONTROLLER(config, "ide").options(ata_devices, "hdd", nullptr, true)); + ide.irq_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w)); MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0) MCFG_PCI_BUS_LEGACY_DEVICE(0, DEVICE_SELF, voyager_state, intel82439tx_pci_r, intel82439tx_pci_w) diff --git a/src/mame/drivers/vp101.cpp b/src/mame/drivers/vp101.cpp index c52ff86695c..799f3b4e656 100644 --- a/src/mame/drivers/vp101.cpp +++ b/src/mame/drivers/vp101.cpp @@ -381,8 +381,8 @@ MACHINE_CONFIG_START(vp10x_state::vp101) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) - MCFG_ATA_INTERFACE_DMARQ_HANDLER(WRITELINE(*this, vp10x_state, dmarq_w)) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); + m_ata->dmarq_handler().set(FUNC(vp10x_state::dmarq_w)); MCFG_NVRAM_ADD_0FILL("nvram") MACHINE_CONFIG_END @@ -400,7 +400,7 @@ MACHINE_CONFIG_START(vp10x_state::vp50) MCFG_SCREEN_SIZE(400, 240) MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false) + ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false); MCFG_NVRAM_ADD_0FILL("nvram") MACHINE_CONFIG_END diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp index 11f265565cd..72674da8fc4 100644 --- a/src/mame/drivers/zn.cpp +++ b/src/mame/drivers/zn.cpp @@ -1467,8 +1467,8 @@ MACHINE_CONFIG_START(zn_state::coh1000w) MCFG_RAM_MODIFY("maincpu:ram") MCFG_RAM_DEFAULT_SIZE("8M") - MCFG_VT83C461_ADD("ide", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("maincpu:irq", psxirq_device, intin10)) + VT83C461(config, m_vt83c461).options(ata_devices, "hdd", nullptr, true); + m_vt83c461->irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10)); MCFG_PSX_DMA_CHANNEL_READ( "maincpu", 5, psxdma_device::read_delegate(&zn_state::atpsx_dma_read, this ) ) MCFG_PSX_DMA_CHANNEL_WRITE( "maincpu", 5, psxdma_device::write_delegate(&zn_state::atpsx_dma_write, this ) ) MACHINE_CONFIG_END @@ -2218,8 +2218,8 @@ MACHINE_CONFIG_START(zn_state::jdredd) MCFG_DEVICE_MODIFY("gpu") MCFG_PSXGPU_VBLANK_CALLBACK(vblank_state_delegate(&zn_state::jdredd_vblank, this)) - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE("maincpu:irq", psxirq_device, intin10)) + ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, true)); + ata.irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10)); MACHINE_CONFIG_END /* diff --git a/src/mame/includes/midvunit.h b/src/mame/includes/midvunit.h index 90cfd4b55a4..a0268a49177 100644 --- a/src/mame/includes/midvunit.h +++ b/src/mame/includes/midvunit.h @@ -180,7 +180,7 @@ private: optional_device m_midway_serial_pic; optional_device m_midway_serial_pic2; optional_device m_midway_ioasic; - optional_device m_ata; // TODO(RH): This is horrible and midvplus should be split into its own device_driver that derives from midvunit. + optional_device m_ata; required_device_array m_timer; required_device m_dcs; required_shared_ptr m_generic_paletteram_32; diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp index 0d929353ffa..644e380ac33 100644 --- a/src/mame/machine/at.cpp +++ b/src/mame/machine/at.cpp @@ -134,12 +134,12 @@ MACHINE_CONFIG_START(at_mb_device::device_add_mconfig) MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, 12_MHz_XTAL) - MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(INPUTLINE(":maincpu", INPUT_LINE_RESET)) - MCFG_AT_KEYBOARD_CONTROLLER_GATE_A20_CB(INPUTLINE(":maincpu", INPUT_LINE_A20)) - MCFG_AT_KEYBOARD_CONTROLLER_INPUT_BUFFER_FULL_CB(WRITELINE("pic8259_master", pic8259_device, ir1_w)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_CLOCK_CB(WRITELINE("pc_kbdc", pc_kbdc_device, clock_write_from_mb)) - MCFG_AT_KEYBOARD_CONTROLLER_KEYBOARD_DATA_CB(WRITELINE("pc_kbdc", pc_kbdc_device, data_write_from_mb)) + at_keyboard_controller_device &keybc(AT_KEYBOARD_CONTROLLER(config, "keybc", 12_MHz_XTAL)); + keybc.system_reset_cb().set_inputline(":maincpu", INPUT_LINE_RESET); + keybc.gate_a20_cb().set_inputline(":maincpu", INPUT_LINE_A20); + keybc.input_buffer_full_cb().set("pic8259_master", FUNC(pic8259_device::ir1_w)); + keybc.keyboard_clock_cb().set("pc_kbdc", FUNC(pc_kbdc_device::clock_write_from_mb)); + keybc.keyboard_data_cb().set("pc_kbdc", FUNC(pc_kbdc_device::data_write_from_mb)); MCFG_DEVICE_ADD("pc_kbdc", PC_KBDC, 0) MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_clock_w)) MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_data_w)) diff --git a/src/mame/machine/xbox_pci.cpp b/src/mame/machine/xbox_pci.cpp index d71bdbfb634..0045fc9f990 100644 --- a/src/mame/machine/xbox_pci.cpp +++ b/src/mame/machine/xbox_pci.cpp @@ -709,11 +709,12 @@ void mcpx_ide_device::device_reset() pci_device::device_reset(); } -MACHINE_CONFIG_START(mcpx_ide_device::device_add_mconfig) - MCFG_DEVICE_ADD("ide", BUS_MASTER_IDE_CONTROLLER, 0) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, mcpx_ide_device, ide_interrupt)) - MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE("maincpu", AS_PROGRAM) -MACHINE_CONFIG_END +void mcpx_ide_device::device_add_mconfig(machine_config &config) +{ + bus_master_ide_controller_device &ide(BUS_MASTER_IDE_CONTROLLER(config, "ide", 0)); + ide.irq_handler().set(FUNC(mcpx_ide_device::ide_interrupt)); + ide.set_bus_master_space("maincpu", AS_PROGRAM); +} WRITE_LINE_MEMBER(mcpx_ide_device::ide_interrupt) {