2020-04-30 14:59:31 +00:00
|
|
|
#include "advancedsettingswidget.h"
|
2020-08-22 03:01:52 +00:00
|
|
|
#include "mainwindow.h"
|
2020-08-08 14:03:07 +00:00
|
|
|
#include "settingsdialog.h"
|
2020-04-30 14:59:31 +00:00
|
|
|
#include "settingwidgetbinder.h"
|
|
|
|
|
|
|
|
AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog)
|
|
|
|
: QWidget(parent), m_host_interface(host_interface)
|
|
|
|
{
|
|
|
|
m_ui.setupUi(this);
|
|
|
|
|
|
|
|
for (u32 i = 0; i < static_cast<u32>(LOGLEVEL_COUNT); i++)
|
2020-08-22 03:01:52 +00:00
|
|
|
m_ui.logLevel->addItem(qApp->translate("LogLevel", Settings::GetLogLevelDisplayName(static_cast<LOGLEVEL>(i))));
|
2020-04-30 14:59:31 +00:00
|
|
|
|
2020-07-21 09:49:04 +00:00
|
|
|
SettingWidgetBinder::BindWidgetToEnumSetting(m_host_interface, m_ui.logLevel, "Logging", "LogLevel",
|
|
|
|
&Settings::ParseLogLevelName, &Settings::GetLogLevelName,
|
|
|
|
Settings::DEFAULT_LOG_LEVEL);
|
|
|
|
SettingWidgetBinder::BindWidgetToStringSetting(m_host_interface, m_ui.logFilter, "Logging", "LogFilter");
|
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.logToConsole, "Logging", "LogToConsole");
|
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.logToDebug, "Logging", "LogToDebug");
|
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.logToWindow, "Logging", "LogToWindow");
|
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.logToFile, "Logging", "LogToFile");
|
2020-06-14 21:43:16 +00:00
|
|
|
|
|
|
|
// Tweaks/Hacks section
|
2020-07-21 09:49:04 +00:00
|
|
|
SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.dmaMaxSliceTicks, "Hacks", "DMAMaxSliceTicks");
|
|
|
|
SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.dmaHaltTicks, "Hacks", "DMAHaltTicks");
|
|
|
|
SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.gpuFIFOSize, "Hacks", "GPUFIFOSize");
|
|
|
|
SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.gpuMaxRunAhead, "Hacks", "GPUMaxRunAhead");
|
2020-08-08 06:44:12 +00:00
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cpuRecompilerMemoryExceptions, "CPU",
|
|
|
|
"RecompilerMemoryExceptions", false);
|
2020-08-29 12:07:33 +00:00
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cpuRecompilerICache, "CPU", "RecompilerICache",
|
|
|
|
false);
|
2020-06-14 21:43:16 +00:00
|
|
|
|
2020-08-18 14:01:57 +00:00
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showDebugMenu, "Main", "ShowDebugMenu");
|
2020-08-08 14:03:07 +00:00
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.gpuUseDebugDevice, "GPU", "UseDebugDevice");
|
|
|
|
|
2020-06-14 21:43:16 +00:00
|
|
|
connect(m_ui.resetToDefaultButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::onResetToDefaultClicked);
|
2020-08-18 14:01:57 +00:00
|
|
|
connect(m_ui.showDebugMenu, &QCheckBox::toggled, m_host_interface->getMainWindow(),
|
|
|
|
&MainWindow::updateDebugMenuVisibility, Qt::QueuedConnection);
|
2020-08-08 14:03:07 +00:00
|
|
|
|
|
|
|
dialog->registerWidgetHelp(m_ui.gpuUseDebugDevice, tr("Use Debug Host GPU Device"), tr("Unchecked"),
|
|
|
|
tr("Enables the usage of debug devices and shaders for rendering APIs which support them. "
|
|
|
|
"Should only be used when debugging the emulator."));
|
2020-08-29 12:07:33 +00:00
|
|
|
dialog->registerWidgetHelp(
|
|
|
|
m_ui.cpuRecompilerICache, tr("Enable Recompiler ICache"), tr("Unchecked"),
|
|
|
|
tr("Determines whether the CPU's instruction cache is simulated in the recompiler. Improves accuracy at a small "
|
|
|
|
"cost to performance. If games are running too fast, try enabling this option."));
|
2020-04-30 14:59:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AdvancedSettingsWidget::~AdvancedSettingsWidget() = default;
|
2020-06-14 21:43:16 +00:00
|
|
|
|
|
|
|
void AdvancedSettingsWidget::onResetToDefaultClicked()
|
|
|
|
{
|
|
|
|
m_ui.dmaMaxSliceTicks->setValue(static_cast<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS));
|
|
|
|
m_ui.dmaHaltTicks->setValue(static_cast<int>(Settings::DEFAULT_DMA_HALT_TICKS));
|
|
|
|
m_ui.gpuFIFOSize->setValue(static_cast<int>(Settings::DEFAULT_GPU_FIFO_SIZE));
|
|
|
|
m_ui.gpuMaxRunAhead->setValue(static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD));
|
2020-08-08 06:44:12 +00:00
|
|
|
m_ui.cpuRecompilerMemoryExceptions->setChecked(false);
|
2020-06-14 21:43:16 +00:00
|
|
|
}
|