From a36d5a0221cccd6719fb6d17cd4954a998338dda Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 1 Jul 2019 11:29:35 +0530 Subject: [PATCH] CDVD: Add fallback path for blockdump source name unavailability 2 pass fallback cases for the untitled scenario was mentioned in the TODO comment to be completed, added one of them. (Still doesn't seem reliable enough, but honestly when do we Also modified blank space indentation at a part to tab space to satisfy lightning boi. --- pcsx2/CDVD/CDVDaccess.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pcsx2/CDVD/CDVDaccess.cpp b/pcsx2/CDVD/CDVDaccess.cpp index 517449d6df..ee76440a56 100644 --- a/pcsx2/CDVD/CDVDaccess.cpp +++ b/pcsx2/CDVD/CDVDaccess.cpp @@ -370,15 +370,17 @@ bool DoCDVDopen() return true; } - // TODO: "Untitled" should use pnach/slus name resolution, slus if no patch, - // and finally an "Untitled-[ElfCRC]" if no slus. - - wxString somepick( Path::GetFilenameWithoutExt( m_SourceFilename[CurrentSourceType] ) ); - if( somepick.IsEmpty() ) + wxString somepick( Path::GetFilenameWithoutExt( m_SourceFilename[CurrentSourceType] ) ); + //FWIW Disc serial availability doesn't seem reliable enough, sometimes it's there and sometime it's just null + //Shouldn't the serial be available all time? Potentially need to look into Elfreloadinfo() reliability + //TODO: Add extra fallback case for CRC. + if (somepick.IsEmpty() && !DiscSerial.IsEmpty()) + somepick = L"Untitled-" + DiscSerial; + else if (somepick.IsEmpty()) somepick = L"Untitled"; if (g_Conf->CurrentBlockdump.IsEmpty()) - g_Conf->CurrentBlockdump = wxGetCwd(); + g_Conf->CurrentBlockdump = wxGetCwd(); wxString temp(Path::Combine(g_Conf->CurrentBlockdump, somepick));