From 95247b0b5e1f6ddc560b1e5e5f253e4c4448b80b Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 11 Jun 2021 20:08:57 +1000 Subject: [PATCH] CDROM: Don't set motor on before calc read/play time --- src/core/cdrom.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index b505a9b65..8e2c6ab1f 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1499,12 +1499,14 @@ void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = fa } Log_DebugPrintf("Starting reading @ LBA %u", m_current_lba); + + const TickCount ticks = GetTicksForRead(); + const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(m_current_lba)) - ticks_late; + m_secondary_status.ClearActiveBits(); m_secondary_status.motor_on = true; ResetAudioDecoder(); - const TickCount ticks = GetTicksForRead(); - const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(m_current_lba)) - ticks_late; m_drive_state = DriveState::Reading; m_drive_event->SetInterval(ticks); m_drive_event->Schedule(first_sector_ticks); @@ -1541,14 +1543,15 @@ void CDROM::BeginPlaying(u8 track, TickCount ticks_late /* = 0 */, bool after_se return; } + const TickCount ticks = GetTicksForRead(); + const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(m_current_lba)) - ticks_late; + m_secondary_status.ClearActiveBits(); m_secondary_status.motor_on = true; m_secondary_status.playing_cdda = true; ClearSectorBuffers(); ResetAudioDecoder(); - const TickCount ticks = GetTicksForRead(); - const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(m_current_lba)) - ticks_late; m_drive_state = DriveState::Playing; m_drive_event->SetInterval(ticks); m_drive_event->Schedule(first_sector_ticks);