CDROM: Store filename, reduce ack cycles

This commit is contained in:
Connor McLaughlin 2019-10-18 22:04:25 +10:00
parent 513bbe44f3
commit 246b17454e
3 changed files with 6 additions and 3 deletions

View File

@ -24,6 +24,7 @@ CDImageBin::~CDImageBin()
bool CDImageBin::Open(const char* filename)
{
m_filename = filename;
m_fp = std::fopen(filename, "rb");
if (!m_fp)
{

View File

@ -63,6 +63,7 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
// get the directory of the filename
std::string basepath = GetPathDirectory(filename);
m_filename = filename;
u32 disc_lba = 0;

View File

@ -421,7 +421,7 @@ void CDROM::UpdateStatusRegister()
u32 CDROM::GetAckDelayForCommand() const
{
const u32 default_ack_delay = 20000;
const u32 default_ack_delay = 2000;
if (m_command == Command::Init)
return 60000;
else
@ -1056,9 +1056,10 @@ void CDROM::DrawDebugWindow()
const auto [track_minute, track_second, track_frame] = m_media->GetMSFPositionInTrack();
ImGui::Text("Filename: %s", m_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_minute, disc_second, disc_frame,
m_media->GetPositionOnDisc());
ImGui::Text("Track Position: Number[%u] MSF[%02u:%02u:%02u] LBA[%u]", m_media->GetTrackNumber(), track_minute,
track_second, track_frame);
track_second, track_frame, m_media->GetPositionInTrack());
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);
}