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.
This commit is contained in:
Connor McLaughlin 2020-04-11 02:44:04 +10:00
parent 6d55979dac
commit a4a112f5d8
1 changed files with 20 additions and 20 deletions

View File

@ -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++;