void pia6821_device::set_out_cb2(int data) { int z = cb2_output_z(); if ((data != m_out_cb2) || (z != m_last_out_cb2_z)) { m_out_cb2 = data; m_last_out_cb2_z = z; // send to output function if (!m_out_cb2_func.isnull()) { m_out_cb2_func(m_out_cb2); } else { if (m_out_cb2_needs_pulled) { logerror("PIA #%s: Warning! No port CB2 write handler. Previous value has been lost!\n", tag()); } m_out_cb2_needs_pulled = true; } } }
void via6522_device::shift() { if (SO_O2_CONTROL(m_acr) || SO_T2_CONTROL(m_acr)) { m_out_cb2 = (m_sr >> 7) & 1; m_sr = (m_sr << 1) | m_out_cb2; m_out_cb2_func(m_out_cb2); m_in_cb1=1; /* this should be one cycle wide */ m_out_cb1_func(0); m_out_cb1_func(1); m_shift_counter = (m_shift_counter + 1) % 8; if (m_shift_counter) { if (SO_O2_CONTROL(m_acr)) { m_shift_timer->adjust(clocks_to_attotime(2)); } else { m_shift_timer->adjust(clocks_to_attotime((m_t2ll + 2)*2)); } } else { if (!(m_ifr & INT_SR)) { set_int(INT_SR); } } }