diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp index ffc4e397e59..ca0cd4c1bf3 100644 --- a/src/mame/drivers/thayers.cpp +++ b/src/mame/drivers/thayers.cpp @@ -321,7 +321,9 @@ WRITE_LINE_MEMBER(thayers_state::kbclk_w) if (!m_kbclk && state) { m_rx_bit++; - if (m_rx_bit == 10) { + switch (m_rx_bit) + { + case 10: m_rx_bit = 0; m_keylatch++; @@ -331,18 +333,20 @@ WRITE_LINE_MEMBER(thayers_state::kbclk_w) } if (LOG) logerror("keylatch %u\n",m_keylatch); - } + break; - if (LOG) logerror("rx bit %u\n",m_rx_bit); + case 9: + // 1, 0, 1, Q9, P3, P2, P1, P0, 0, 1 + m_keydata = 0xa0 | (m_keylatch == 9) << 4 | m_row[m_keylatch]->read(); - if (BIT(m_rx_bit, 3)) { - // 1, 0, 1, Q9, P3, P2, P1, P0, 1, 1 - bool q9 = (m_keylatch == 9); - m_keydata = 0xa0 | q9 << 4 | m_row[m_keylatch]->read(); if (LOG) logerror("keydata %02x keylatch %u\n",m_keydata,m_keylatch); - } else if (m_rx_bit) { + break; + + default: m_keydata <<= 1; + if (LOG) logerror("keydata %02x shift\n",m_keydata); + break; } }