From 61693ea709cbd1bfc7271e471e17b5efb0bfe9ae Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 1 Aug 2018 16:05:42 -0400 Subject: timekpr: Default input clock for all devices; convert M48T37 callbacks to devcb3 (nw) --- src/devices/machine/timekpr.h | 28 +++++++++------------------- src/mame/drivers/atlantis.cpp | 6 +++--- src/mame/drivers/vegas.cpp | 6 +++--- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/devices/machine/timekpr.h b/src/devices/machine/timekpr.h index c0f7fcdc83a..4742a1b1ae8 100644 --- a/src/devices/machine/timekpr.h +++ b/src/devices/machine/timekpr.h @@ -22,17 +22,6 @@ -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_M48T37_RESET_HANDLER(_devcb) \ - downcast(*device).set_reset_handler(DEVCB_##_devcb); - -#define MCFG_M48T37_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -46,8 +35,9 @@ public: DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER(watchdog_write); - template devcb_base &set_reset_handler(Object &&cb) { return m_reset_cb.set_callback(std::forward(cb)); } - template devcb_base &set_irq_handler(Object &&cb) { return m_irq_cb.set_callback(std::forward(cb)); } + + auto reset_cb() { return m_reset_cb.bind(); } + auto irq_cb() { return m_irq_cb.bind(); } protected: // construction/destruction @@ -105,37 +95,37 @@ protected: class m48t02_device : public timekeeper_device { public: - m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class m48t35_device : public timekeeper_device { public: - m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class m48t37_device : public timekeeper_device { public: - m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class m48t58_device : public timekeeper_device { public: - m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class mk48t08_device : public timekeeper_device { public: - mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; class mk48t12_device : public timekeeper_device { public: - mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; // device type definition diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp index 681e4562586..160f26db830 100644 --- a/src/mame/drivers/atlantis.cpp +++ b/src/mame/drivers/atlantis.cpp @@ -828,9 +828,9 @@ MACHINE_CONFIG_START(atlantis_state::mwskins) MCFG_PCI9050_USER_OUTPUT_CALLBACK(WRITE32(*this, atlantis_state, user_io_output)) MCFG_PCI9050_USER_INPUT_CALLBACK(READ32(*this, atlantis_state, user_io_input)) - MCFG_DEVICE_ADD(m_rtc, M48T37, 0) - MCFG_M48T37_RESET_HANDLER(WRITELINE(*this, atlantis_state, watchdog_reset)) - MCFG_M48T37_IRQ_HANDLER(WRITELINE(*this, atlantis_state, watchdog_irq)) + M48T37(config, m_rtc); + 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)) diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp index 50d6be6dc36..9536fd91425 100644 --- a/src/mame/drivers/vegas.cpp +++ b/src/mame/drivers/vegas.cpp @@ -1770,9 +1770,9 @@ MACHINE_CONFIG_START(vegas_state::vegascore) MCFG_DEVICE_MODIFY(PCI_ID_VIDEO":voodoo") MCFG_VOODOO_VBLANK_CB(WRITELINE(*this, vegas_state, vblank_assert)) - MCFG_DEVICE_ADD(m_timekeeper, M48T37, 0) - MCFG_M48T37_RESET_HANDLER(WRITELINE(*this, vegas_state, watchdog_reset)) - MCFG_M48T37_IRQ_HANDLER(WRITELINE(*this, vegas_state, watchdog_irq)) + M48T37(config, m_timekeeper); + m_timekeeper->reset_cb().set(FUNC(vegas_state::watchdog_reset)); + m_timekeeper->irq_cb().set(FUNC(vegas_state::watchdog_irq)); MCFG_SMC91C94_ADD(m_ethernet) MCFG_SMC91C94_IRQ_CALLBACK(WRITELINE(*this, vegas_state, ethernet_interrupt)) -- cgit v1.2.3