mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-26 23:35:41 -04:00
CDROM: Clear async interrupt on read/seek start
Fixes broken audio in Road Rash.
This commit is contained in:
parent
f1465ddf43
commit
25bf2b3adc
@ -791,8 +791,7 @@ std::unique_ptr<CDImage> CDROM::RemoveMedia(bool for_disc_swap)
|
|||||||
s_command_event->Deactivate();
|
s_command_event->Deactivate();
|
||||||
|
|
||||||
// The console sends an interrupt when the shell is opened regardless of whether a command was executing.
|
// The console sends an interrupt when the shell is opened regardless of whether a command was executing.
|
||||||
if (HasPendingAsyncInterrupt())
|
ClearAsyncInterrupt();
|
||||||
ClearAsyncInterrupt();
|
|
||||||
SendAsyncErrorResponse(STAT_ERROR, 0x08);
|
SendAsyncErrorResponse(STAT_ERROR, 0x08);
|
||||||
|
|
||||||
// Begin spin-down timer, we can't swap the new disc in immediately for some games (e.g. Metal Gear Solid).
|
// Begin spin-down timer, we can't swap the new disc in immediately for some games (e.g. Metal Gear Solid).
|
||||||
@ -2301,8 +2300,6 @@ void CDROM::ClearDriveState()
|
|||||||
|
|
||||||
void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = false */)
|
void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = false */)
|
||||||
{
|
{
|
||||||
ClearSectorBuffers();
|
|
||||||
|
|
||||||
if (!after_seek && s_setloc_pending)
|
if (!after_seek && s_setloc_pending)
|
||||||
{
|
{
|
||||||
BeginSeeking(true, true, false);
|
BeginSeeking(true, true, false);
|
||||||
@ -2331,6 +2328,8 @@ void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = fa
|
|||||||
const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(s_current_lba)) - ticks_late;
|
const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(s_current_lba)) - ticks_late;
|
||||||
|
|
||||||
ClearCommandSecondResponse();
|
ClearCommandSecondResponse();
|
||||||
|
ClearAsyncInterrupt();
|
||||||
|
ClearSectorBuffers();
|
||||||
ResetAudioDecoder();
|
ResetAudioDecoder();
|
||||||
|
|
||||||
s_drive_state = DriveState::Reading;
|
s_drive_state = DriveState::Reading;
|
||||||
@ -2374,6 +2373,7 @@ void CDROM::BeginPlaying(u8 track, TickCount ticks_late /* = 0 */, bool after_se
|
|||||||
const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(s_current_lba, true)) - ticks_late;
|
const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(s_current_lba, true)) - ticks_late;
|
||||||
|
|
||||||
ClearCommandSecondResponse();
|
ClearCommandSecondResponse();
|
||||||
|
ClearAsyncInterrupt();
|
||||||
ClearSectorBuffers();
|
ClearSectorBuffers();
|
||||||
ResetAudioDecoder();
|
ResetAudioDecoder();
|
||||||
|
|
||||||
@ -2405,6 +2405,8 @@ void CDROM::BeginSeeking(bool logical, bool read_after_seek, bool play_after_see
|
|||||||
const TickCount seek_time = GetTicksForSeek(seek_lba, play_after_seek);
|
const TickCount seek_time = GetTicksForSeek(seek_lba, play_after_seek);
|
||||||
|
|
||||||
ClearCommandSecondResponse();
|
ClearCommandSecondResponse();
|
||||||
|
ClearAsyncInterrupt();
|
||||||
|
ClearSectorBuffers();
|
||||||
ResetAudioDecoder();
|
ResetAudioDecoder();
|
||||||
|
|
||||||
s_secondary_status.SetSeeking();
|
s_secondary_status.SetSeeking();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user