From a4a112f5d8d2d48ef695db747df4026c27a8e79f Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 11 Apr 2020 02:44:04 +1000 Subject: [PATCH] CDROM: Deliver invalid sub-q (libcrypted) sectors to CPU Nocash documentation would suggest that it only needs the sector to be skipped by GetLocP. Which would make sense as the non-subchannel data is still completely valid. --- src/core/cdrom.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index f79a207b7..74b2185c7 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1487,30 +1487,30 @@ void CDROM::DoSectorRead() if (subq.IsCRCValid()) { m_last_subq = subq; - - if (is_data_sector && m_drive_state == DriveState::Reading) - { - ProcessDataSector(m_reader.GetSectorBuffer().data(), subq); - } - else if (!is_data_sector && m_drive_state == DriveState::Playing) - { - ProcessCDDASector(m_reader.GetSectorBuffer().data(), subq); - } - else if (m_drive_state != DriveState::Reading && m_drive_state != DriveState::Playing) - { - Panic("Not reading or playing"); - } - else - { - Log_WarningPrintf("Skipping sector %u as it is a %s sector and we're not %s", m_reader.GetLastReadSector(), - is_data_sector ? "data" : "audio", is_data_sector ? "reading" : "playing"); - } } else { const CDImage::Position pos(CDImage::Position::FromLBA(m_reader.GetLastReadSector())); - Log_DevPrintf("Skipping sector %u [%02u:%02u:%02u] due to invalid subchannel Q", m_reader.GetLastReadSector(), - pos.minute, pos.second, pos.frame); + Log_DevPrintf("Sector %u [%02u:%02u:%02u] has invalid subchannel Q", m_reader.GetLastReadSector(), pos.minute, + pos.second, pos.frame); + } + + if (is_data_sector && m_drive_state == DriveState::Reading) + { + ProcessDataSector(m_reader.GetSectorBuffer().data(), subq); + } + else if (!is_data_sector && m_drive_state == DriveState::Playing) + { + ProcessCDDASector(m_reader.GetSectorBuffer().data(), subq); + } + else if (m_drive_state != DriveState::Reading && m_drive_state != DriveState::Playing) + { + Panic("Not reading or playing"); + } + else + { + Log_WarningPrintf("Skipping sector %u as it is a %s sector and we're not %s", m_reader.GetLastReadSector(), + is_data_sector ? "data" : "audio", is_data_sector ? "reading" : "playing"); } m_last_requested_sector++;