mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
CDROM: Fix incorrect sector read after incomplete seek->read
Fixes crash in Disney's The Lion King - Simba's Mighty Adventure.
This commit is contained in:
parent
b8a2487abf
commit
737337a526
|
@ -1507,7 +1507,6 @@ void CDROM::ExecuteDrive(TickCount ticks_late)
|
||||||
|
|
||||||
void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = false */)
|
void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = false */)
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("Starting reading @ LBA %u", m_current_lba);
|
|
||||||
ClearSectorBuffers();
|
ClearSectorBuffers();
|
||||||
|
|
||||||
if (!after_seek && m_setloc_pending)
|
if (!after_seek && m_setloc_pending)
|
||||||
|
@ -1516,6 +1515,18 @@ void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = fa
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we were seeking, we want to start reading from the seek target, not the current sector
|
||||||
|
// Fixes crash in Disney's The Lion King - Simba's Mighty Adventure.
|
||||||
|
if (IsSeeking())
|
||||||
|
{
|
||||||
|
Log_DevPrintf("Read command while seeking, scheduling read after seek %u -> %u finishes in %d ticks",
|
||||||
|
m_seek_start_lba, m_seek_end_lba, m_drive_event->GetTicksUntilNextExecution());
|
||||||
|
m_read_after_seek = true;
|
||||||
|
m_play_after_seek = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log_DebugPrintf("Starting reading @ LBA %u", m_current_lba);
|
||||||
m_secondary_status.ClearActiveBits();
|
m_secondary_status.ClearActiveBits();
|
||||||
m_secondary_status.motor_on = true;
|
m_secondary_status.motor_on = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue