mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-28 19:25:41 -04:00
CDROM: Simulate position holding for GetlocL too
This commit is contained in:
parent
b1c230bd86
commit
b1776dea61
@ -777,7 +777,7 @@ TickCount CDROM::GetTicksForSeek(CDImage::LBA new_lba, bool ignore_speed_change)
|
|||||||
if (IsSeeking())
|
if (IsSeeking())
|
||||||
ticks += m_drive_event->GetTicksUntilNextExecution();
|
ticks += m_drive_event->GetTicksUntilNextExecution();
|
||||||
else
|
else
|
||||||
UpdatePhysicalPosition();
|
UpdatePhysicalPosition(false);
|
||||||
|
|
||||||
const TickCount tps = System::MASTER_CLOCK;
|
const TickCount tps = System::MASTER_CLOCK;
|
||||||
const CDImage::LBA current_lba = m_secondary_status.motor_on ? (IsSeeking() ? m_seek_end_lba : m_physical_lba) : 0;
|
const CDImage::LBA current_lba = m_secondary_status.motor_on ? (IsSeeking() ? m_seek_end_lba : m_physical_lba) : 0;
|
||||||
@ -1336,6 +1336,8 @@ void CDROM::ExecuteCommand(TickCount ticks_late)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
UpdatePhysicalPosition(true);
|
||||||
|
|
||||||
Log_DebugPrintf("CDROM GetlocL command - [%02X:%02X:%02X]", m_last_sector_header.minute,
|
Log_DebugPrintf("CDROM GetlocL command - [%02X:%02X:%02X]", m_last_sector_header.minute,
|
||||||
m_last_sector_header.second, m_last_sector_header.frame);
|
m_last_sector_header.second, m_last_sector_header.frame);
|
||||||
|
|
||||||
@ -1361,7 +1363,7 @@ void CDROM::ExecuteCommand(TickCount ticks_late)
|
|||||||
if (IsSeeking())
|
if (IsSeeking())
|
||||||
UpdatePositionWhileSeeking();
|
UpdatePositionWhileSeeking();
|
||||||
else
|
else
|
||||||
UpdatePhysicalPosition();
|
UpdatePhysicalPosition(false);
|
||||||
|
|
||||||
Log_DevPrintf("CDROM GetlocP command - T%02x I%02x R[%02x:%02x:%02x] A[%02x:%02x:%02x]",
|
Log_DevPrintf("CDROM GetlocP command - T%02x I%02x R[%02x:%02x:%02x] A[%02x:%02x:%02x]",
|
||||||
m_last_subq.track_number_bcd, m_last_subq.index_number_bcd, m_last_subq.relative_minute_bcd,
|
m_last_subq.track_number_bcd, m_last_subq.index_number_bcd, m_last_subq.relative_minute_bcd,
|
||||||
@ -1852,7 +1854,7 @@ void CDROM::UpdatePositionWhileSeeking()
|
|||||||
m_physical_lba_update_tick = TimingEvents::GetGlobalTickCounter();
|
m_physical_lba_update_tick = TimingEvents::GetGlobalTickCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDROM::UpdatePhysicalPosition()
|
void CDROM::UpdatePhysicalPosition(bool update_logical)
|
||||||
{
|
{
|
||||||
const u32 ticks = TimingEvents::GetGlobalTickCounter();
|
const u32 ticks = TimingEvents::GetGlobalTickCounter();
|
||||||
if (IsSeeking() || IsReadingOrPlaying() || !m_secondary_status.motor_on)
|
if (IsSeeking() || IsReadingOrPlaying() || !m_secondary_status.motor_on)
|
||||||
@ -1887,11 +1889,20 @@ void CDROM::UpdatePhysicalPosition()
|
|||||||
m_physical_lba = new_physical_lba;
|
m_physical_lba = new_physical_lba;
|
||||||
|
|
||||||
CDImage::SubChannelQ subq;
|
CDImage::SubChannelQ subq;
|
||||||
if (!m_reader.ReadSectorUncached(new_physical_lba, &subq, nullptr))
|
CDROMAsyncReader::SectorBuffer raw_sector;
|
||||||
|
if (!m_reader.ReadSectorUncached(new_physical_lba, &subq, update_logical ? &raw_sector : nullptr))
|
||||||
|
{
|
||||||
Log_ErrorPrintf("Failed to read subq for sector %u for physical position", new_physical_lba);
|
Log_ErrorPrintf("Failed to read subq for sector %u for physical position", new_physical_lba);
|
||||||
else if (subq.IsCRCValid())
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (subq.IsCRCValid())
|
||||||
m_last_subq = subq;
|
m_last_subq = subq;
|
||||||
|
|
||||||
|
if (update_logical)
|
||||||
|
ProcessDataSectorHeader(raw_sector.data());
|
||||||
|
}
|
||||||
|
|
||||||
m_physical_lba_update_tick = ticks;
|
m_physical_lba_update_tick = ticks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ private:
|
|||||||
void StopMotor();
|
void StopMotor();
|
||||||
void BeginSeeking(bool logical, bool read_after_seek, bool play_after_seek);
|
void BeginSeeking(bool logical, bool read_after_seek, bool play_after_seek);
|
||||||
void UpdatePositionWhileSeeking();
|
void UpdatePositionWhileSeeking();
|
||||||
void UpdatePhysicalPosition();
|
void UpdatePhysicalPosition(bool update_logical);
|
||||||
void SetHoldPosition(CDImage::LBA lba, bool update_subq);
|
void SetHoldPosition(CDImage::LBA lba, bool update_subq);
|
||||||
void ResetCurrentXAFile();
|
void ResetCurrentXAFile();
|
||||||
void ResetAudioDecoder();
|
void ResetAudioDecoder();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user