From 38288e6b36b2c544425cc85420a2f4e4af868de1 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 14 Jun 2021 13:47:55 +1000 Subject: [PATCH] CDROM: Factor in implicit seeks when calculating time --- src/core/cdrom.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 5ec858f4a..63af29145 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -741,14 +741,16 @@ TickCount CDROM::GetTicksForSeek(CDImage::LBA new_lba) if (g_settings.cdrom_seek_speedup == 0) return MIN_TICKS; - UpdatePhysicalPosition(); + u32 ticks = static_cast(MIN_TICKS); + if (IsSeeking()) + ticks += m_drive_event->GetTicksUntilNextExecution(); + else + UpdatePhysicalPosition(); const TickCount tps = System::GetTicksPerSecond(); - const CDImage::LBA current_lba = m_secondary_status.motor_on ? m_physical_lba : 0; + const CDImage::LBA current_lba = m_secondary_status.motor_on ? (IsSeeking() ? m_seek_end_lba : m_physical_lba) : 0; const u32 lba_diff = static_cast((new_lba > current_lba) ? (new_lba - current_lba) : (current_lba - new_lba)); - u32 ticks = static_cast(MIN_TICKS); - // Motor spin-up time. if (!m_secondary_status.motor_on) {