From 1947080d911aadf422d3fba4144e1a5abb44e4f8 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 1 Jun 2020 21:40:26 +1000 Subject: [PATCH] CDROM: GetlocL should return an error while seeking Or more specifically, the coarse seek part. Verified with hardware tests. --- 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 a1a2ebce1..e33ae82a2 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1211,15 +1211,16 @@ void CDROM::ExecuteCommand() case Command::GetlocL: { - Log_DebugPrintf("CDROM GetlocL command - header %s [%02X:%02X:%02X]", - m_last_sector_header_valid ? "valid" : "invalid", m_last_sector_header.minute, - m_last_sector_header.second, m_last_sector_header.frame); if (!m_last_sector_header_valid) { - SendErrorResponse(STAT_ERROR, 0x80); + Log_DevPrintf("CDROM GetlocL command - header invalid, status 0x%02X", m_secondary_status.bits); + SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY); } else { + Log_DebugPrintf("CDROM GetlocL command - [%02X:%02X:%02X]", m_last_sector_header.minute, + m_last_sector_header.second, m_last_sector_header.frame); + m_response_fifo.PushRange(reinterpret_cast(&m_last_sector_header), sizeof(m_last_sector_header)); m_response_fifo.PushRange(reinterpret_cast(&m_last_sector_subheader), sizeof(m_last_sector_subheader)); @@ -1577,6 +1578,7 @@ void CDROM::BeginSeeking(bool logical, bool read_after_seek, bool play_after_see m_secondary_status.ClearActiveBits(); m_secondary_status.motor_on = true; m_secondary_status.seeking = true; + m_last_sector_header_valid = false; m_drive_state = logical ? DriveState::SeekingLogical : DriveState::SeekingPhysical; m_drive_event->SetIntervalAndSchedule(seek_time);