diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 56f790294..3cb025446 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -2337,14 +2337,15 @@ void CDROM::DrawDebugWindow() if (m_reader.HasMedia()) { const CDImage* media = m_reader.GetMedia(); - const auto [disc_minute, disc_second, disc_frame] = media->GetMSFPositionOnDisc(); - const auto [track_minute, track_second, track_frame] = media->GetMSFPositionInTrack(); + const CDImage::Position disc_position = CDImage::Position::FromLBA(m_current_lba); + const CDImage::Position track_position = CDImage::Position::FromLBA( + m_current_lba - media->GetTrackStartPosition(static_cast(media->GetTrackNumber()))); ImGui::Text("Filename: %s", media->GetFileName().c_str()); - ImGui::Text("Disc Position: MSF[%02u:%02u:%02u] LBA[%u]", disc_minute, disc_second, disc_frame, - media->GetPositionOnDisc()); - ImGui::Text("Track Position: Number[%u] MSF[%02u:%02u:%02u] LBA[%u]", media->GetTrackNumber(), track_minute, - track_second, track_frame, media->GetPositionInTrack()); + ImGui::Text("Disc Position: MSF[%02u:%02u:%02u] LBA[%u]", disc_position.minute, disc_position.second, + disc_position.frame, disc_position.ToLBA()); + ImGui::Text("Track Position: Number[%u] MSF[%02u:%02u:%02u] LBA[%u]", media->GetTrackNumber(), + 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, m_last_sector_header.frame, m_last_sector_header.sector_mode); }