mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
CDROM: Don't crash emulator when interrupts are missed
This commit is contained in:
parent
b0c492fd43
commit
62f6a5597e
|
@ -424,6 +424,12 @@ void CDROM::SetAsyncInterrupt(Interrupt interrupt)
|
||||||
DeliverAsyncInterrupt();
|
DeliverAsyncInterrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDROM::CancelAsyncInterrupt()
|
||||||
|
{
|
||||||
|
m_pending_async_interrupt = 0;
|
||||||
|
m_async_response_fifo.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
void CDROM::DeliverAsyncInterrupt()
|
void CDROM::DeliverAsyncInterrupt()
|
||||||
{
|
{
|
||||||
Assert(m_pending_async_interrupt != 0 && !HasPendingInterrupt());
|
Assert(m_pending_async_interrupt != 0 && !HasPendingInterrupt());
|
||||||
|
@ -992,6 +998,7 @@ void CDROM::DoSectorRead()
|
||||||
if (HasPendingAsyncInterrupt())
|
if (HasPendingAsyncInterrupt())
|
||||||
{
|
{
|
||||||
Log_WarningPrintf("Data interrupt was not delivered");
|
Log_WarningPrintf("Data interrupt was not delivered");
|
||||||
|
CancelAsyncInterrupt();
|
||||||
}
|
}
|
||||||
if (!m_sector_buffer.empty())
|
if (!m_sector_buffer.empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,6 +171,7 @@ private:
|
||||||
bool HasPendingAsyncInterrupt() const { return m_pending_async_interrupt != 0; }
|
bool HasPendingAsyncInterrupt() const { return m_pending_async_interrupt != 0; }
|
||||||
void SetInterrupt(Interrupt interrupt);
|
void SetInterrupt(Interrupt interrupt);
|
||||||
void SetAsyncInterrupt(Interrupt interrupt);
|
void SetAsyncInterrupt(Interrupt interrupt);
|
||||||
|
void CancelAsyncInterrupt();
|
||||||
void DeliverAsyncInterrupt();
|
void DeliverAsyncInterrupt();
|
||||||
void SendACKAndStat();
|
void SendACKAndStat();
|
||||||
void SendErrorResponse(u8 reason = 0x80);
|
void SendErrorResponse(u8 reason = 0x80);
|
||||||
|
|
Loading…
Reference in a new issue