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();
|
||||
}
|
||||
|
||||
void CDROM::CancelAsyncInterrupt()
|
||||
{
|
||||
m_pending_async_interrupt = 0;
|
||||
m_async_response_fifo.Clear();
|
||||
}
|
||||
|
||||
void CDROM::DeliverAsyncInterrupt()
|
||||
{
|
||||
Assert(m_pending_async_interrupt != 0 && !HasPendingInterrupt());
|
||||
|
@ -992,6 +998,7 @@ void CDROM::DoSectorRead()
|
|||
if (HasPendingAsyncInterrupt())
|
||||
{
|
||||
Log_WarningPrintf("Data interrupt was not delivered");
|
||||
CancelAsyncInterrupt();
|
||||
}
|
||||
if (!m_sector_buffer.empty())
|
||||
{
|
||||
|
|
|
@ -171,6 +171,7 @@ private:
|
|||
bool HasPendingAsyncInterrupt() const { return m_pending_async_interrupt != 0; }
|
||||
void SetInterrupt(Interrupt interrupt);
|
||||
void SetAsyncInterrupt(Interrupt interrupt);
|
||||
void CancelAsyncInterrupt();
|
||||
void DeliverAsyncInterrupt();
|
||||
void SendACKAndStat();
|
||||
void SendErrorResponse(u8 reason = 0x80);
|
||||
|
|
Loading…
Reference in New Issue