mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-29 09:05:41 +00:00
CDROM: Cancel command second response when queuing new command
Fixes Wipeout corrupting parts of the TOC.
This commit is contained in:
parent
e45f15ef41
commit
18241978ea
|
@ -908,9 +908,21 @@ void CDROM::BeginCommand(Command command)
|
|||
s_command_info[static_cast<u8>(command)].name);
|
||||
|
||||
// subtract the currently-elapsed ack ticks from the new command
|
||||
const TickCount elapsed_ticks = m_command_event->GetInterval() - m_command_event->GetTicksUntilNextExecution();
|
||||
ack_delay = std::max(ack_delay - elapsed_ticks, 1);
|
||||
m_command_event->Deactivate();
|
||||
if (m_command_event->IsActive())
|
||||
{
|
||||
const TickCount elapsed_ticks = m_command_event->GetInterval() - m_command_event->GetTicksUntilNextExecution();
|
||||
ack_delay = std::max(ack_delay - elapsed_ticks, 1);
|
||||
m_command_event->Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_command_second_response != Command::None)
|
||||
{
|
||||
Log_WarningPrintf("Cancelling pending command 0x%02X (%s) second response",
|
||||
static_cast<u16>(m_command_second_response),
|
||||
s_command_info[static_cast<u16>(m_command_second_response)].name);
|
||||
|
||||
ClearCommandSecondResponse();
|
||||
}
|
||||
|
||||
m_command = command;
|
||||
|
|
Loading…
Reference in a new issue