int melps4_cpu_device::read_d_pin(int bit) { // read port D, return state of selected pin bit &= 0xf; UINT16 d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask; return d >> bit & 1; }
int hmcs40_cpu_device::read_d(int index) { index &= 15; if (m_polarity) return (m_read_d(index, 0xffff) & m_d) >> index & 1; else return (m_read_d(index, 0xffff) | m_d) >> index & 1;
UINT8 ucom4_cpu_device::input_r(int index) { index &= 0xf; UINT8 inp = 0xf; switch (index) { case NEC_UCOM4_PORTA: inp = m_read_a(index, 0xff); break; case NEC_UCOM4_PORTB: inp = m_read_b(index, 0xff); break; case NEC_UCOM4_PORTC: inp = m_read_c(index, 0xff); break; case NEC_UCOM4_PORTD: inp = m_read_d(index, 0xff); break; default: logerror("%s read from unknown port %c at $%03X\n", tag(), 'A' + index, m_prev_pc); break; } return inp & 0xf; }