Skip to content

Commit

Permalink
Misc: (wip) Wire up systrace logging
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes committed Oct 13, 2024
1 parent ca9f64a commit 85135f3
Show file tree
Hide file tree
Showing 7 changed files with 487 additions and 37 deletions.
1 change: 1 addition & 0 deletions common/Console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ bool Log::SetFileOutputLevel(LOGLEVEL level, std::string path)
}

s_file_level = s_file_handle ? level : LOGLEVEL_NONE;
UpdateMaxLevel();
return IsFileOutputEnabled();
}

Expand Down
87 changes: 87 additions & 0 deletions pcsx2-qt/Settings/DebugSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,52 @@ DebugSettingsWidget::DebugSettingsWidget(SettingsWindow* dialog, QWidget* parent

connect(m_ui.dumpGSDraws, &QCheckBox::checkStateChanged, this, &DebugSettingsWidget::onDrawDumpingChanged);
onDrawDumpingChanged();

//////////////////////////////////////////////////////////////////////////
// Trace Logging Settings
//////////////////////////////////////////////////////////////////////////
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEEnable, "SysTrace/EE", "Enabled", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEBIOS, "SysTrace/EE", "Bios", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEMemory, "SysTrace/EE", "Memory", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEER5900, "SysTrace/EE", "R5900", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEECOP0, "SysTrace/EE", "COP0", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEECOP1, "SysTrace/EE", "FPU", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEECOP2, "SysTrace/EE", "Vumacro", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEECache, "SysTrace/EE", "Cache", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEMMIO, "SysTrace/EE", "HwRegs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEUNKNWNMMIO, "SysTrace/EE", "UnknownRegs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEDMARegs, "SysTrace/EE", "DmaRegs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEIPU, "SysTrace/EE", "IPU", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEGIFTags, "SysTrace/EE", "GIFtags", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEVIFCodes, "SysTrace/EE", "VIFcodes", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEMSKPATH3, "SysTrace/EE", "MSKPATH3", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEMFIFO, "SysTrace/EE", "MFIFO", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEDMACTRL, "SysTrace/EE", "dmacctrl", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEECounters, "SysTrace/EE", "Counters", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEVIF, "SysTrace/EE", "VIF", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEEGIF, "SysTrace/EE", "GIF", false);

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPEnable, "SysTrace/IOP", "Enabled", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPBIOS, "SysTrace/IOP", "Bios", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPMemcards, "SysTrace/IOP", "Memcards", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPR3000A, "SysTrace/IOP", "R3000A", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPCOP2, "SysTrace/IOP", "COP2/GPU", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPMMIO, "SysTrace/IOP", "HwRegs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPUNKNWNMMIO, "SysTrace/IOP", "UnknownRegs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPDMARegs, "SysTrace/IOP", "DmaRegs", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPMemcards, "SysTrace/IOP", "Memcards", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPPad, "SysTrace/IOP", "Pad", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPDMACTRL, "SysTrace/IOP", "DmacCtrl", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPCounters, "SysTrace/IOP", "Counters", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPCDVD, "SysTrace/IOP", "CDVD", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkIOPMDEC, "SysTrace/IOP", "MDEC", false);

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.chkEESIF, "SysTrace/SIF", "SIF", false);

connect(m_ui.chkEEEnable, &QCheckBox::checkStateChanged, this, &DebugSettingsWidget::onLoggingCategoryChanged);
connect(m_ui.chkIOPEnable, &QCheckBox::checkStateChanged, this, &DebugSettingsWidget::onLoggingCategoryChanged);

onLoggingCategoryChanged();
}

DebugSettingsWidget::~DebugSettingsWidget() = default;
Expand All @@ -47,3 +93,44 @@ void DebugSettingsWidget::onDrawDumpingChanged()
m_ui.saveTexture->setEnabled(enabled);
m_ui.saveDepth->setEnabled(enabled);
}

void DebugSettingsWidget::onLoggingCategoryChanged()
{
const bool ee_enabled = m_dialog->getEffectiveBoolValue("SysTrace/EE", "Enabled", false);
const bool iop_enabled = m_dialog->getEffectiveBoolValue("SysTrace/IOP", "Enabled", false);

m_ui.chkEEBIOS->setEnabled(ee_enabled);
m_ui.chkEEMemory->setEnabled(ee_enabled);
m_ui.chkEER5900->setEnabled(ee_enabled);
m_ui.chkEECOP0->setEnabled(ee_enabled);
m_ui.chkEECOP1->setEnabled(ee_enabled);
m_ui.chkEECOP2->setEnabled(ee_enabled);
m_ui.chkEECache->setEnabled(ee_enabled);
m_ui.chkEEMMIO->setEnabled(ee_enabled);
m_ui.chkEEUNKNWNMMIO->setEnabled(ee_enabled);
m_ui.chkEEDMARegs->setEnabled(ee_enabled);
m_ui.chkEEIPU->setEnabled(ee_enabled);
m_ui.chkEEGIFTags->setEnabled(ee_enabled);
m_ui.chkEEVIFCodes->setEnabled(ee_enabled);
m_ui.chkEEMSKPATH3->setEnabled(ee_enabled);
m_ui.chkEEMFIFO->setEnabled(ee_enabled);
m_ui.chkEEDMACTRL->setEnabled(ee_enabled);
m_ui.chkEECounters->setEnabled(ee_enabled);
m_ui.chkEEVIF->setEnabled(ee_enabled);
m_ui.chkEEGIF->setEnabled(ee_enabled);
m_ui.chkEESIF->setEnabled(ee_enabled);

m_ui.chkIOPBIOS->setEnabled(iop_enabled);
m_ui.chkIOPMemcards->setEnabled(iop_enabled);
m_ui.chkIOPR3000A->setEnabled(iop_enabled);
m_ui.chkIOPCOP2->setEnabled(iop_enabled);
m_ui.chkIOPMMIO->setEnabled(iop_enabled);
m_ui.chkIOPUNKNWNMMIO->setEnabled(iop_enabled);
m_ui.chkIOPDMARegs->setEnabled(iop_enabled);
m_ui.chkIOPMemcards->setEnabled(iop_enabled);
m_ui.chkIOPPad->setEnabled(iop_enabled);
m_ui.chkIOPDMACTRL->setEnabled(iop_enabled);
m_ui.chkIOPCounters->setEnabled(iop_enabled);
m_ui.chkIOPCDVD->setEnabled(iop_enabled);
m_ui.chkIOPMDEC->setEnabled(iop_enabled);
}
1 change: 1 addition & 0 deletions pcsx2-qt/Settings/DebugSettingsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class DebugSettingsWidget : public QWidget

private Q_SLOTS:
void onDrawDumpingChanged();
void onLoggingCategoryChanged();

private:
SettingsWindow* m_dialog;
Expand Down
Loading

0 comments on commit 85135f3

Please sign in to comment.