Skip to content

Commit

Permalink
CDROM: Handle speed change while reading
Browse files Browse the repository at this point in the history
Fixes level music in Croc 2 demo.
  • Loading branch information
stenzek committed Jul 17, 2024
1 parent 0a86aba commit 92038da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/cdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,12 @@ void CDROM::ExecuteCommand(void*, TickCount ticks, TickCount ticks_late)
s_drive_state_names[static_cast<u8>(s_drive_state)], change_ticks,
s_mode.double_speed ? "double" : "single");
s_drive_event->Delay(change_ticks);

if (IsReadingOrPlaying())
{
WARNING_LOG("Speed change while reading/playing, reads will be temporarily delayed.");
s_drive_event->SetInterval(GetTicksForRead());
}
}
else
{
Expand Down

0 comments on commit 92038da

Please sign in to comment.