summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/by17.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/by17.cpp')
-rw-r--r--src/mame/drivers/by17.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mame/drivers/by17.cpp b/src/mame/drivers/by17.cpp
index a819e54c3c0..aee123f9b68 100644
--- a/src/mame/drivers/by17.cpp
+++ b/src/mame/drivers/by17.cpp
@@ -37,6 +37,8 @@ public:
, m_nvram(*this, "nvram")
, m_pia_u10(*this, "pia_u10")
, m_pia_u11(*this, "pia_u11")
+ , m_zero_crossing_active_timer(*this, "timer_z_pulse")
+ , m_display_refresh_timer(*this, "timer_d_pulse")
, m_io_test(*this, "TEST")
, m_io_dsw0(*this, "DSW0")
, m_io_dsw1(*this, "DSW1")
@@ -86,6 +88,8 @@ private:
required_shared_ptr<uint8_t> m_nvram;
required_device<pia6821_device> m_pia_u10;
required_device<pia6821_device> m_pia_u11;
+ required_device<timer_device> m_zero_crossing_active_timer;
+ required_device<timer_device> m_display_refresh_timer;
required_ioport m_io_test;
required_ioport m_io_dsw0;
required_ioport m_io_dsw1;
@@ -805,9 +809,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( by17_state::timer_z_freq )
+--------------------------+ +-----
*/
- timer_device *zero_crossing_active_timer = machine().device<timer_device>("timer_z_pulse");
-
- zero_crossing_active_timer->adjust(attotime::from_usec(700));
+ m_zero_crossing_active_timer->adjust(attotime::from_usec(700));
m_u10_cb1 = true;
m_pia_u10->cb1_w(m_u10_cb1);
@@ -835,9 +837,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( by17_state::u11_timer )
-+ +---+
*/
- timer_device *display_refresh_timer = machine().device<timer_device>("timer_d_pulse");
-
- display_refresh_timer->adjust(attotime::from_msec(2.85));
+ m_display_refresh_timer->adjust(attotime::from_msec(2.85));
m_u11_ca1 = true;
m_pia_u11->ca1_w(m_u11_ca1);
@@ -1019,7 +1019,7 @@ MACHINE_CONFIG_START(by17_state::by17)
MCFG_PIA_IRQA_HANDLER(INPUTLINE("maincpu", M6800_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("maincpu", M6800_IRQ_LINE))
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_z_freq", by17_state, timer_z_freq, attotime::from_hz(100)) // Mains Line Frequency * 2
- MCFG_TIMER_DRIVER_ADD("timer_z_pulse", by17_state, timer_z_pulse) // Active pulse length from Zero Crossing detector
+ MCFG_TIMER_DRIVER_ADD(m_zero_crossing_active_timer, by17_state, timer_z_pulse) // Active pulse length from Zero Crossing detector
MCFG_DEVICE_ADD("pia_u11", PIA6821, 0)
MCFG_PIA_READPA_HANDLER(READ8(*this, by17_state, u11_a_r))
@@ -1032,7 +1032,7 @@ MACHINE_CONFIG_START(by17_state::by17)
MCFG_PIA_IRQA_HANDLER(INPUTLINE("maincpu", M6800_IRQ_LINE))
MCFG_PIA_IRQB_HANDLER(INPUTLINE("maincpu", M6800_IRQ_LINE))
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_d_freq", by17_state, u11_timer, attotime::from_hz(317)) // 555 timer
- MCFG_TIMER_DRIVER_ADD("timer_d_pulse", by17_state, timer_d_pulse) // 555 Active pulse length
+ MCFG_TIMER_DRIVER_ADD(m_display_refresh_timer, by17_state, timer_d_pulse) // 555 Active pulse length
MACHINE_CONFIG_END