Qt: Add block dump options

This commit is contained in:
Connor McLaughlin authored and refractionpcsx2 committed 2022-05-25 10:15:48 +01:00
1 parent 0bab9474ae
commit 08aad5461e
4 files changed
+38 -2

No files matched your search

+25
View File
@@ -219,6 +219,8 @@ void MainWindow::connectSignals()
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.actionEnableFileLogging, "Logging", "EnableFileLogging", false);
connect(m_ui.actionEnableFileLogging, &QAction::triggered, this, &MainWindow::onLoggingOptionChanged);
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.actionEnableCDVDVerboseReads, "EmuCore", "CdvdVerboseReads", false);
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.actionSaveBlockDump, "EmuCore", "CdvdDumpBlocks", false);
connect(m_ui.actionSaveBlockDump, &QAction::toggled, this, &MainWindow::onBlockDumpActionToggled);
connect(m_ui.actionSaveGSDump, &QAction::triggered, this, &MainWindow::onSaveGSDumpActionTriggered);
@@ -541,6 +543,29 @@ void MainWindow::onSaveGSDumpActionTriggered()
g_emu_thread->queueSnapshot(1);
}
void MainWindow::onBlockDumpActionToggled(bool checked)
{
if (!checked)
return;
std::string old_directory(Host::GetBaseStringSettingValue("EmuCore", "BlockDumpSaveDirectory", ""));
if (old_directory.empty())
old_directory = FileSystem::GetWorkingDirectory();
// prompt for a location to save
const QString new_dir(
QFileDialog::getExistingDirectory(this, tr("Select location to save block dump:"),
QString::fromStdString(old_directory)));
if (new_dir.isEmpty())
{
// disable it again
m_ui.actionSaveBlockDump->setChecked(false);
return;
}
QtHost::SetBaseStringSettingValue("EmuCore", "BlockDumpSaveDirectory", new_dir.toUtf8().constData());
}
void MainWindow::saveStateToConfig()
{
{
+1
View File
@@ -136,6 +136,7 @@ private Q_SLOTS:
void onLoggingOptionChanged();
void onScreenshotActionTriggered();
void onSaveGSDumpActionTriggered();
void onBlockDumpActionToggled(bool checked);
// Input Recording
void onInputRecNewActionTriggered();
+10
View File
@@ -128,6 +128,8 @@
<addaction name="separator"/>
<addaction name="menuDebugSwitchRenderer"/>
<addaction name="actionToggleSoftwareRendering"/>
<addaction name="separator"/>
<addaction name="actionSaveBlockDump"/>
<addaction name="actionSaveGSDump"/>
<addaction name="separator"/>
<addaction name="actionReloadPatches"/>
@@ -798,6 +800,14 @@
<string>Enable CDVD Read Logging</string>
</property>
</action>
<action name="actionSaveBlockDump">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Save CDVD Block Dump</string>
</property>
</action>
</widget>
<resources>
<include location="resources/resources.qrc"/>
+2 -2
View File
@@ -1080,12 +1080,12 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
// For now, this in the derived config for backwards ini compatibility.
#ifdef PCSX2_CORE
SettingsWrapEntryEx(CurrentBlockdump, "BlockDumpSaveDirectory");
BaseFilenames.LoadSave(wrap);
Framerate.LoadSave(wrap);
LoadSaveMemcards(wrap);
SettingsWrapEntry(GzipIsoIndexTemplate);
#ifdef __WXMSW__
SettingsWrapEntry(McdCompressNTFS);
#endif