mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
z80ctc: Minor clock cleanup (nw)
This commit is contained in:
parent
84456ebe15
commit
9422e167ca
@ -128,9 +128,6 @@ WRITE_LINE_MEMBER( z80ctc_device::trg3 ) { m_channel[3].trigger(state); }
|
|||||||
|
|
||||||
void z80ctc_device::device_start()
|
void z80ctc_device::device_start()
|
||||||
{
|
{
|
||||||
m_period16 = attotime::from_hz(m_clock) * 16;
|
|
||||||
m_period256 = attotime::from_hz(m_clock) * 256;
|
|
||||||
|
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
m_intr_cb.resolve_safe();
|
m_intr_cb.resolve_safe();
|
||||||
m_zc0_cb.resolve_safe();
|
m_zc0_cb.resolve_safe();
|
||||||
@ -345,7 +342,7 @@ attotime z80ctc_device::ctc_channel::period() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// compute the period
|
// 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;
|
return period * m_tconst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +360,7 @@ uint8_t z80ctc_device::ctc_channel::read()
|
|||||||
// else compute the down counter value
|
// else compute the down counter value
|
||||||
else
|
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())));
|
VPRINTF_CHANNEL(("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds())));
|
||||||
|
|
||||||
|
@ -125,8 +125,6 @@ private:
|
|||||||
devcb_write_line m_zc3_cb; // channel 3 zero crossing callbacks = nullptr ?
|
devcb_write_line m_zc3_cb; // channel 3 zero crossing callbacks = nullptr ?
|
||||||
|
|
||||||
uint8_t m_vector; // interrupt vector
|
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
|
ctc_channel m_channel[4]; // data for each channel
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user