diff options
author | 2018-09-08 00:29:21 +0200 | |
---|---|---|
committer | 2018-09-08 07:03:38 +0200 | |
commit | 7f48a8fd0a4ed40cef3ecb6a94451dc41ed32d42 (patch) | |
tree | 19696b441c4d866d9f9feb865170e8dda30d5169 | |
parent | 01557d4a191a8c0824bbe7fa45ae95a554b5b5cf (diff) |
-mc146818: De-MCFG, nw
27 files changed, 78 insertions, 110 deletions
diff --git a/src/devices/bus/econet/e01.cpp b/src/devices/bus/econet/e01.cpp index b7e8bab4002..cb1f385aa86 100644 --- a/src/devices/bus/econet/e01.cpp +++ b/src/devices/bus/econet/e01.cpp @@ -245,7 +245,7 @@ void econet_e01_device::device_add_mconfig(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &econet_e01_device::e01_mem); MC146818(config, m_rtc, 32.768_kHz_XTAL); - m_rtc->irq_callback().set(FUNC(econet_e01_device::rtc_irq_w)); + m_rtc->irq().set(FUNC(econet_e01_device::rtc_irq_w)); // devices via6522_device &via(VIA6522(config, R6522_TAG, 8_MHz_XTAL / 4)); diff --git a/src/devices/bus/electron/cart/click.cpp b/src/devices/bus/electron/cart/click.cpp index 0c4dfa8b43c..a4a0bfd5af2 100644 --- a/src/devices/bus/electron/cart/click.cpp +++ b/src/devices/bus/electron/cart/click.cpp @@ -23,11 +23,12 @@ DEFINE_DEVICE_TYPE(ELECTRON_CLICK, electron_click_device, "electron_click", "Slo // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(electron_click_device::device_add_mconfig) +void electron_click_device::device_add_mconfig(machine_config &config) +{ /* rtc */ - MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, electron_click_device, irq_w)) -MACHINE_CONFIG_END + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(FUNC(electron_click_device::irq_w)); +} //------------------------------------------------- // INPUT_PORTS( click ) diff --git a/src/devices/bus/lpci/southbridge.cpp b/src/devices/bus/lpci/southbridge.cpp index d566cc22515..9e281e83437 100644 --- a/src/devices/bus/lpci/southbridge.cpp +++ b/src/devices/bus/lpci/southbridge.cpp @@ -521,9 +521,9 @@ MACHINE_CONFIG_START(southbridge_extended_device::device_add_mconfig) MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, keyboard_data_w)) MCFG_PC_KBDC_SLOT_ADD("pc_kbdc", "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL) - MCFG_DS12885_ADD("rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("pic8259_slave", pic8259_device, ir0_w)) - MCFG_MC146818_CENTURY_INDEX(0x32) + ds12885_device &rtc(DS12885(config, "rtc")); + rtc.irq().set("pic8259_slave", FUNC(pic8259_device::ir0_w)); + rtc.set_century_index(0x32); // on board devices MCFG_DEVICE_ADD("board1", ISA16_SLOT, 0, "isabus", pc_isa_onboard, "fdcsmc", true) // FIXME: determine ISA bus clock diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp index 1467fb43987..ea314b7aa5c 100644 --- a/src/devices/machine/cs4031.cpp +++ b/src/devices/machine/cs4031.cpp @@ -149,7 +149,7 @@ void cs4031_device::device_add_mconfig(machine_config &config) m_ctc->out_handler<2>().set(FUNC(cs4031_device::ctc_out2_w)); DS12885(config, m_rtc); - m_rtc->irq_callback().set(m_intc2, FUNC(pic8259_device::ir0_w)); + m_rtc->irq().set(m_intc2, FUNC(pic8259_device::ir0_w)); m_rtc->set_century_index(0x32); } diff --git a/src/devices/machine/fdc37c93x.cpp b/src/devices/machine/fdc37c93x.cpp index c61716f2c4e..ce18f033dea 100644 --- a/src/devices/machine/fdc37c93x.cpp +++ b/src/devices/machine/fdc37c93x.cpp @@ -265,9 +265,10 @@ MACHINE_CONFIG_START(fdc37c93x_device::device_add_mconfig) pc_serial2_comdev->out_rts_callback().set(FUNC(fdc37c93x_device::rts_serial2_w)); // RTC - MCFG_DS12885_ADD("rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, fdc37c93x_device, irq_rtc_w)) - MCFG_MC146818_CENTURY_INDEX(0x32) + ds12885_device &rtc(DS12885(config, "rtc")); + rtc.irq().set(FUNC(fdc37c93x_device::irq_rtc_w)); + rtc.set_century_index(0x32); + // keyboard KBDC8042(config, m_kbdc); m_kbdc->set_keyboard_type(kbdc8042_device::KBDC8042_PS2); diff --git a/src/devices/machine/mc146818.h b/src/devices/machine/mc146818.h index 91cdcf35a1b..499698a84cd 100644 --- a/src/devices/machine/mc146818.h +++ b/src/devices/machine/mc146818.h @@ -17,39 +17,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_MC146818_IRQ_HANDLER(_irq) \ - downcast<mc146818_device &>(*device).set_irq_callback(DEVCB_##_irq); - -// The MC146818 doesn't have century support, but when syncing the date & time at startup we can optionally store the century. -#define MCFG_MC146818_CENTURY_INDEX(_century_index) \ - downcast<mc146818_device *>(device)->set_century_index(_century_index); - -// The MC146818 doesn't have UTC support, but when syncing the data & time at startup we can use UTC instead of local time. -#define MCFG_MC146818_UTC(_utc) \ - downcast<mc146818_device *>(device)->set_use_utc(_utc); - -#define MCFG_MC146818_BINARY(_bin) \ - downcast<mc146818_device *>(device)->set_binary(_bin); - -#define MCFG_MC146818_24_12(_hour) \ - downcast<mc146818_device *>(device)->set_hour(_hour); - -#define MCFG_MC146818_EPOCH(_epoch) \ - downcast<mc146818_device *>(device)->set_epoch(_epoch); - -#define MCFG_MC146818_BINARY_YEAR(_bin) \ - downcast<mc146818_device *>(device)->set_binary_year(_bin); - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> mc146818_device - class mc146818_device : public device_t, public device_nvram_interface { @@ -58,13 +25,16 @@ public: mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks - template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); } - auto irq_callback() { return m_write_irq.bind(); } + auto irq() { return m_write_irq.bind(); } + // The MC146818 doesn't have century support, but when syncing the date & time at startup we can optionally store the century. void set_century_index(int century_index) { m_century_index = century_index; } + + // The MC146818 doesn't have UTC support, but when syncing the data & time at startup we can use UTC instead of local time. void set_use_utc(bool use_utc) { m_use_utc = use_utc; } + void set_binary(bool binary) { m_binary = binary; } - void set_hour(bool hour) { m_hour = hour; } + void set_24hrs(bool hour) { m_hour = hour; } void set_epoch(int epoch) { m_epoch = epoch; } void set_binary_year(int bin) { m_binyear = bin; } diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp index 372d99a756c..f4e9f426fc1 100644 --- a/src/devices/machine/sis85c496.cpp +++ b/src/devices/machine/sis85c496.cpp @@ -109,7 +109,7 @@ MACHINE_CONFIG_START(sis85c496_host_device::device_add_mconfig) MCFG_PC_KBDC_SLOT_ADD("pc_kbdc", "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL) DS12885(config, m_ds12885); - m_ds12885->irq_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir0_w)); + m_ds12885->irq().set(m_pic8259_slave, FUNC(pic8259_device::ir0_w)); m_ds12885->set_century_index(0x32); /* sound hardware */ diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp index 419042631e0..2da075c83c4 100644 --- a/src/devices/machine/wd7600.cpp +++ b/src/devices/machine/wd7600.cpp @@ -74,7 +74,7 @@ void wd7600_device::device_add_mconfig(machine_config & config) m_ctc->out_handler<2>().set(FUNC(wd7600_device::ctc_out2_w)); DS12885(config, m_rtc); - m_rtc->irq_callback().set(m_pic2, FUNC(pic8259_device::ir0_w)); + m_rtc->irq().set(m_pic2, FUNC(pic8259_device::ir0_w)); m_rtc->set_century_index(0x32); } diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp index 96e983e007e..95dfd473828 100644 --- a/src/mame/drivers/apollo.cpp +++ b/src/mame/drivers/apollo.cpp @@ -1115,8 +1115,7 @@ MACHINE_CONFIG_START(apollo_state::dn3000) m_ram->set_default_size("8M").set_extra_options("4M"); // FIXME: is this interrupt really only connected on DN3000? - MCFG_DEVICE_MODIFY(APOLLO_RTC_TAG) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, apollo_state, apollo_rtc_irq_function)) + m_rtc->irq().set(FUNC(apollo_state::apollo_rtc_irq_function)); MACHINE_CONFIG_END MACHINE_CONFIG_START(apollo_state::dsp3000) diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp index 886d3a1921c..ac41756fe6e 100644 --- a/src/mame/drivers/at.cpp +++ b/src/mame/drivers/at.cpp @@ -524,10 +524,11 @@ MACHINE_CONFIG_START(at_state::neat) atvga(config); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_IO_MAP(neat_io) - MCFG_DEVICE_REMOVE("mb:rtc") // TODO: move this into the cs8221 - MCFG_DS12885_ADD("mb:rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("mb:pic8259_slave", pic8259_device, ir0_w)) // this is in :mb - MCFG_MC146818_CENTURY_INDEX(0x32) + + ds12885_device &rtc(DS12885(config.replace(), "mb:rtc")); // TODO: move this into the cs8221 + rtc.irq().set("mb:pic8259_slave", FUNC(pic8259_device::ir0_w)); // this is in :mb + rtc.set_century_index(0x32); + CS8221(config, "cs8221", 0, "maincpu", "mb:isa", "bios"); MACHINE_CONFIG_END @@ -758,10 +759,9 @@ MACHINE_CONFIG_START(at_state::ficpio2) MCFG_QUANTUM_TIME(attotime::from_hz(60)) downcast<at_mb_device *>(device)->at_softlists(config); - MCFG_DEVICE_REMOVE("mb:rtc") - MCFG_DS12885_ADD("mb:rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("mb:pic8259_slave", pic8259_device, ir0_w)) // this is in :mb - MCFG_MC146818_CENTURY_INDEX(0x32) + ds12885_device &rtc(DS12885(config.replace(), "mb:rtc")); + rtc.irq().set("mb:pic8259_slave", FUNC(pic8259_device::ir0_w)); // this is in :mb + rtc.set_century_index(0x32); RAM(config, m_ram).set_default_size("4M").set_extra_options("1M,2M,8M,16M,32M,64M,128M"); diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp index 23ad807611d..c8303bb5c53 100644 --- a/src/mame/drivers/calchase.cpp +++ b/src/mame/drivers/calchase.cpp @@ -695,10 +695,9 @@ MACHINE_CONFIG_START(calchase_state::calchase) /* video hardware */ pcvideo_trident_vga(config); - MCFG_DEVICE_REMOVE("rtc") - MCFG_DS12885_ADD("rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir0_w)) - MCFG_MC146818_CENTURY_INDEX(0x32) + ds12885_device &rtc(DS12885(config.replace(), "rtc")); + rtc.irq().set("pic8259_2", FUNC(pic8259_device::ir0_w)); + rtc.set_century_index(0x32); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/decstation.cpp b/src/mame/drivers/decstation.cpp index 5593bad0c25..b7316cd3314 100644 --- a/src/mame/drivers/decstation.cpp +++ b/src/mame/drivers/decstation.cpp @@ -224,9 +224,9 @@ MACHINE_CONFIG_START(decstation_state::kn02da) MCFG_DEVICE_ADD("ioga", DECSTATION_IOGA, XTAL(12'500'000)) - MCFG_DEVICE_ADD("rtc", MC146818, XTAL(32'768)) - MCFG_MC146818_IRQ_HANDLER(WRITELINE("ioga", dec_ioga_device, rtc_irq_w)) - MCFG_MC146818_BINARY(true) + MC146818(config, m_rtc, XTAL(32'768)); + m_rtc->irq().set("ioga", FUNC(dec_ioga_device::rtc_irq_w)); + m_rtc->set_binary(true); SCC85C30(config, m_scc0, XTAL(14'745'600)/2); //m_scc0->out_int_callback().set("ioga", FUNC(dec_ioga_device::scc0_irq_w)); diff --git a/src/mame/drivers/hotstuff.cpp b/src/mame/drivers/hotstuff.cpp index 8f09949a8de..6bde0ec44ac 100644 --- a/src/mame/drivers/hotstuff.cpp +++ b/src/mame/drivers/hotstuff.cpp @@ -121,8 +121,8 @@ MACHINE_CONFIG_START(hotstuff_state::hotstuff) scc8530_device& scc2(SCC8530N(config, "scc2", 4915200)); scc2.out_int_callback().set_inputline(m_maincpu, M68K_IRQ_5); - MCFG_DEVICE_ADD("rtc", MC146818, XTAL(32'768)) - MCFG_MC146818_IRQ_HANDLER(INPUTLINE("maincpu", M68K_IRQ_1)) + MC146818(config, m_rtc, XTAL(32'768)); + m_rtc->irq().set_inputline("maincpu", M68K_IRQ_1); MACHINE_CONFIG_END diff --git a/src/mame/drivers/hx20.cpp b/src/mame/drivers/hx20.cpp index 2bc18ffd65a..d2eae4d7ca3 100644 --- a/src/mame/drivers/hx20.cpp +++ b/src/mame/drivers/hx20.cpp @@ -929,8 +929,9 @@ MACHINE_CONFIG_START(hx20_state::hx20) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) // devices - MCFG_DEVICE_ADD(MC146818_TAG, MC146818, 4.194304_MHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, hx20_state, rtc_irq_w)) + MC146818(config, m_rtc, 4.194304_MHz_XTAL); + m_rtc->irq().set(FUNC(hx20_state::rtc_irq_w)); + MCFG_DEVICE_ADD(RS232_TAG, RS232_PORT, default_rs232_devices, nullptr) MCFG_CASSETTE_ADD(CASSETTE_TAG) MCFG_EPSON_SIO_ADD("sio", "tf20") diff --git a/src/mame/drivers/interpro.cpp b/src/mame/drivers/interpro.cpp index 760a648c8cf..3f8dfe1d4a1 100644 --- a/src/mame/drivers/interpro.cpp +++ b/src/mame/drivers/interpro.cpp @@ -813,7 +813,7 @@ void interpro_state::interpro(machine_config &config) // real-time clock/non-volatile memory MC146818(config, m_rtc, 32.768_kHz_XTAL); m_rtc->set_use_utc(true); - m_rtc->irq_callback().set(m_ioga, FUNC(interpro_ioga_device::ir9_w)); + m_rtc->irq().set(m_ioga, FUNC(interpro_ioga_device::ir9_w)); // scsi bus and devices NSCSI_BUS(config, m_scsibus, 0); diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp index a56a03fa10b..d86fea26a67 100644 --- a/src/mame/drivers/mbee.cpp +++ b/src/mame/drivers/mbee.cpp @@ -775,8 +775,8 @@ MACHINE_CONFIG_START(mbee_state::mbeeppc) MCFG_PALETTE_MODIFY("palette") MCFG_PALETTE_INIT_OWNER(mbee_state, premium) - MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, mbee_state, rtc_irq_w)) + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(FUNC(mbee_state::rtc_irq_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(mbee_state::mbee56) @@ -803,8 +803,8 @@ MACHINE_CONFIG_START(mbee_state::mbee128) MCFG_DEVICE_IO_MAP(mbee128_io) MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128) - MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, mbee_state, rtc_irq_w)) + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(FUNC(mbee_state::rtc_irq_w)); MACHINE_CONFIG_END MACHINE_CONFIG_START(mbee_state::mbee128p) diff --git a/src/mame/drivers/micronic.cpp b/src/mame/drivers/micronic.cpp index e124e4c7ec9..360f53ed2cc 100644 --- a/src/mame/drivers/micronic.cpp +++ b/src/mame/drivers/micronic.cpp @@ -379,8 +379,8 @@ MACHINE_CONFIG_START(micronic_state::micronic) NVRAM(config, "nvram1").set_custom_handler(FUNC(micronic_state::nvram_init)); // base ram NVRAM(config, "nvram2").set_custom_handler(FUNC(micronic_state::nvram_init)); // additional ram banks - MCFG_DEVICE_ADD(MC146818_TAG, MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, micronic_state, mc146818_irq)) + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(FUNC(micronic_state::mc146818_irq)); MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mame/drivers/mtouchxl.cpp b/src/mame/drivers/mtouchxl.cpp index 452ff7acbc0..f185d0975aa 100644 --- a/src/mame/drivers/mtouchxl.cpp +++ b/src/mame/drivers/mtouchxl.cpp @@ -247,10 +247,9 @@ MACHINE_CONFIG_START(mtxl_state::at486) kbdc.gate_a20_callback().set_inputline(m_maincpu, INPUT_LINE_A20); kbdc.input_buffer_full_callback().set("mb:pic8259_master", FUNC(pic8259_device::ir1_w)); - MCFG_DEVICE_REMOVE("mb:rtc") - MCFG_DS12885_ADD("mb:rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("mb:pic8259_slave", pic8259_device, ir0_w)) - MCFG_MC146818_CENTURY_INDEX(0x32) + ds12885_device &rtc(DS12885(config.replace(), "mb:rtc")); + rtc.irq().set("mb:pic8259_slave", FUNC(pic8259_device::ir0_w)); + rtc.set_century_index(0x32); #endif /* internal ram */ RAM(config, RAM_TAG).set_default_size("32M"); // Early XL games had 8 MB RAM, 6000 and later require 32MB diff --git a/src/mame/drivers/octopus.cpp b/src/mame/drivers/octopus.cpp index 34f7b6a5878..9c521fe2bed 100644 --- a/src/mame/drivers/octopus.cpp +++ b/src/mame/drivers/octopus.cpp @@ -944,7 +944,7 @@ MACHINE_CONFIG_START(octopus_state::octopus) m_ppi->out_pc_callback().set(FUNC(octopus_state::gpo_w)); MC146818(config, m_rtc, 32.768_kHz_XTAL); - m_rtc->irq_callback().set(m_pic2, FUNC(pic8259_device::ir2_w)); + m_rtc->irq().set(m_pic2, FUNC(pic8259_device::ir2_w)); // Keyboard UART I8251(config, m_kb_uart, 0); diff --git a/src/mame/drivers/pc1512.cpp b/src/mame/drivers/pc1512.cpp index c69a4d27f14..9d7286daa8d 100644 --- a/src/mame/drivers/pc1512.cpp +++ b/src/mame/drivers/pc1512.cpp @@ -1207,8 +1207,8 @@ MACHINE_CONFIG_START(pc1512_state::pc1512) MCFG_PIT8253_CLK2(28.636363_MHz_XTAL / 24) MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, pc1512_state, pit2_w)) - MCFG_DEVICE_ADD(MC146818_TAG, MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(I8259A2_TAG, pic8259_device, ir2_w)) + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(I8259A2_TAG, FUNC(pic8259_device::ir2_w)); MCFG_PC_FDC_XT_ADD(PC_FDC_XT_TAG) MCFG_PC_FDC_INTRQ_CALLBACK(WRITELINE(*this, pc1512_state, fdc_int_w)) @@ -1338,8 +1338,8 @@ MACHINE_CONFIG_START(pc1640_state::pc1640) MCFG_PIT8253_CLK2(28.636363_MHz_XTAL / 24) MCFG_PIT8253_OUT2_HANDLER(WRITELINE(*this, pc1512_base_state, pit2_w)) - MCFG_DEVICE_ADD(MC146818_TAG, MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(I8259A2_TAG, pic8259_device, ir2_w)) + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(I8259A2_TAG, FUNC(pic8259_device::ir2_w)); MCFG_PC_FDC_XT_ADD(PC_FDC_XT_TAG) MCFG_PC_FDC_INTRQ_CALLBACK(WRITELINE(*this, pc1512_base_state, fdc_int_w)) diff --git a/src/mame/drivers/pcat_dyn.cpp b/src/mame/drivers/pcat_dyn.cpp index 86a80953f4f..6aa0d303c17 100644 --- a/src/mame/drivers/pcat_dyn.cpp +++ b/src/mame/drivers/pcat_dyn.cpp @@ -178,10 +178,9 @@ MACHINE_CONFIG_START(pcat_dyn_state::pcat_dyn) pcat_common(config); - MCFG_DEVICE_REMOVE("rtc") - MCFG_DS12885_ADD("rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir0_w)) - MCFG_MC146818_CENTURY_INDEX(0x32) + DS12885(config.replace(), m_mc146818); + m_mc146818->irq().set("pic8259_2", FUNC(pic8259_device::ir0_w)); + m_mc146818->set_century_index(0x32); MCFG_DEVICE_ADD("ad1848", AD1848, 0) MCFG_AD1848_IRQ_CALLBACK(WRITELINE("pic8259_1", pic8259_device, ir5_w)) diff --git a/src/mame/drivers/pcd.cpp b/src/mame/drivers/pcd.cpp index 1f632418c62..2ee64e15f8e 100644 --- a/src/mame/drivers/pcd.cpp +++ b/src/mame/drivers/pcd.cpp @@ -554,12 +554,12 @@ MACHINE_CONFIG_START(pcd_state::pcd) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) // rtc - MCFG_DEVICE_ADD("rtc", MC146818, 32.768_kHz_XTAL) - MCFG_MC146818_IRQ_HANDLER(WRITELINE(m_pic1, pic8259_device, ir7_w)) - MCFG_MC146818_BINARY(true) - MCFG_MC146818_BINARY_YEAR(true) - MCFG_MC146818_EPOCH(1900) - MCFG_MC146818_24_12(true) + MC146818(config, m_rtc, 32.768_kHz_XTAL); + m_rtc->irq().set(m_pic1, FUNC(pic8259_device::ir7_w)); + m_rtc->set_binary(true); + m_rtc->set_binary_year(true); + m_rtc->set_epoch(1900); + m_rtc->set_24hrs(true); MCFG_DEVICE_ADD("keyboard", PCD_KEYBOARD, 0) MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(WRITELINE("usart2", mc2661_device, rx_w)) diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp index 4b8829ffe36..b94c8b8e409 100644 --- a/src/mame/drivers/qx10.cpp +++ b/src/mame/drivers/qx10.cpp @@ -806,7 +806,7 @@ MACHINE_CONFIG_START(qx10_state::qx10) MCFG_VIDEO_SET_SCREEN("screen") MC146818(config, m_rtc, 32.768_kHz_XTAL); - m_rtc->irq_callback().set(m_pic_s, FUNC(pic8259_device::ir2_w)); + m_rtc->irq().set(m_pic_s, FUNC(pic8259_device::ir2_w)); UPD765A(config, m_fdc, true, true); m_fdc->intrq_wr_callback().set(FUNC(qx10_state::qx10_upd765_interrupt)); diff --git a/src/mame/drivers/su2000.cpp b/src/mame/drivers/su2000.cpp index 7c9c9aa3f4e..3fc8bdac1d4 100644 --- a/src/mame/drivers/su2000.cpp +++ b/src/mame/drivers/su2000.cpp @@ -152,10 +152,9 @@ MACHINE_CONFIG_START(su2000_state::su2000) pcat_common(config); - MCFG_DEVICE_REMOVE("rtc") - MCFG_DS12885_ADD("rtc") - MCFG_MC146818_IRQ_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir0_w)) - MCFG_MC146818_CENTURY_INDEX(0x32) + DS12885(config.replace(), m_mc146818); // TODO: Rename m_mc146818 to m_rtc + m_mc146818->irq().set("pic8259_2", FUNC(pic8259_device::ir0_w)); + m_mc146818->set_century_index(0x32); MACHINE_CONFIG_END diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index 6dfaa6d24e6..727e19be32e 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -1100,13 +1100,13 @@ MACHINE_CONFIG_START(apollo_state::common) MCFG_DEVICE_ADD("ptmclock", CLOCK, 250000) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, apollo_state, apollo_ptm_timer_tick)) - MCFG_DEVICE_ADD(APOLLO_RTC_TAG, MC146818, 32.768_kHz_XTAL) + MC146818(config, m_rtc, 32.768_kHz_XTAL); // FIXME: is this interrupt really only connected on DN3000? - //MCFG_MC146818_IRQ_HANDLER(WRITELINE(*this, apollo_state, apollo_rtc_irq_function)) - MCFG_MC146818_UTC(true) - MCFG_MC146818_BINARY(false) - MCFG_MC146818_24_12(false) - MCFG_MC146818_EPOCH(0) + //m_rtc->irq().set(FUNC(apollo_state::apollo_rtc_irq_function)); + m_rtc->set_use_utc(true); + m_rtc->set_binary(false); + m_rtc->set_24hrs(false); + m_rtc->set_epoch(0); MCFG_APOLLO_NI_ADD(APOLLO_NI_TAG, 0) diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp index 644e380ac33..13ecf80f24f 100644 --- a/src/mame/machine/at.cpp +++ b/src/mame/machine/at.cpp @@ -126,7 +126,7 @@ MACHINE_CONFIG_START(at_mb_device::device_add_mconfig) MCFG_ISA_OUT_DRQ7_CB(WRITELINE(m_dma8237_2, am9517a_device, dreq3_w)) MC146818(config, m_mc146818, 32.768_kHz_XTAL); - m_mc146818->irq_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir0_w)); + m_mc146818->irq().set(m_pic8259_slave, FUNC(pic8259_device::ir0_w)); m_mc146818->set_century_index(0x32); /* sound hardware */ diff --git a/src/mame/machine/pcshare.cpp b/src/mame/machine/pcshare.cpp index f75738b1649..0cedba2dd03 100644 --- a/src/mame/machine/pcshare.cpp +++ b/src/mame/machine/pcshare.cpp @@ -217,7 +217,7 @@ void pcat_base_state::pcat_common(machine_config &config) m_pit8254->out_handler<2>().set(FUNC(pcat_base_state::at_pit8254_out2_changed)); MC146818(config, m_mc146818, 32.768_kHz_XTAL); - m_mc146818->irq_callback().set(m_pic8259_2, FUNC(pic8259_device::ir0_w)); + m_mc146818->irq().set(m_pic8259_2, FUNC(pic8259_device::ir0_w)); m_mc146818->set_century_index(0x32); KBDC8042(config, m_kbdc, 0); |