2022-04-23 09:59:50 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-07-12 12:06:04 +01:00
|
|
|
|
2021-04-15 00:07:40 +01:00
|
|
|
#include "common/settings.h"
|
2020-07-12 12:06:04 +01:00
|
|
|
#include "core/core.h"
|
|
|
|
#include "ui_configure_cpu_debug.h"
|
|
|
|
#include "yuzu/configuration/configure_cpu_debug.h"
|
|
|
|
|
2021-07-30 15:07:32 +01:00
|
|
|
ConfigureCpuDebug::ConfigureCpuDebug(const Core::System& system_, QWidget* parent)
|
2021-10-15 20:26:20 +01:00
|
|
|
: QWidget(parent), ui{std::make_unique<Ui::ConfigureCpuDebug>()}, system{system_} {
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
SetConfiguration();
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfigureCpuDebug::~ConfigureCpuDebug() = default;
|
|
|
|
|
|
|
|
void ConfigureCpuDebug::SetConfiguration() {
|
2021-09-03 02:40:55 +01:00
|
|
|
const bool runtime_lock = !system.IsPoweredOn();
|
2020-07-12 12:06:04 +01:00
|
|
|
|
|
|
|
ui->cpuopt_page_tables->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_page_tables->setChecked(Settings::values.cpuopt_page_tables.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_block_linking->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_block_linking->setChecked(Settings::values.cpuopt_block_linking.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_return_stack_buffer->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_return_stack_buffer->setChecked(
|
|
|
|
Settings::values.cpuopt_return_stack_buffer.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_fast_dispatcher->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_fast_dispatcher->setChecked(Settings::values.cpuopt_fast_dispatcher.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_context_elimination->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_context_elimination->setChecked(
|
|
|
|
Settings::values.cpuopt_context_elimination.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_const_prop->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_const_prop->setChecked(Settings::values.cpuopt_const_prop.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_misc_ir->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_misc_ir->setChecked(Settings::values.cpuopt_misc_ir.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
ui->cpuopt_reduce_misalign_checks->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_reduce_misalign_checks->setChecked(
|
|
|
|
Settings::values.cpuopt_reduce_misalign_checks.GetValue());
|
2021-06-06 08:57:24 +01:00
|
|
|
ui->cpuopt_fastmem->setEnabled(runtime_lock);
|
2021-06-28 20:58:16 +01:00
|
|
|
ui->cpuopt_fastmem->setChecked(Settings::values.cpuopt_fastmem.GetValue());
|
2022-02-27 19:40:05 +00:00
|
|
|
ui->cpuopt_fastmem_exclusives->setEnabled(runtime_lock);
|
|
|
|
ui->cpuopt_fastmem_exclusives->setChecked(
|
|
|
|
Settings::values.cpuopt_fastmem_exclusives.GetValue());
|
|
|
|
ui->cpuopt_recompile_exclusives->setEnabled(runtime_lock);
|
|
|
|
ui->cpuopt_recompile_exclusives->setChecked(
|
|
|
|
Settings::values.cpuopt_recompile_exclusives.GetValue());
|
2020-07-12 12:06:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureCpuDebug::ApplyConfiguration() {
|
|
|
|
Settings::values.cpuopt_page_tables = ui->cpuopt_page_tables->isChecked();
|
|
|
|
Settings::values.cpuopt_block_linking = ui->cpuopt_block_linking->isChecked();
|
|
|
|
Settings::values.cpuopt_return_stack_buffer = ui->cpuopt_return_stack_buffer->isChecked();
|
|
|
|
Settings::values.cpuopt_fast_dispatcher = ui->cpuopt_fast_dispatcher->isChecked();
|
|
|
|
Settings::values.cpuopt_context_elimination = ui->cpuopt_context_elimination->isChecked();
|
|
|
|
Settings::values.cpuopt_const_prop = ui->cpuopt_const_prop->isChecked();
|
|
|
|
Settings::values.cpuopt_misc_ir = ui->cpuopt_misc_ir->isChecked();
|
|
|
|
Settings::values.cpuopt_reduce_misalign_checks = ui->cpuopt_reduce_misalign_checks->isChecked();
|
2021-06-06 08:57:24 +01:00
|
|
|
Settings::values.cpuopt_fastmem = ui->cpuopt_fastmem->isChecked();
|
2022-02-27 19:40:05 +00:00
|
|
|
Settings::values.cpuopt_fastmem_exclusives = ui->cpuopt_fastmem_exclusives->isChecked();
|
|
|
|
Settings::values.cpuopt_recompile_exclusives = ui->cpuopt_recompile_exclusives->isChecked();
|
2020-07-12 12:06:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureCpuDebug::changeEvent(QEvent* event) {
|
|
|
|
if (event->type() == QEvent::LanguageChange) {
|
|
|
|
RetranslateUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
QWidget::changeEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureCpuDebug::RetranslateUI() {
|
|
|
|
ui->retranslateUi(this);
|
|
|
|
}
|