diff --git a/src/common/cd_image.h b/src/common/cd_image.h index fa7e8ef5c..13e384937 100644 --- a/src/common/cd_image.h +++ b/src/common/cd_image.h @@ -173,6 +173,8 @@ public: u32 GetTrackCount() const { return static_cast(m_tracks.size()); } LBA GetTrackStartPosition(u8 track) const; Position GetTrackStartMSFPosition(u8 track) const; + u32 GetFirstTrackNumber() const { return m_tracks.front().track_number; } + u32 GetLastTrackNumber() const { return m_tracks.back().track_number; } // Seek to data LBA. bool Seek(LBA lba); diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index a7c67a58a..b572cf295 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -881,8 +881,8 @@ void CDROM::ExecuteCommand() m_reader.WaitForReadToComplete(); m_response_fifo.Push(m_secondary_status.bits); - m_response_fifo.Push(BinaryToBCD(Truncate8(m_reader.GetMedia()->GetTrackNumber()))); - m_response_fifo.Push(BinaryToBCD(Truncate8(m_reader.GetMedia()->GetTrackCount()))); + m_response_fifo.Push(BinaryToBCD(Truncate8(m_reader.GetMedia()->GetFirstTrackNumber()))); + m_response_fifo.Push(BinaryToBCD(Truncate8(m_reader.GetMedia()->GetLastTrackNumber()))); SetInterrupt(Interrupt::ACK); } else @@ -1396,8 +1396,8 @@ void CDROM::DoSectorRead() if (m_play_track_number_bcd == 0) { // track number was not specified, but we've found the track now - Log_DebugPrintf("Setting playing track number to %u", m_play_track_number_bcd); m_play_track_number_bcd = subq.track_number_bcd; + Log_DebugPrintf("Setting playing track number to %u", m_play_track_number_bcd); } else if (m_mode.auto_pause && subq.track_number_bcd != m_play_track_number_bcd) {