From e3140d6e547b89e0abbe3cf7f6fe68acf4aa18ed Mon Sep 17 00:00:00 2001 From: Sandro Ronco Date: Wed, 30 Nov 2016 19:52:27 +0100 Subject: [PATCH] microtouch: added output status command and fixed data transmission at 2400 baud. --- src/devices/machine/microtch.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/microtch.cpp b/src/devices/machine/microtch.cpp index b8a810bcbda..4f6d10c3cea 100644 --- a/src/devices/machine/microtch.cpp +++ b/src/devices/machine/microtch.cpp @@ -120,10 +120,12 @@ void microtouch_device::device_timer(emu_timer &timer, device_timer_id id, int p if ( m_tx_buffer_ptr < m_tx_buffer_num ) { - m_output = m_tx_buffer[m_tx_buffer_ptr++]; - m_output_valid = true; if(is_transmit_register_empty()) + { + m_output = m_tx_buffer[m_tx_buffer_ptr++]; + m_output_valid = true; tra_complete(); + } if ( m_tx_buffer_ptr == m_tx_buffer_num ) { @@ -263,6 +265,32 @@ void microtouch_device::rcv_complete() m_rx_buffer_ptr = 0; return; } + else if ( check_command("OS", m_rx_buffer_ptr, m_rx_buffer ) ) + { + // output status + m_tx_buffer[m_tx_buffer_num++] = 0x01; + + // ---- ---x RAM error + // ---- --x- ROM error + // ---- -x-- Analog-to-digital error + // ---- x--- NOVRAM error + // ---x ---- ASIC error + // --x- ---- Power on flag + // -x-- ---- Always 1 + // x--- ---- Always 0 + m_tx_buffer[m_tx_buffer_num++] = 0x40; + + // ---- ---x Cable NOVRAM error + // ---- --x- Hard NOVRAM error + // ---x xx-- Reserved + // --x- ---- Software reset flag + // -x-- ---- Always 1 + // x--- ---- Always 0 + m_tx_buffer[m_tx_buffer_num++] = 0x40 | (m_reset_done << 5); + m_tx_buffer[m_tx_buffer_num++] = 0x0d; + m_rx_buffer_ptr = 0; + return; + } // send response m_tx_buffer[m_tx_buffer_num++] = 0x01; m_tx_buffer[m_tx_buffer_num++] = 0x30;