|
|
|
@ -853,6 +853,15 @@ TickCount CDROM::GetTicksForStop(bool motor_was_on)
|
|
|
|
|
return motor_was_on ? (m_mode.double_speed ? 25000000 : 13000000) : 7000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CDImage::LBA CDROM::GetNextSectorToBeRead()
|
|
|
|
|
{
|
|
|
|
|
if (!IsReadingOrPlaying())
|
|
|
|
|
return m_current_lba;
|
|
|
|
|
|
|
|
|
|
m_reader.WaitForReadToComplete();
|
|
|
|
|
return m_reader.GetLastReadSector();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDROM::BeginCommand(Command command)
|
|
|
|
|
{
|
|
|
|
|
TickCount ack_delay = GetAckDelayForCommand(command);
|
|
|
|
@ -1077,7 +1086,7 @@ void CDROM::ExecuteCommand()
|
|
|
|
|
{
|
|
|
|
|
SendACKAndStat();
|
|
|
|
|
|
|
|
|
|
if ((!m_setloc_pending || m_setloc_position.ToLBA() == m_current_lba) &&
|
|
|
|
|
if ((!m_setloc_pending || m_setloc_position.ToLBA() == GetNextSectorToBeRead()) &&
|
|
|
|
|
(m_drive_state == DriveState::Reading || (IsSeeking() && m_read_after_seek)))
|
|
|
|
|
{
|
|
|
|
|
Log_DevPrintf("Ignoring read command with no/same setloc, already reading/reading after seek");
|
|
|
|
@ -1108,7 +1117,7 @@ void CDROM::ExecuteCommand()
|
|
|
|
|
{
|
|
|
|
|
SendACKAndStat();
|
|
|
|
|
|
|
|
|
|
if (track == 0 && (!m_setloc_pending || m_setloc_position.ToLBA() == m_current_lba) &&
|
|
|
|
|
if (track == 0 && (!m_setloc_pending || m_setloc_position.ToLBA() == GetNextSectorToBeRead()) &&
|
|
|
|
|
(m_drive_state == DriveState::Playing || (IsSeeking() && m_play_after_seek)))
|
|
|
|
|
{
|
|
|
|
|
Log_DevPrintf("Ignoring play command with no/same setloc, already playing/playing after seek");
|
|
|
|
@ -1924,8 +1933,7 @@ void CDROM::DoSectorRead()
|
|
|
|
|
is_data_sector ? "data" : "audio", is_data_sector ? "reading" : "playing");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_current_lba++;
|
|
|
|
|
m_reader.QueueReadSector(m_current_lba);
|
|
|
|
|
m_reader.QueueReadSector(m_current_lba + 1u);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDROM::ProcessDataSectorHeader(const u8* raw_sector)
|
|
|
|
|