mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 08:25:47 -04:00
Qt: Add dump VRAM and SPU RAM actions
This commit is contained in:
@ -821,6 +821,9 @@ void MainWindow::updateEmulationActions(bool starting, bool running)
|
||||
m_ui.menuCheats->setDisabled(starting || !running);
|
||||
m_ui.actionCheatManager->setDisabled(starting || !running);
|
||||
m_ui.actionCPUDebugger->setDisabled(starting || !running);
|
||||
m_ui.actionDumpRAM->setDisabled(starting || !running);
|
||||
m_ui.actionDumpVRAM->setDisabled(starting || !running);
|
||||
m_ui.actionDumpSPURAM->setDisabled(starting || !running);
|
||||
|
||||
m_ui.actionSaveState->setDisabled(starting || !running);
|
||||
m_ui.menuSaveState->setDisabled(starting || !running);
|
||||
@ -1041,12 +1044,29 @@ void MainWindow::connectSignals()
|
||||
m_host_interface->stopDumpingAudio();
|
||||
});
|
||||
connect(m_ui.actionDumpRAM, &QAction::triggered, [this]() {
|
||||
const QString filename = QFileDialog::getSaveFileName(this, tr("Destination File"));
|
||||
const QString filename =
|
||||
QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), tr("Binary Files (*.bin)"));
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
m_host_interface->dumpRAM(filename);
|
||||
});
|
||||
connect(m_ui.actionDumpVRAM, &QAction::triggered, [this]() {
|
||||
const QString filename = QFileDialog::getSaveFileName(this, tr("Destination File"), QString(),
|
||||
tr("Binary Files (*.bin);;PNG Images (*.png)"));
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
m_host_interface->dumpVRAM(filename);
|
||||
});
|
||||
connect(m_ui.actionDumpSPURAM, &QAction::triggered, [this]() {
|
||||
const QString filename =
|
||||
QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), tr("Binary Files (*.bin)"));
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
m_host_interface->dumpSPURAM(filename);
|
||||
});
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowVRAM, "Debug", "ShowVRAM");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowGPUState, "Debug", "ShowGPUState");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.actionDebugShowCDROMState, "Debug",
|
||||
|
@ -174,13 +174,16 @@
|
||||
<addaction name="actionDisableInterlacing"/>
|
||||
<addaction name="actionForceNTSCTimings"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCPUDebugger"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDumpRAM"/>
|
||||
<addaction name="actionDumpVRAM"/>
|
||||
<addaction name="actionDumpSPURAM"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDebugDumpCPUtoVRAMCopies"/>
|
||||
<addaction name="actionDebugDumpVRAMtoCPUCopies"/>
|
||||
<addaction name="actionDumpAudio"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCPUDebugger"/>
|
||||
<addaction name="actionDumpRAM"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDebugShowVRAM"/>
|
||||
<addaction name="actionDebugShowGPUState"/>
|
||||
<addaction name="actionDebugShowCDROMState"/>
|
||||
@ -611,6 +614,16 @@
|
||||
<string>Dump RAM...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDumpVRAM">
|
||||
<property name="text">
|
||||
<string>Dump VRAM...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDumpSPURAM">
|
||||
<property name="text">
|
||||
<string>Dump SPU RAM...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDebugShowGPUState">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
|
@ -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())
|
||||
|
@ -169,6 +169,8 @@ public Q_SLOTS:
|
||||
void stopDumpingAudio();
|
||||
void singleStepCPU();
|
||||
void dumpRAM(const QString& filename);
|
||||
void dumpVRAM(const QString& filename);
|
||||
void dumpSPURAM(const QString& filename);
|
||||
void saveScreenshot();
|
||||
void redrawDisplayWindow();
|
||||
void toggleFullscreen();
|
||||
|
Reference in New Issue
Block a user