early-access version 3998

This commit is contained in:
pineappleEA
2023-11-29 20:41:00 +01:00
parent f15b33ff50
commit 1382f73d4e
105 changed files with 3851 additions and 280 deletions
+1 -1
View File
@@ -386,7 +386,7 @@ if (NOT WIN32)
target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus)
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus gamemode)
endif()
target_compile_definitions(yuzu PRIVATE
+12
View File
@@ -27,6 +27,13 @@ ConfigureCpu::ConfigureCpu(const Core::System& system_,
connect(accuracy_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this,
&ConfigureCpu::UpdateGroup);
connect(backend_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this,
&ConfigureCpu::UpdateGroup);
#ifdef HAS_NCE
ui->backend_group->setVisible(true);
#endif
}
ConfigureCpu::~ConfigureCpu() = default;
@@ -34,6 +41,7 @@ ConfigureCpu::~ConfigureCpu() = default;
void ConfigureCpu::SetConfiguration() {}
void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
auto* accuracy_layout = ui->widget_accuracy->layout();
auto* backend_layout = ui->widget_backend->layout();
auto* unsafe_layout = ui->unsafe_widget->layout();
std::map<u32, QWidget*> unsafe_hold{};
@@ -62,6 +70,9 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
// Keep track of cpu_accuracy combobox to display/hide the unsafe settings
accuracy_layout->addWidget(widget);
accuracy_combobox = widget->combobox;
} else if (setting->Id() == Settings::values.cpu_backend.Id()) {
backend_layout->addWidget(widget);
backend_combobox = widget->combobox;
} else {
// Presently, all other settings here are unsafe checkboxes
unsafe_hold.insert({setting->Id(), widget});
@@ -73,6 +84,7 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
}
UpdateGroup(accuracy_combobox->currentIndex());
UpdateGroup(backend_combobox->currentIndex());
}
void ConfigureCpu::UpdateGroup(int index) {
+1
View File
@@ -49,4 +49,5 @@ private:
std::vector<std::function<void(bool)>> apply_funcs{};
QComboBox* accuracy_combobox;
QComboBox* backend_combobox;
};
+30
View File
@@ -59,6 +59,36 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="backend_group">
<property name="title">
<string>CPU Backend</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QWidget" name="widget_backend" native="true">
<layout class="QVBoxLayout" name="verticalLayout1">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
<property name="visible">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="unsafe_group">
<property name="title">
+36 -7
View File
@@ -36,12 +36,29 @@ ConfigureGeneral::~ConfigureGeneral() = default;
void ConfigureGeneral::SetConfiguration() {}
void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
QLayout& layout = *ui->general_widget->layout();
QLayout& general_layout = *ui->general_widget->layout();
QLayout& linux_layout = *ui->linux_widget->layout();
std::map<u32, QWidget*> hold{};
std::map<u32, QWidget*> general_hold{};
std::map<u32, QWidget*> linux_hold{};
for (const auto setting :
UISettings::values.linkage.by_category[Settings::Category::UiGeneral]) {
std::vector<Settings::BasicSetting*> settings;
auto push = [&settings](auto& list) {
for (auto setting : list) {
settings.push_back(setting);
}
};
push(UISettings::values.linkage.by_category[Settings::Category::UiGeneral]);
push(Settings::values.linkage.by_category[Settings::Category::Linux]);
// Only show Linux group on Unix
#ifndef __unix__
ui->LinuxGroupBox->setVisible(false);
#endif
for (const auto setting : settings) {
auto* widget = builder.BuildWidget(setting, apply_funcs);
if (widget == nullptr) {
@@ -52,11 +69,23 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
continue;
}
hold.emplace(setting->Id(), widget);
switch (setting->GetCategory()) {
case Settings::Category::UiGeneral:
general_hold.emplace(setting->Id(), widget);
break;
case Settings::Category::Linux:
linux_hold.emplace(setting->Id(), widget);
break;
default:
widget->deleteLater();
}
}
for (const auto& [id, widget] : hold) {
layout.addWidget(widget);
for (const auto& [id, widget] : general_hold) {
general_layout.addWidget(widget);
}
for (const auto& [id, widget] : linux_hold) {
linux_layout.addWidget(widget);
}
}
@@ -46,6 +46,33 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="LinuxGroupBox">
<property name="title">
<string>Linux</string>
</property>
<layout class="QVBoxLayout" name="LinuxVerticalLayout_1">
<item>
<widget class="QWidget" name="linux_widget" native="true">
<layout class="QVBoxLayout" name="LinuxVerticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
+1 -1
View File
@@ -57,7 +57,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="coreGroup">
<property name="title">
<string>Core</string>
</property>
@@ -44,6 +44,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
// Cpu
INSERT(Settings, cpu_accuracy, tr("Accuracy:"), QStringLiteral());
INSERT(Settings, cpu_backend, tr("Backend:"), QStringLiteral());
// Cpu Debug
@@ -176,6 +177,9 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
INSERT(UISettings, controller_applet_disabled, tr("Disable controller applet"),
QStringLiteral());
// Linux
INSERT(Settings, enable_gamemode, tr("Enable Gamemode"), QStringLiteral());
// Ui Debugging
// Ui Multiplayer
@@ -240,6 +244,11 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
PAIR(CpuAccuracy, Unsafe, tr("Unsafe")),
PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")),
}});
translations->insert({Settings::EnumMetadata<Settings::CpuBackend>::Index(),
{
PAIR(CpuBackend, Dynarmic, tr("Dynarmic")),
PAIR(CpuBackend, Nce, tr("NCE")),
}});
translations->insert({Settings::EnumMetadata<Settings::FullscreenMode>::Index(),
{
PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")),
+30
View File
@@ -17,6 +17,7 @@
#ifdef __unix__
#include <csignal>
#include <sys/socket.h>
#include "common/linux/gamemode.h"
#endif
#include <boost/container/flat_set.hpp>
@@ -319,6 +320,7 @@ GMainWindow::GMainWindow(std::unique_ptr<QtConfig> config_, bool has_broken_vulk
provider{std::make_unique<FileSys::ManualContentProvider>()} {
#ifdef __unix__
SetupSigInterrupts();
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
#endif
system->Initialize();
@@ -2120,6 +2122,10 @@ void GMainWindow::OnEmulationStopped() {
discord_rpc->Update();
#ifdef __unix__
Common::Linux::StopGamemode();
#endif
// The emulation is stopped, so closing the window or not does not matter anymore
disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
@@ -3502,6 +3508,10 @@ void GMainWindow::OnStartGame() {
play_time_manager->Start();
discord_rpc->Update();
#ifdef __unix__
Common::Linux::StartGamemode();
#endif
}
void GMainWindow::OnRestartGame() {
@@ -3522,6 +3532,10 @@ void GMainWindow::OnPauseGame() {
play_time_manager->Stop();
UpdateMenuState();
AllowOSSleep();
#ifdef __unix__
Common::Linux::StopGamemode();
#endif
}
void GMainWindow::OnPauseContinueGame() {
@@ -3803,6 +3817,9 @@ void GMainWindow::OnConfigure() {
const auto old_theme = UISettings::values.theme;
const bool old_discord_presence = UISettings::values.enable_discord_presence.GetValue();
const auto old_language_index = Settings::values.language_index.GetValue();
#ifdef __unix__
const bool old_gamemode = Settings::values.enable_gamemode.GetValue();
#endif
Settings::SetConfiguringGlobal(true);
ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(),
@@ -3864,6 +3881,11 @@ void GMainWindow::OnConfigure() {
if (UISettings::values.enable_discord_presence.GetValue() != old_discord_presence) {
SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue());
}
#ifdef __unix__
if (Settings::values.enable_gamemode.GetValue() != old_gamemode) {
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
}
#endif
if (!multiplayer_state->IsHostingPublicRoom()) {
multiplayer_state->UpdateCredentials();
@@ -5172,6 +5194,14 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
discord_rpc->Update();
}
#ifdef __unix__
void GMainWindow::SetGamemodeEnabled(bool state) {
if (emulation_running) {
Common::Linux::SetGamemodeState(state);
}
}
#endif
void GMainWindow::changeEvent(QEvent* event) {
#ifdef __unix__
// PaletteChange event appears to only reach so far into the GUI, explicitly asking to
+1
View File
@@ -340,6 +340,7 @@ private:
void SetupSigInterrupts();
static void HandleSigInterrupt(int);
void OnSigInterruptNotifierActivated();
void SetGamemodeEnabled(bool state);
#endif
private slots: