mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-20 07:15:38 +00:00
CDROM: Drop setloc on double Play
And limit the locations position is updated while seeking. Fixes menu music in Hot Wheels: Extreme Racing.
This commit is contained in:
parent
bc30569a6d
commit
fb747d6ded
|
@ -555,6 +555,11 @@ void CDROM::SoftReset(TickCount ticks_late)
|
||||||
|
|
||||||
if (HasMedia())
|
if (HasMedia())
|
||||||
{
|
{
|
||||||
|
if (IsSeeking())
|
||||||
|
UpdatePositionWhileSeeking();
|
||||||
|
else
|
||||||
|
UpdatePhysicalPosition(false);
|
||||||
|
|
||||||
const TickCount speed_change_ticks = was_double_speed ? GetTicksForSpeedChange() : 0;
|
const TickCount speed_change_ticks = was_double_speed ? GetTicksForSpeedChange() : 0;
|
||||||
const TickCount seek_ticks = (s_current_lba != 0) ? GetTicksForSeek(0) : 0;
|
const TickCount seek_ticks = (s_current_lba != 0) ? GetTicksForSeek(0) : 0;
|
||||||
const TickCount total_ticks = std::max<TickCount>(speed_change_ticks + seek_ticks, INIT_TICKS) - ticks_late;
|
const TickCount total_ticks = std::max<TickCount>(speed_change_ticks + seek_ticks, INIT_TICKS) - ticks_late;
|
||||||
|
@ -1339,8 +1344,10 @@ TickCount CDROM::GetTicksForSeek(CDImage::LBA new_lba, bool ignore_speed_change)
|
||||||
return MIN_TICKS;
|
return MIN_TICKS;
|
||||||
|
|
||||||
u32 ticks = static_cast<u32>(MIN_TICKS);
|
u32 ticks = static_cast<u32>(MIN_TICKS);
|
||||||
|
|
||||||
|
// Update start position for seek.
|
||||||
if (IsSeeking())
|
if (IsSeeking())
|
||||||
ticks += s_drive_event->GetTicksUntilNextExecution();
|
UpdatePositionWhileSeeking();
|
||||||
else
|
else
|
||||||
UpdatePhysicalPosition(false);
|
UpdatePhysicalPosition(false);
|
||||||
|
|
||||||
|
@ -1674,9 +1681,6 @@ void CDROM::ExecuteCommand(void*, TickCount ticks, TickCount ticks_late)
|
||||||
const bool logical = (s_command == Command::SeekL);
|
const bool logical = (s_command == Command::SeekL);
|
||||||
DEBUG_LOG("CDROM {} command", logical ? "SeekL" : "SeekP");
|
DEBUG_LOG("CDROM {} command", logical ? "SeekL" : "SeekP");
|
||||||
|
|
||||||
if (IsSeeking())
|
|
||||||
UpdatePositionWhileSeeking();
|
|
||||||
|
|
||||||
if (!CanReadMedia())
|
if (!CanReadMedia())
|
||||||
{
|
{
|
||||||
SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY);
|
SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY);
|
||||||
|
@ -1743,9 +1747,6 @@ void CDROM::ExecuteCommand(void*, TickCount ticks, TickCount ticks_late)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsSeeking())
|
|
||||||
UpdatePositionWhileSeeking();
|
|
||||||
|
|
||||||
BeginReading();
|
BeginReading();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1772,12 +1773,10 @@ void CDROM::ExecuteCommand(void*, TickCount ticks, TickCount ticks_late)
|
||||||
{
|
{
|
||||||
DEV_LOG("Ignoring play command with no/same setloc, already playing/playing after seek");
|
DEV_LOG("Ignoring play command with no/same setloc, already playing/playing after seek");
|
||||||
s_fast_forward_rate = 0;
|
s_fast_forward_rate = 0;
|
||||||
|
s_setloc_pending = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsSeeking())
|
|
||||||
UpdatePositionWhileSeeking();
|
|
||||||
|
|
||||||
BeginPlaying(track);
|
BeginPlaying(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1889,9 +1888,6 @@ void CDROM::ExecuteCommand(void*, TickCount ticks, TickCount ticks_late)
|
||||||
|
|
||||||
SendACKAndStat();
|
SendACKAndStat();
|
||||||
|
|
||||||
if (IsSeeking())
|
|
||||||
UpdatePositionWhileSeeking();
|
|
||||||
|
|
||||||
SoftReset(ticks_late);
|
SoftReset(ticks_late);
|
||||||
|
|
||||||
QueueCommandSecondResponse(Command::Init, INIT_TICKS);
|
QueueCommandSecondResponse(Command::Init, INIT_TICKS);
|
||||||
|
|
Loading…
Reference in a new issue