mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
vsmile_ctrl: hack to survive F3 reset (nw)
This commit is contained in:
parent
a16fb19be9
commit
a27b5ee8b4
@ -65,6 +65,17 @@ void vsmile_pad_device::device_start()
|
||||
save_item(NAME(m_ctrl_probe_history));
|
||||
}
|
||||
|
||||
void vsmile_pad_device::device_reset()
|
||||
{
|
||||
vsmile_ctrl_device_base::device_reset();
|
||||
|
||||
// HACK: the controller detects an RTS timeout or something, it doesn't have a reset line
|
||||
m_stale = STALE_ALL;
|
||||
m_active = false;
|
||||
std::fill(std::begin(m_ctrl_probe_history), std::end(m_ctrl_probe_history), 0U);
|
||||
m_idle_timer->adjust(attotime::from_seconds(1));
|
||||
}
|
||||
|
||||
void vsmile_pad_device::tx_complete()
|
||||
{
|
||||
// update joystick
|
||||
@ -129,6 +140,7 @@ void vsmile_pad_device::tx_timeout()
|
||||
m_idle_timer->adjust(attotime::from_seconds(1));
|
||||
m_active = false;
|
||||
m_stale = STALE_ALL;
|
||||
std::fill(std::begin(m_ctrl_probe_history), std::end(m_ctrl_probe_history), 0U);
|
||||
LOG("left active state\n");
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ protected:
|
||||
// device_t implementation
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// vsmile_ctrl_device_base implementation
|
||||
virtual void tx_complete() override;
|
||||
|
@ -193,7 +193,7 @@ bool vsmile_ctrl_device_base::queue_tx(uint8_t data)
|
||||
else
|
||||
{
|
||||
LOG("asserting RTS to transmit byte %02X\n", data);
|
||||
m_rts_timer->adjust(attotime::from_msec(500));
|
||||
m_rts_timer->adjust(attotime::from_msec(100));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -290,6 +290,8 @@ TIMER_CALLBACK_MEMBER(vsmile_ctrl_device_base::rts_timer_expired)
|
||||
m_tx_fifo_head = m_tx_fifo_tail = 0U;
|
||||
m_tx_fifo_empty = true;
|
||||
tx_timeout();
|
||||
if (m_tx_fifo_empty)
|
||||
rts_out(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user