early-access version 2149
This commit is contained in:
parent
6a02e7140f
commit
fe662edf4a
12 changed files with 92 additions and 104 deletions
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 2148.
|
This is the source code for early-access 2149.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
|
@ -565,6 +565,7 @@ struct Values {
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
BasicSetting<std::string> log_filter{"*:Info", "log_filter"};
|
BasicSetting<std::string> log_filter{"*:Info", "log_filter"};
|
||||||
BasicSetting<bool> use_dev_keys{false, "use_dev_keys"};
|
BasicSetting<bool> use_dev_keys{false, "use_dev_keys"};
|
||||||
|
BasicSetting<bool> disable_screen_saver{true, "disable_screen_saver"};
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
BasicSetting<std::string> network_interface{std::string(), "network_interface"};
|
BasicSetting<std::string> network_interface{std::string(), "network_interface"};
|
||||||
|
|
|
@ -285,11 +285,6 @@ if (USE_DISCORD_PRESENCE)
|
||||||
target_compile_definitions(yuzu PRIVATE -DUSE_DISCORD_PRESENCE)
|
target_compile_definitions(yuzu PRIVATE -DUSE_DISCORD_PRESENCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
||||||
find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS DBus ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH} REQUIRED)
|
|
||||||
target_link_libraries(yuzu PRIVATE Qt5::DBus)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (YUZU_USE_QT_WEB_ENGINE)
|
if (YUZU_USE_QT_WEB_ENGINE)
|
||||||
target_link_libraries(yuzu PRIVATE Qt5::WebEngineCore Qt5::WebEngineWidgets)
|
target_link_libraries(yuzu PRIVATE Qt5::WebEngineCore Qt5::WebEngineWidgets)
|
||||||
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE)
|
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE)
|
||||||
|
@ -304,6 +299,11 @@ if (YUZU_USE_BUNDLED_QT)
|
||||||
copy_yuzu_Qt5_deps(yuzu)
|
copy_yuzu_Qt5_deps(yuzu)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_SDL2)
|
||||||
|
target_link_libraries(yuzu PRIVATE SDL2)
|
||||||
|
target_compile_definitions(yuzu PRIVATE HAVE_SDL2)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
include(CopyYuzuSDLDeps)
|
include(CopyYuzuSDLDeps)
|
||||||
include(CopyYuzuFFmpegDeps)
|
include(CopyYuzuFFmpegDeps)
|
||||||
|
|
|
@ -738,6 +738,7 @@ void Config::ReadMiscellaneousValues() {
|
||||||
|
|
||||||
ReadBasicSetting(Settings::values.log_filter);
|
ReadBasicSetting(Settings::values.log_filter);
|
||||||
ReadBasicSetting(Settings::values.use_dev_keys);
|
ReadBasicSetting(Settings::values.use_dev_keys);
|
||||||
|
ReadBasicSetting(Settings::values.disable_screen_saver);
|
||||||
|
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
}
|
}
|
||||||
|
@ -1296,6 +1297,7 @@ void Config::SaveMiscellaneousValues() {
|
||||||
|
|
||||||
WriteBasicSetting(Settings::values.log_filter);
|
WriteBasicSetting(Settings::values.log_filter);
|
||||||
WriteBasicSetting(Settings::values.use_dev_keys);
|
WriteBasicSetting(Settings::values.use_dev_keys);
|
||||||
|
WriteBasicSetting(Settings::values.disable_screen_saver);
|
||||||
|
|
||||||
qt_config->endGroup();
|
qt_config->endGroup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ void ConfigureGeneral::SetConfiguration() {
|
||||||
ui->toggle_user_on_boot->setChecked(UISettings::values.select_user_on_boot.GetValue());
|
ui->toggle_user_on_boot->setChecked(UISettings::values.select_user_on_boot.GetValue());
|
||||||
ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue());
|
ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue());
|
||||||
ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue());
|
ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue());
|
||||||
|
ui->toggle_screen_saver->setChecked(Settings::values.disable_screen_saver.GetValue());
|
||||||
|
|
||||||
ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue());
|
ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue());
|
||||||
ui->speed_limit->setValue(Settings::values.speed_limit.GetValue());
|
ui->speed_limit->setValue(Settings::values.speed_limit.GetValue());
|
||||||
|
@ -88,6 +89,7 @@ void ConfigureGeneral::ApplyConfiguration() {
|
||||||
UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked();
|
UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked();
|
||||||
UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked();
|
UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked();
|
||||||
UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked();
|
UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked();
|
||||||
|
Settings::values.disable_screen_saver = ui->toggle_screen_saver->isChecked();
|
||||||
|
|
||||||
Settings::values.fps_cap.SetValue(ui->fps_cap->value());
|
Settings::values.fps_cap.SetValue(ui->fps_cap->value());
|
||||||
|
|
||||||
|
@ -136,6 +138,7 @@ void ConfigureGeneral::SetupPerGameUI() {
|
||||||
ui->toggle_user_on_boot->setVisible(false);
|
ui->toggle_user_on_boot->setVisible(false);
|
||||||
ui->toggle_background_pause->setVisible(false);
|
ui->toggle_background_pause->setVisible(false);
|
||||||
ui->toggle_hide_mouse->setVisible(false);
|
ui->toggle_hide_mouse->setVisible(false);
|
||||||
|
ui->toggle_screen_saver->setVisible(false);
|
||||||
|
|
||||||
ui->button_reset_defaults->setVisible(false);
|
ui->button_reset_defaults->setVisible(false);
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="toggle_screen_saver">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable screen saver while in game</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
<item row="0" column="0" colspan="4">
|
<item row="0" column="0" colspan="4">
|
||||||
<widget class="QLabel" name="label_1">
|
<widget class="QLabel" name="label_1">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Reads controller input from scripts in the same format as TAS-nx scripts.<br/>For a more detailed explanation please consult the FAQ on the yuzu website.</string>
|
<string><html><head/><body><p>Reads controller input from scripts in the same format as TAS-nx scripts.<br/>For a more detailed explanation, please consult the <a href="https://yuzu-emu.org/help/feature/tas/"><span style=" text-decoration: underline; color:#039be5;">help page</span></a> on the yuzu website.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="4">
|
<item row="1" column="0" colspan="4">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -> Hotkeys).</string>
|
<string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (Configure -> General -> Hotkeys).</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
|
@ -48,12 +48,6 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
||||||
|
|
||||||
#define QT_NO_OPENGL
|
#define QT_NO_OPENGL
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#ifdef __linux__
|
|
||||||
#include <QDBusConnection>
|
|
||||||
#include <QDBusError>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
#include <QDBusReply>
|
|
||||||
#endif
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
@ -72,6 +66,10 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QtConcurrent/QtConcurrent>
|
#include <QtConcurrent/QtConcurrent>
|
||||||
|
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
|
#include <SDL.h> // For SDL ScreenSaver functions
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include "common/detached_tasks.h"
|
#include "common/detached_tasks.h"
|
||||||
#include "common/fs/fs.h"
|
#include "common/fs/fs.h"
|
||||||
|
@ -1094,21 +1092,24 @@ void GMainWindow::RestoreUIState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
||||||
if (!UISettings::values.pause_when_in_background) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (state != Qt::ApplicationHidden && state != Qt::ApplicationInactive &&
|
if (state != Qt::ApplicationHidden && state != Qt::ApplicationInactive &&
|
||||||
state != Qt::ApplicationActive) {
|
state != Qt::ApplicationActive) {
|
||||||
LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state);
|
LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state);
|
||||||
}
|
}
|
||||||
if (ui->action_Pause->isEnabled() &&
|
if (state & (Qt::ApplicationHidden | Qt::ApplicationInactive)) {
|
||||||
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
|
if (UISettings::values.pause_when_in_background && ui->action_Pause->isEnabled()) {
|
||||||
auto_paused = true;
|
auto_paused = true;
|
||||||
OnPauseGame();
|
OnPauseGame();
|
||||||
} else if (ui->action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) {
|
}
|
||||||
|
AllowOSSleep();
|
||||||
|
} else if (state == Qt::ApplicationActive) {
|
||||||
|
if (UISettings::values.pause_when_in_background && ui->action_Start->isEnabled() &&
|
||||||
|
auto_paused) {
|
||||||
auto_paused = false;
|
auto_paused = false;
|
||||||
OnStartGame();
|
OnStartGame();
|
||||||
}
|
}
|
||||||
|
PreventOSSleep();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::ConnectWidgetEvents() {
|
void GMainWindow::ConnectWidgetEvents() {
|
||||||
|
@ -1227,74 +1228,20 @@ void GMainWindow::OnDisplayTitleBars(bool show) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::PreventOSSleep() {
|
void GMainWindow::PreventOSSleep() {
|
||||||
|
if (Settings::values.disable_screen_saver) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
|
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
|
||||||
#elif defined(__linux__)
|
#elif defined(HAVE_SDL2)
|
||||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
SDL_DisableScreenSaver();
|
||||||
if (bus.isConnected()) {
|
|
||||||
// Specs: https://specifications.freedesktop.org/idle-inhibit-spec/0.1/re01.html
|
|
||||||
const QString service = QStringLiteral("org.freedesktop.ScreenSaver");
|
|
||||||
const QString path = QStringLiteral("/org/freedesktop/ScreenSaver");
|
|
||||||
|
|
||||||
QDBusInterface screen_saver_interface(service, path, service, bus, this);
|
|
||||||
if (screen_saver_interface.isValid()) {
|
|
||||||
const QString method = QStringLiteral("Inhibit");
|
|
||||||
const QString application_name = QStringLiteral("org.yuzu-emu.Yuzu");
|
|
||||||
const QString reason_for_inhibit = QStringLiteral("Playing a game");
|
|
||||||
|
|
||||||
QDBusReply<uint32_t> reply =
|
|
||||||
screen_saver_interface.call(method, application_name, reason_for_inhibit);
|
|
||||||
|
|
||||||
if (reply.isValid()) {
|
|
||||||
screensaver_dbus_cookie = reply.value();
|
|
||||||
screensaver_inhibited = true;
|
|
||||||
|
|
||||||
LOG_INFO(Frontend, "Screen saver disabled successfully (cookie: {})",
|
|
||||||
screensaver_dbus_cookie);
|
|
||||||
} else {
|
|
||||||
QDBusError error = reply.error();
|
|
||||||
LOG_ERROR(Frontend, "Could not disable screen saver: {} {}",
|
|
||||||
error.message().toStdString(), error.name().toStdString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::AllowOSSleep() {
|
void GMainWindow::AllowOSSleep() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
SetThreadExecutionState(ES_CONTINUOUS);
|
SetThreadExecutionState(ES_CONTINUOUS);
|
||||||
#elif defined(__linux__)
|
#elif defined(HAVE_SDL2)
|
||||||
if (!screensaver_inhibited) {
|
SDL_EnableScreenSaver();
|
||||||
LOG_WARNING(Frontend, "Screen saver already enabled.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
|
||||||
if (bus.isConnected()) {
|
|
||||||
// Specs: https://specifications.freedesktop.org/idle-inhibit-spec/0.1/re01.html
|
|
||||||
const QString service = QStringLiteral("org.freedesktop.ScreenSaver");
|
|
||||||
const QString path = QStringLiteral("/org/freedesktop/ScreenSaver");
|
|
||||||
|
|
||||||
QDBusInterface screen_saver_interface(service, path, service, bus, this);
|
|
||||||
if (screen_saver_interface.isValid()) {
|
|
||||||
const QString method = QStringLiteral("UnInhibit");
|
|
||||||
|
|
||||||
QDBusReply<void> reply = screen_saver_interface.call(method, screensaver_dbus_cookie);
|
|
||||||
|
|
||||||
if (reply.isValid()) {
|
|
||||||
LOG_INFO(Frontend, "Screen saver enabled successfully (cookie: {})",
|
|
||||||
screensaver_dbus_cookie);
|
|
||||||
|
|
||||||
screensaver_dbus_cookie = 0;
|
|
||||||
screensaver_inhibited = false;
|
|
||||||
} else {
|
|
||||||
QDBusError error = reply.error();
|
|
||||||
LOG_ERROR(Frontend, "Could not disable screen saver: {} {}",
|
|
||||||
error.message().toStdString(), error.name().toStdString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1332,10 +1279,12 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
|
||||||
static_cast<u32>(CalloutFlag::DRDDeprecation);
|
static_cast<u32>(CalloutFlag::DRDDeprecation);
|
||||||
QMessageBox::warning(
|
QMessageBox::warning(
|
||||||
this, tr("Warning Outdated Game Format"),
|
this, tr("Warning Outdated Game Format"),
|
||||||
tr("You are using the deconstructed ROM directory format for this game, which is an "
|
tr("You are using the deconstructed ROM directory format for this game, which is "
|
||||||
|
"an "
|
||||||
"outdated format that has been superseded by others such as NCA, NAX, XCI, or "
|
"outdated format that has been superseded by others such as NCA, NAX, XCI, or "
|
||||||
"NSP. Deconstructed ROM directories lack icons, metadata, and update "
|
"NSP. Deconstructed ROM directories lack icons, metadata, and update "
|
||||||
"support.<br><br>For an explanation of the various Switch formats yuzu supports, <a "
|
"support.<br><br>For an explanation of the various Switch formats yuzu "
|
||||||
|
"supports, <a "
|
||||||
"href='https://yuzu-emu.org/wiki/overview-of-switch-game-formats'>check out our "
|
"href='https://yuzu-emu.org/wiki/overview-of-switch-game-formats'>check out our "
|
||||||
"wiki</a>. This message will not be shown again."));
|
"wiki</a>. This message will not be shown again."));
|
||||||
}
|
}
|
||||||
|
@ -1353,7 +1302,9 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
|
||||||
tr("yuzu has encountered an error while running the video core, please see the "
|
tr("yuzu has encountered an error while running the video core, please see the "
|
||||||
"log for more details."
|
"log for more details."
|
||||||
"For more information on accessing the log, please see the following page: "
|
"For more information on accessing the log, please see the following page: "
|
||||||
"<a href='https://community.citra-emu.org/t/how-to-upload-the-log-file/296'>How "
|
"<a "
|
||||||
|
"href='https://community.citra-emu.org/t/how-to-upload-the-log-file/"
|
||||||
|
"296'>How "
|
||||||
"to "
|
"to "
|
||||||
"Upload the Log File</a>."
|
"Upload the Log File</a>."
|
||||||
"Ensure that you have the latest graphics drivers for your GPU."));
|
"Ensure that you have the latest graphics drivers for your GPU."));
|
||||||
|
@ -1371,7 +1322,8 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
|
||||||
tr("Error while loading ROM! %1", "%1 signifies a numeric error code.")
|
tr("Error while loading ROM! %1", "%1 signifies a numeric error code.")
|
||||||
.arg(QString::fromStdString(error_code));
|
.arg(QString::fromStdString(error_code));
|
||||||
const auto description =
|
const auto description =
|
||||||
tr("%1<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the "
|
tr("%1<br>Please follow <a "
|
||||||
|
"href='https://yuzu-emu.org/help/quickstart/'>the "
|
||||||
"yuzu quickstart guide</a> to redump your files.<br>You can refer "
|
"yuzu quickstart guide</a> to redump your files.<br>You can refer "
|
||||||
"to the yuzu wiki</a> or the yuzu Discord</a> for help.",
|
"to the yuzu wiki</a> or the yuzu Discord</a> for help.",
|
||||||
"%1 signifies an error string.")
|
"%1 signifies an error string.")
|
||||||
|
@ -1445,6 +1397,14 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
|
||||||
SelectAndSetCurrentUser();
|
SelectAndSetCurrentUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_SDL2) && !defined(_WIN32)
|
||||||
|
SDL_InitSubSystem(SDL_INIT_VIDEO);
|
||||||
|
// SDL disables the screen saver by default, and setting the hint
|
||||||
|
// SDL_HINT_VIDEO_ALLOW_SCREENSAVER doesn't seem to work, so we just enable the screen saver
|
||||||
|
// for now.
|
||||||
|
SDL_EnableScreenSaver();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!LoadROM(filename, program_id, program_index))
|
if (!LoadROM(filename, program_id, program_index))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1462,8 +1422,8 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
|
||||||
|
|
||||||
connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
|
connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
|
||||||
connect(render_window, &GRenderWindow::MouseActivity, this, &GMainWindow::OnMouseActivity);
|
connect(render_window, &GRenderWindow::MouseActivity, this, &GMainWindow::OnMouseActivity);
|
||||||
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
|
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our
|
||||||
// before the CPU continues
|
// views before the CPU continues
|
||||||
connect(emu_thread.get(), &EmuThread::DebugModeEntered, waitTreeWidget,
|
connect(emu_thread.get(), &EmuThread::DebugModeEntered, waitTreeWidget,
|
||||||
&WaitTreeWidget::OnDebugModeEntered, Qt::BlockingQueuedConnection);
|
&WaitTreeWidget::OnDebugModeEntered, Qt::BlockingQueuedConnection);
|
||||||
connect(emu_thread.get(), &EmuThread::DebugModeLeft, waitTreeWidget,
|
connect(emu_thread.get(), &EmuThread::DebugModeLeft, waitTreeWidget,
|
||||||
|
@ -1537,6 +1497,10 @@ void GMainWindow::ShutdownGame() {
|
||||||
|
|
||||||
AllowOSSleep();
|
AllowOSSleep();
|
||||||
|
|
||||||
|
#if defined(HAVE_SDL2) && !defined(_WIN32)
|
||||||
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
|
#endif
|
||||||
|
|
||||||
discord_rpc->Pause();
|
discord_rpc->Pause();
|
||||||
emu_thread->RequestStop();
|
emu_thread->RequestStop();
|
||||||
|
|
||||||
|
@ -2047,7 +2011,8 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
|
||||||
const QStringList selections{tr("Full"), tr("Skeleton")};
|
const QStringList selections{tr("Full"), tr("Skeleton")};
|
||||||
const auto res = QInputDialog::getItem(
|
const auto res = QInputDialog::getItem(
|
||||||
this, tr("Select RomFS Dump Mode"),
|
this, tr("Select RomFS Dump Mode"),
|
||||||
tr("Please select the how you would like the RomFS dumped.<br>Full will copy all of the "
|
tr("Please select the how you would like the RomFS dumped.<br>Full will copy all of "
|
||||||
|
"the "
|
||||||
"files into the new directory while <br>skeleton will only create the directory "
|
"files into the new directory while <br>skeleton will only create the directory "
|
||||||
"structure."),
|
"structure."),
|
||||||
selections, 0, false, &ok);
|
selections, 0, false, &ok);
|
||||||
|
@ -2309,7 +2274,8 @@ void GMainWindow::OnMenuInstallToNAND() {
|
||||||
if (detected_base_install) {
|
if (detected_base_install) {
|
||||||
QMessageBox::warning(
|
QMessageBox::warning(
|
||||||
this, tr("Install Results"),
|
this, tr("Install Results"),
|
||||||
tr("To avoid possible conflicts, we discourage users from installing base games to the "
|
tr("To avoid possible conflicts, we discourage users from installing base games to "
|
||||||
|
"the "
|
||||||
"NAND.\nPlease, only use this feature to install updates and DLC."));
|
"NAND.\nPlease, only use this feature to install updates and DLC."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2721,13 +2687,13 @@ void GMainWindow::OnConfigure() {
|
||||||
const auto result = configure_dialog.exec();
|
const auto result = configure_dialog.exec();
|
||||||
if (result != QDialog::Accepted && !UISettings::values.configuration_applied &&
|
if (result != QDialog::Accepted && !UISettings::values.configuration_applied &&
|
||||||
!UISettings::values.reset_to_defaults) {
|
!UISettings::values.reset_to_defaults) {
|
||||||
// Runs if the user hit Cancel or closed the window, and did not ever press the Apply button
|
// Runs if the user hit Cancel or closed the window, and did not ever press the Apply
|
||||||
// or `Reset to Defaults` button
|
// button or `Reset to Defaults` button
|
||||||
return;
|
return;
|
||||||
} else if (result == QDialog::Accepted) {
|
} else if (result == QDialog::Accepted) {
|
||||||
// Only apply new changes if user hit Okay
|
// Only apply new changes if user hit Okay
|
||||||
// This is here to avoid applying changes if the user hit Apply, made some changes, then hit
|
// This is here to avoid applying changes if the user hit Apply, made some changes, then
|
||||||
// Cancel
|
// hit Cancel
|
||||||
configure_dialog.ApplyConfiguration();
|
configure_dialog.ApplyConfiguration();
|
||||||
} else if (UISettings::values.reset_to_defaults) {
|
} else if (UISettings::values.reset_to_defaults) {
|
||||||
LOG_INFO(Frontend, "Resetting all settings to defaults");
|
LOG_INFO(Frontend, "Resetting all settings to defaults");
|
||||||
|
@ -2743,8 +2709,8 @@ void GMainWindow::OnConfigure() {
|
||||||
LOG_WARNING(Frontend, "Failed to remove game metadata cache files");
|
LOG_WARNING(Frontend, "Failed to remove game metadata cache files");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Explicitly save the game directories, since reinitializing config does not explicitly do
|
// Explicitly save the game directories, since reinitializing config does not explicitly
|
||||||
// so.
|
// do so.
|
||||||
QVector<UISettings::GameDir> old_game_dirs = std::move(UISettings::values.game_dirs);
|
QVector<UISettings::GameDir> old_game_dirs = std::move(UISettings::values.game_dirs);
|
||||||
QVector<u64> old_favorited_ids = std::move(UISettings::values.favorited_ids);
|
QVector<u64> old_favorited_ids = std::move(UISettings::values.favorited_ids);
|
||||||
|
|
||||||
|
@ -2791,6 +2757,12 @@ void GMainWindow::OnConfigure() {
|
||||||
render_window->setAttribute(Qt::WA_Hover, false);
|
render_window->setAttribute(Qt::WA_Hover, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (emulation_running) {
|
||||||
|
PreventOSSleep();
|
||||||
|
} else {
|
||||||
|
AllowOSSleep();
|
||||||
|
}
|
||||||
|
|
||||||
if (UISettings::values.hide_mouse) {
|
if (UISettings::values.hide_mouse) {
|
||||||
mouse_hide_timer.start();
|
mouse_hide_timer.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,11 +348,6 @@ private:
|
||||||
bool auto_paused = false;
|
bool auto_paused = false;
|
||||||
QTimer mouse_hide_timer;
|
QTimer mouse_hide_timer;
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
bool screensaver_inhibited = false;
|
|
||||||
uint32_t screensaver_dbus_cookie;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// FS
|
// FS
|
||||||
std::shared_ptr<FileSys::VfsFilesystem> vfs;
|
std::shared_ptr<FileSys::VfsFilesystem> vfs;
|
||||||
std::unique_ptr<FileSys::ManualContentProvider> provider;
|
std::unique_ptr<FileSys::ManualContentProvider> provider;
|
||||||
|
|
|
@ -482,6 +482,7 @@ void Config::ReadValues() {
|
||||||
Settings::values.log_filter =
|
Settings::values.log_filter =
|
||||||
sdl2_config->Get("Miscellaneous", Settings::values.log_filter.GetLabel(), "*:Trace");
|
sdl2_config->Get("Miscellaneous", Settings::values.log_filter.GetLabel(), "*:Trace");
|
||||||
ReadSetting("Miscellaneous", Settings::values.use_dev_keys);
|
ReadSetting("Miscellaneous", Settings::values.use_dev_keys);
|
||||||
|
ReadSetting("Miscellaneous", Settings::values.disable_screen_saver);
|
||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
Settings::values.record_frame_times =
|
Settings::values.record_frame_times =
|
||||||
|
|
|
@ -391,6 +391,10 @@ log_filter = *:Trace
|
||||||
# 0 (default): Disabled, 1: Enabled
|
# 0 (default): Disabled, 1: Enabled
|
||||||
use_dev_keys =
|
use_dev_keys =
|
||||||
|
|
||||||
|
# Disables the screensaver while yuzu is in session.
|
||||||
|
# 1 (defualt): Yes, 0 : No
|
||||||
|
disable_screen_saver =
|
||||||
|
|
||||||
[Debugging]
|
[Debugging]
|
||||||
# Record frame time data, can be found in the log directory. Boolean value
|
# Record frame time data, can be found in the log directory. Boolean value
|
||||||
record_frame_times =
|
record_frame_times =
|
||||||
|
|
|
@ -22,6 +22,9 @@ EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Co
|
||||||
LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
|
LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
if (!Settings::values.disable_screen_saver) {
|
||||||
|
SDL_EnableScreenSaver();
|
||||||
|
}
|
||||||
input_subsystem->Initialize();
|
input_subsystem->Initialize();
|
||||||
SDL_SetMainReady();
|
SDL_SetMainReady();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue