CDROM: Display paused position in debug window

This commit is contained in:
Connor McLaughlin 2020-07-13 02:23:56 +10:00
parent d2cf9c44c1
commit dbce58e07d

View file

@ -2337,14 +2337,15 @@ void CDROM::DrawDebugWindow()
if (m_reader.HasMedia()) if (m_reader.HasMedia())
{ {
const CDImage* media = m_reader.GetMedia(); const CDImage* media = m_reader.GetMedia();
const auto [disc_minute, disc_second, disc_frame] = media->GetMSFPositionOnDisc(); const CDImage::Position disc_position = CDImage::Position::FromLBA(m_current_lba);
const auto [track_minute, track_second, track_frame] = media->GetMSFPositionInTrack(); const CDImage::Position track_position = CDImage::Position::FromLBA(
m_current_lba - media->GetTrackStartPosition(static_cast<u8>(media->GetTrackNumber())));
ImGui::Text("Filename: %s", media->GetFileName().c_str()); ImGui::Text("Filename: %s", media->GetFileName().c_str());
ImGui::Text("Disc Position: MSF[%02u:%02u:%02u] LBA[%u]", disc_minute, disc_second, disc_frame, ImGui::Text("Disc Position: MSF[%02u:%02u:%02u] LBA[%u]", disc_position.minute, disc_position.second,
media->GetPositionOnDisc()); disc_position.frame, disc_position.ToLBA());
ImGui::Text("Track Position: Number[%u] MSF[%02u:%02u:%02u] LBA[%u]", media->GetTrackNumber(), track_minute, ImGui::Text("Track Position: Number[%u] MSF[%02u:%02u:%02u] LBA[%u]", media->GetTrackNumber(),
track_second, track_frame, media->GetPositionInTrack()); track_position.minute, track_position.second, track_position.frame, track_position.ToLBA());
ImGui::Text("Last Sector: %02X:%02X:%02X (Mode %u)", m_last_sector_header.minute, m_last_sector_header.second, ImGui::Text("Last Sector: %02X:%02X:%02X (Mode %u)", m_last_sector_header.minute, m_last_sector_header.second,
m_last_sector_header.frame, m_last_sector_header.sector_mode); m_last_sector_header.frame, m_last_sector_header.sector_mode);
} }