|
|
|
@ -57,6 +57,34 @@ static void setIntRangeTweakOption(QTableWidget* table, int row, int value)
|
|
|
|
|
cb->setValue(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void addFloatRangeTweakOption(QtHostInterface* host_interface, QTableWidget* table, QString name,
|
|
|
|
|
std::string section, std::string key, float min_value, float max_value,
|
|
|
|
|
float step_value, float default_value)
|
|
|
|
|
{
|
|
|
|
|
const int row = table->rowCount();
|
|
|
|
|
|
|
|
|
|
table->insertRow(row);
|
|
|
|
|
|
|
|
|
|
QTableWidgetItem* name_item = new QTableWidgetItem(name);
|
|
|
|
|
name_item->setFlags(name_item->flags() & ~(Qt::ItemIsEditable | Qt::ItemIsSelectable));
|
|
|
|
|
table->setItem(row, 0, name_item);
|
|
|
|
|
|
|
|
|
|
QDoubleSpinBox* cb = new QDoubleSpinBox(table);
|
|
|
|
|
cb->setMinimum(min_value);
|
|
|
|
|
cb->setMaximum(max_value);
|
|
|
|
|
cb->setSingleStep(step_value);
|
|
|
|
|
SettingWidgetBinder::BindWidgetToFloatSetting(host_interface, cb, std::move(section), std::move(key), default_value);
|
|
|
|
|
table->setCellWidget(row, 1, cb);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void setFloatRangeTweakOption(QTableWidget* table, int row, float value)
|
|
|
|
|
{
|
|
|
|
|
QWidget* widget = table->cellWidget(row, 1);
|
|
|
|
|
QDoubleSpinBox* cb = qobject_cast<QDoubleSpinBox*>(widget);
|
|
|
|
|
Assert(cb);
|
|
|
|
|
cb->setValue(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
static void addChoiceTweakOption(QtHostInterface* host_interface, QTableWidget* table, QString name,
|
|
|
|
|
std::string section, std::string key, std::optional<T> (*parse_callback)(const char*),
|
|
|
|
@ -121,6 +149,8 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface,
|
|
|
|
|
addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP CPU Mode"), "GPU", "PGXPCPU", false);
|
|
|
|
|
addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP Preserve Projection Precision"), "GPU",
|
|
|
|
|
"PGXPPreserveProjFP", false);
|
|
|
|
|
addFloatRangeTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("PGXP Geometry Tolerance"), "GPU",
|
|
|
|
|
"PGXPTolerance", -1.0f, 10.0f, 0.5f, -1.0f);
|
|
|
|
|
|
|
|
|
|
addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Enable Recompiler Memory Exceptions"), "CPU",
|
|
|
|
|
"RecompilerMemoryExceptions", false);
|
|
|
|
@ -154,14 +184,15 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 0, false);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 1, false);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 2, false);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 3, false);
|
|
|
|
|
setChoiceTweakOption(m_ui.tweakOptionTable, 4, Settings::DEFAULT_CPU_FASTMEM_MODE);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 5, false);
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 6, static_cast<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS));
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 7, static_cast<int>(Settings::DEFAULT_DMA_HALT_TICKS));
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 8, static_cast<int>(Settings::DEFAULT_GPU_FIFO_SIZE));
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 9, static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD));
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 10, false);
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 11, 0);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 12, true);
|
|
|
|
|
setFloatRangeTweakOption(m_ui.tweakOptionTable, 3, -1.0f);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 4, false);
|
|
|
|
|
setChoiceTweakOption(m_ui.tweakOptionTable, 5, Settings::DEFAULT_CPU_FASTMEM_MODE);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 6, false);
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 7, static_cast<int>(Settings::DEFAULT_DMA_MAX_SLICE_TICKS));
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 8, static_cast<int>(Settings::DEFAULT_DMA_HALT_TICKS));
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 9, static_cast<int>(Settings::DEFAULT_GPU_FIFO_SIZE));
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 10, static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD));
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 11, false);
|
|
|
|
|
setIntRangeTweakOption(m_ui.tweakOptionTable, 12, 0);
|
|
|
|
|
setBooleanTweakOption(m_ui.tweakOptionTable, 13, true);
|
|
|
|
|
}
|
|
|
|
|