mirror of
https://github.com/holub/mame
synced 2025-07-04 01:18:59 +03:00
z8: Split sio_tick into two functions (nw)
This commit is contained in:
parent
fb8254d751
commit
2e6e2d33d6
@ -481,7 +481,7 @@ bool z8_device::get_serial_in()
|
|||||||
return (m_input[3] & Z8_P3_SIN) != 0;
|
return (m_input[3] & Z8_P3_SIN) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void z8_device::sio_tick()
|
void z8_device::sio_receive()
|
||||||
{
|
{
|
||||||
if (m_receive_started)
|
if (m_receive_started)
|
||||||
{
|
{
|
||||||
@ -548,31 +548,34 @@ void z8_device::sio_tick()
|
|||||||
m_receive_count = 0;
|
m_receive_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_transmit_sr != 0)
|
void z8_device::sio_transmit()
|
||||||
|
{
|
||||||
|
if (m_transmit_sr == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_transmit_count = (m_transmit_count + 1) & 15;
|
||||||
|
if (m_transmit_count == 0)
|
||||||
{
|
{
|
||||||
m_transmit_count = (m_transmit_count + 1) & 15;
|
m_transmit_sr >>= 1;
|
||||||
if (m_transmit_count == 0)
|
if (m_transmit_sr == 0)
|
||||||
|
request_interrupt(4);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
m_transmit_sr >>= 1;
|
// parity replaces received bit 7 if selected
|
||||||
if (m_transmit_sr == 0)
|
if ((m_transmit_sr >> 1) == 3 && (m_p3m & Z8_P3M_PARITY) != 0)
|
||||||
request_interrupt(4);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// parity replaces received bit 7 if selected
|
if (m_transmit_parity)
|
||||||
if ((m_transmit_sr >> 1) == 3 && (m_p3m & Z8_P3M_PARITY) != 0)
|
m_transmit_sr |= 1;
|
||||||
{
|
else
|
||||||
if (m_transmit_parity)
|
m_transmit_sr &= ~1;
|
||||||
m_transmit_sr |= 1;
|
|
||||||
else
|
|
||||||
m_transmit_sr &= ~1;
|
|
||||||
}
|
|
||||||
else if (BIT(m_transmit_sr, 0))
|
|
||||||
m_transmit_parity = !m_transmit_parity;
|
|
||||||
|
|
||||||
// serial output
|
|
||||||
p3_update_output();
|
|
||||||
}
|
}
|
||||||
|
else if (BIT(m_transmit_sr, 0))
|
||||||
|
m_transmit_parity = !m_transmit_parity;
|
||||||
|
|
||||||
|
// serial output
|
||||||
|
p3_update_output();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -622,7 +625,10 @@ void z8_device::timer_end()
|
|||||||
tout_toggle();
|
tout_toggle();
|
||||||
|
|
||||||
if (T == 0 && (m_p3m & Z8_P3M_P3_SERIAL) != 0)
|
if (T == 0 && (m_p3m & Z8_P3M_P3_SERIAL) != 0)
|
||||||
sio_tick();
|
{
|
||||||
|
sio_receive();
|
||||||
|
sio_transmit();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
request_interrupt(4 + T);
|
request_interrupt(4 + T);
|
||||||
|
|
||||||
|
@ -138,7 +138,8 @@ private:
|
|||||||
emu_timer *m_internal_timer[2];
|
emu_timer *m_internal_timer[2];
|
||||||
|
|
||||||
bool get_serial_in();
|
bool get_serial_in();
|
||||||
void sio_tick();
|
void sio_receive();
|
||||||
|
void sio_transmit();
|
||||||
|
|
||||||
template <int T> void timer_start();
|
template <int T> void timer_start();
|
||||||
template <int T> void timer_stop();
|
template <int T> void timer_stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user