From 7290576a2aac1925b00aef729a79a662166a8410 Mon Sep 17 00:00:00 2001 From: Akash Date: Sun, 30 Jun 2019 11:48:12 +0530 Subject: [PATCH] CDVD: Add configurable directory for blockdumps storage Previously the blockdumps will be automatically stored in the root directory of PCSX2, added an INI option in "PCSX2_ui.ini" named "CurrentBlockdump" to modify the directory to whatever is preferred by the user. (Some people were requesting for this) A GUI could also be added if anyone wants, but considering the popularity of this I'm not sure as blockdumps will only be used my less percentile of users and mostly by testers and developers for debugging. --- pcsx2/CDVD/CDVDaccess.cpp | 7 ++++--- pcsx2/gui/AppConfig.cpp | 1 + pcsx2/gui/AppConfig.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pcsx2/CDVD/CDVDaccess.cpp b/pcsx2/CDVD/CDVDaccess.cpp index 128fd61081..517449d6df 100644 --- a/pcsx2/CDVD/CDVDaccess.cpp +++ b/pcsx2/CDVD/CDVDaccess.cpp @@ -370,8 +370,6 @@ bool DoCDVDopen() return true; } - // TODO: Add a blockdumps configurable folder, and use that instead of CWD(). - // TODO: "Untitled" should use pnach/slus name resolution, slus if no patch, // and finally an "Untitled-[ElfCRC]" if no slus. @@ -379,7 +377,10 @@ bool DoCDVDopen() if( somepick.IsEmpty() ) somepick = L"Untitled"; - wxString temp( Path::Combine( wxGetCwd(), somepick ) ); + if (g_Conf->CurrentBlockdump.IsEmpty()) + g_Conf->CurrentBlockdump = wxGetCwd(); + + wxString temp(Path::Combine(g_Conf->CurrentBlockdump, somepick)); #ifdef ENABLE_TIMESTAMPS wxDateTime curtime( wxDateTime::GetTimeNow() ); diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 85a358ca05..1d227ce811 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -640,6 +640,7 @@ void AppConfig::LoadSaveRootItems( IniInterface& ini ) ini.Entry( L"CurrentIso", res, res, ini.IsLoading() || IsPortable() ); CurrentIso = res.GetFullPath(); + IniEntry( CurrentBlockdump ); IniEntry( CurrentELF ); IniEntry( CurrentIRX ); diff --git a/pcsx2/gui/AppConfig.h b/pcsx2/gui/AppConfig.h index 966d7bb63d..8cf97f05f7 100644 --- a/pcsx2/gui/AppConfig.h +++ b/pcsx2/gui/AppConfig.h @@ -323,6 +323,7 @@ public: bool AskOnBoot; wxString CurrentIso; + wxString CurrentBlockdump; wxString CurrentELF; wxString CurrentIRX; CDVD_SourceType CdvdSource;