CDROM: Track seek position when resetting

Fixes Blasto hanging after starting game.
This commit is contained in:
Connor McLaughlin 2020-07-11 20:34:16 +10:00
parent d1a2ebd8f3
commit 50a25b63b1
2 changed files with 7 additions and 2 deletions

View File

@ -1184,7 +1184,9 @@ void CDROM::ExecuteCommand()
UpdatePositionWhileSeeking(); UpdatePositionWhileSeeking();
m_drive_state = DriveState::Resetting; m_drive_state = DriveState::Resetting;
m_drive_event->Schedule(400000 + GetTicksForSeek(0)); m_drive_event->SetIntervalAndSchedule(BASE_RESET_TICKS + GetTicksForSeek(0));
m_seek_start_lba = m_current_lba;
m_seek_end_lba = 0;
EndCommand(); EndCommand();
return; return;

View File

@ -59,6 +59,8 @@ private:
RESPONSE_FIFO_SIZE = 16, RESPONSE_FIFO_SIZE = 16,
DATA_FIFO_SIZE = RAW_SECTOR_OUTPUT_SIZE, DATA_FIFO_SIZE = RAW_SECTOR_OUTPUT_SIZE,
NUM_SECTOR_BUFFERS = 8, NUM_SECTOR_BUFFERS = 8,
BASE_RESET_TICKS = 400000,
}; };
static constexpr u8 INTERRUPT_REGISTER_MASK = 0x1F; static constexpr u8 INTERRUPT_REGISTER_MASK = 0x1F;
@ -200,7 +202,8 @@ private:
bool IsDriveIdle() const { return m_drive_state == DriveState::Idle; } bool IsDriveIdle() const { return m_drive_state == DriveState::Idle; }
bool IsSeeking() const bool IsSeeking() const
{ {
return (m_drive_state == DriveState::SeekingLogical || m_drive_state == DriveState::SeekingPhysical); return (m_drive_state == DriveState::SeekingLogical || m_drive_state == DriveState::SeekingPhysical ||
m_drive_state == DriveState::Resetting);
} }
bool IsReadingOrPlaying() const bool IsReadingOrPlaying() const
{ {