mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 14:25:38 +00:00
Pad: Update status after ACK
This commit is contained in:
parent
c1e9617c77
commit
54277dc24f
|
@ -91,6 +91,7 @@ bool Pad::DoState(StateWrapper& sw)
|
||||||
sw.Do(&m_transmit_buffer);
|
sw.Do(&m_transmit_buffer);
|
||||||
sw.Do(&m_receive_buffer_full);
|
sw.Do(&m_receive_buffer_full);
|
||||||
sw.Do(&m_transmit_buffer_full);
|
sw.Do(&m_transmit_buffer_full);
|
||||||
|
|
||||||
return !sw.HasError();
|
return !sw.HasError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,11 +101,17 @@ u32 Pad::ReadRegister(u32 offset)
|
||||||
{
|
{
|
||||||
case 0x00: // JOY_DATA
|
case 0x00: // JOY_DATA
|
||||||
{
|
{
|
||||||
|
u8 value;
|
||||||
if (!m_receive_buffer_full)
|
if (!m_receive_buffer_full)
|
||||||
|
{
|
||||||
Log_DevPrintf("Read from RX fifo when empty");
|
Log_DevPrintf("Read from RX fifo when empty");
|
||||||
|
value = 0xFF;
|
||||||
const u8 value = m_receive_buffer;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value = m_receive_buffer;
|
||||||
m_receive_buffer_full = false;
|
m_receive_buffer_full = false;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateJoyStat();
|
UpdateJoyStat();
|
||||||
Log_DebugPrintf("JOY_DATA (R) -> 0x%02X", ZeroExtend32(value));
|
Log_DebugPrintf("JOY_DATA (R) -> 0x%02X", ZeroExtend32(value));
|
||||||
|
@ -244,7 +251,7 @@ void Pad::SoftReset()
|
||||||
void Pad::UpdateJoyStat()
|
void Pad::UpdateJoyStat()
|
||||||
{
|
{
|
||||||
m_JOY_STAT.RXFIFONEMPTY = m_receive_buffer_full;
|
m_JOY_STAT.RXFIFONEMPTY = m_receive_buffer_full;
|
||||||
m_JOY_STAT.TXDONE = !m_transmit_buffer_full && m_state == State::Idle;
|
m_JOY_STAT.TXDONE = !m_transmit_buffer_full && m_state != State::Transmitting;
|
||||||
m_JOY_STAT.TXRDY = !m_transmit_buffer_full;
|
m_JOY_STAT.TXRDY = !m_transmit_buffer_full;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +384,7 @@ void Pad::DoACK()
|
||||||
}
|
}
|
||||||
|
|
||||||
EndTransfer();
|
EndTransfer();
|
||||||
|
UpdateJoyStat();
|
||||||
|
|
||||||
if (CanTransfer())
|
if (CanTransfer())
|
||||||
BeginTransfer();
|
BeginTransfer();
|
||||||
|
|
Loading…
Reference in a new issue