diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp index cab0738e22c..efc8eae1aea 100644 --- a/src/devices/machine/z80ctc.cpp +++ b/src/devices/machine/z80ctc.cpp @@ -128,9 +128,6 @@ WRITE_LINE_MEMBER( z80ctc_device::trg3 ) { m_channel[3].trigger(state); } void z80ctc_device::device_start() { - m_period16 = attotime::from_hz(m_clock) * 16; - m_period256 = attotime::from_hz(m_clock) * 256; - // resolve callbacks m_intr_cb.resolve_safe(); m_zc0_cb.resolve_safe(); @@ -345,7 +342,7 @@ attotime z80ctc_device::ctc_channel::period() const } // compute the period - attotime period = ((m_mode & PRESCALER) == PRESCALER_16) ? m_device->m_period16 : m_device->m_period256; + attotime period = m_device->clocks_to_attotime((m_mode & PRESCALER) == PRESCALER_16 ? 16 : 256); return period * m_tconst; } @@ -363,7 +360,7 @@ uint8_t z80ctc_device::ctc_channel::read() // else compute the down counter value else { - attotime period = ((m_mode & PRESCALER) == PRESCALER_16) ? m_device->m_period16 : m_device->m_period256; + attotime period = m_device->clocks_to_attotime((m_mode & PRESCALER) == PRESCALER_16 ? 16 : 256); VPRINTF_CHANNEL(("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds()))); diff --git a/src/devices/machine/z80ctc.h b/src/devices/machine/z80ctc.h index 66d1ea0698a..61c937d930c 100644 --- a/src/devices/machine/z80ctc.h +++ b/src/devices/machine/z80ctc.h @@ -125,8 +125,6 @@ private: devcb_write_line m_zc3_cb; // channel 3 zero crossing callbacks = nullptr ? uint8_t m_vector; // interrupt vector - attotime m_period16; // 16/system clock - attotime m_period256; // 256/system clock ctc_channel m_channel[4]; // data for each channel };