Qt: Add dump VRAM and SPU RAM actions

This commit is contained in:
Connor McLaughlin
2021-01-13 19:24:41 +10:00
parent 5746dcdbd4
commit 2b5cfb272c
9 changed files with 131 additions and 12 deletions

View File

@ -1292,9 +1292,6 @@ void QtHostInterface::dumpRAM(const QString& filename)
return;
}
if (System::IsShutdown())
return;
const std::string filename_str = filename.toStdString();
if (System::DumpRAM(filename_str.c_str()))
ReportFormattedMessage("RAM dumped to '%s'", filename_str.c_str());
@ -1302,6 +1299,36 @@ void QtHostInterface::dumpRAM(const QString& filename)
ReportFormattedMessage("Failed to dump RAM to '%s'", filename_str.c_str());
}
void QtHostInterface::dumpVRAM(const QString& filename)
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "dumpVRAM", Qt::QueuedConnection, Q_ARG(const QString&, filename));
return;
}
const std::string filename_str = filename.toStdString();
if (System::DumpVRAM(filename_str.c_str()))
ReportFormattedMessage("VRAM dumped to '%s'", filename_str.c_str());
else
ReportFormattedMessage("Failed to dump VRAM to '%s'", filename_str.c_str());
}
void QtHostInterface::dumpSPURAM(const QString& filename)
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "dumpSPURAM", Qt::QueuedConnection, Q_ARG(const QString&, filename));
return;
}
const std::string filename_str = filename.toStdString();
if (System::DumpSPURAM(filename_str.c_str()))
ReportFormattedMessage("SPU RAM dumped to '%s'", filename_str.c_str());
else
ReportFormattedMessage("Failed to dump SPU RAM to '%s'", filename_str.c_str());
}
void QtHostInterface::saveScreenshot()
{
if (!isOnWorkerThread())