mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
CDROM: Cancel speed changes if they're not complete
This commit is contained in:
parent
b1776dea61
commit
2c19c7ce57
|
@ -1020,8 +1020,18 @@ void CDROM::ExecuteCommand(TickCount ticks_late)
|
|||
SendACKAndStat();
|
||||
EndCommand();
|
||||
|
||||
if (speed_change && m_drive_state != DriveState::SeekingImplicit &&
|
||||
m_drive_state != DriveState::ChangingSpeedOrTOCRead)
|
||||
if (speed_change)
|
||||
{
|
||||
if (m_drive_state == DriveState::ChangingSpeedOrTOCRead)
|
||||
{
|
||||
// cancel the speed change if it's less than a quarter complete
|
||||
if (m_drive_event->GetTicksUntilNextExecution() >= (GetTicksForSpeedChange() / 4))
|
||||
{
|
||||
Log_DevPrintf("Cancelling speed change event");
|
||||
ClearDriveState();
|
||||
}
|
||||
}
|
||||
else if (m_drive_state != DriveState::SeekingImplicit)
|
||||
{
|
||||
// if we're seeking or reading, we need to add time to the current seek/read
|
||||
const TickCount change_ticks = GetTicksForSpeedChange();
|
||||
|
@ -1039,6 +1049,7 @@ void CDROM::ExecuteCommand(TickCount ticks_late)
|
|||
m_drive_event->Schedule(change_ticks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue