microtouch: added output status command and fixed data transmission at 2400 baud.

This commit is contained in:
Sandro Ronco 2016-11-30 19:52:27 +01:00
parent d7ae91ffb2
commit e3140d6e54

View File

@ -119,11 +119,13 @@ void microtouch_device::device_timer(emu_timer &timer, device_timer_id id, int p
} }
if ( m_tx_buffer_ptr < m_tx_buffer_num ) if ( m_tx_buffer_ptr < m_tx_buffer_num )
{
if(is_transmit_register_empty())
{ {
m_output = m_tx_buffer[m_tx_buffer_ptr++]; m_output = m_tx_buffer[m_tx_buffer_ptr++];
m_output_valid = true; m_output_valid = true;
if(is_transmit_register_empty())
tra_complete(); tra_complete();
}
if ( m_tx_buffer_ptr == m_tx_buffer_num ) if ( m_tx_buffer_ptr == m_tx_buffer_num )
{ {
@ -263,6 +265,32 @@ void microtouch_device::rcv_complete()
m_rx_buffer_ptr = 0; m_rx_buffer_ptr = 0;
return; 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 // send response
m_tx_buffer[m_tx_buffer_num++] = 0x01; m_tx_buffer[m_tx_buffer_num++] = 0x01;
m_tx_buffer[m_tx_buffer_num++] = 0x30; m_tx_buffer[m_tx_buffer_num++] = 0x30;