[cmake, core] Unbreak FreeBSD Building Process

This commit is contained in:
SDK Chan 2025-07-24 17:33:44 +00:00 committed by crueter
parent b9c21a5c50
commit e09d39630f
3 changed files with 734 additions and 737 deletions

View file

@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project SPDX-License-Identifier:
# GPL-2.0-or-later
if(DEFINED ENV{AZURECIREPO})
set(BUILD_REPOSITORY $ENV{AZURECIREPO})
@ -16,7 +16,8 @@ endif ()
include(GenerateSCMRev)
add_library(common STATIC
add_library(
common STATIC
address_space.cpp
address_space.h
algorithm.h
@ -158,32 +159,26 @@ add_library(common STATIC
wall_clock.cpp
wall_clock.h
zstd_compression.cpp
zstd_compression.h
)
zstd_compression.h)
if(YUZU_ENABLE_PORTABLE)
add_compile_definitions(YUZU_ENABLE_PORTABLE)
endif()
if(WIN32)
target_sources(common PRIVATE
windows/timer_resolution.cpp
windows/timer_resolution.h
)
target_sources(common PRIVATE windows/timer_resolution.cpp
windows/timer_resolution.h)
target_link_libraries(common PRIVATE ntdll)
endif()
if(NOT WIN32)
target_sources(common PRIVATE
signal_chain.cpp
signal_chain.h
)
target_sources(common PRIVATE signal_chain.cpp signal_chain.h)
endif()
if(ANDROID)
target_sources(common
PUBLIC
fs/fs_android.cpp
target_sources(
common
PUBLIC fs/fs_android.cpp
fs/fs_android.h
android/android_common.cpp
android/android_common.h
@ -192,23 +187,19 @@ if(ANDROID)
android/multiplayer/multiplayer.cpp
android/multiplayer/multiplayer.h
android/applets/software_keyboard.cpp
android/applets/software_keyboard.h
)
android/applets/software_keyboard.h)
endif()
if (UNIX AND NOT APPLE)
target_sources(common PRIVATE
linux/gamemode.cpp
linux/gamemode.h
)
if(LINUX AND NOT APPLE)
target_sources(common PRIVATE linux/gamemode.cpp linux/gamemode.h)
target_link_libraries(common PRIVATE gamemode::headers)
endif()
if(ARCHITECTURE_x86_64)
target_sources(common
PRIVATE
x64/cpu_detect.cpp
target_sources(
common
PRIVATE x64/cpu_detect.cpp
x64/cpu_detect.h
x64/cpu_wait.cpp
x64/cpu_wait.h
@ -217,55 +208,60 @@ if(ARCHITECTURE_x86_64)
x64/rdtsc.cpp
x64/rdtsc.h
x64/xbyak_abi.h
x64/xbyak_util.h
)
x64/xbyak_util.h)
target_link_libraries(common PRIVATE xbyak::xbyak)
endif()
if(HAS_NCE)
target_sources(common
PRIVATE
arm64/native_clock.cpp
arm64/native_clock.h
)
target_sources(common PRIVATE arm64/native_clock.cpp arm64/native_clock.h)
endif()
if(MSVC)
target_compile_definitions(common PRIVATE
# The standard library doesn't provide any replacement for codecvt yet
# so we can disable this deprecation warning for the time being.
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
)
target_compile_options(common PRIVATE
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
target_compile_definitions(
common
PRIVATE # The standard library doesn't provide any replacement for codecvt
# yet so we can disable this deprecation warning for the time being.
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
target_compile_options(
common
PRIVATE /we4242 # 'identifier': conversion from 'type1' to 'type2', possible
# loss of data
/we4254 # 'operator': conversion from 'type1:field_bits' to
# 'type2:field_bits', possible loss of data
/we4800 # Implicit conversion from 'type' to bool. Possible
# information loss
)
else()
set_source_files_properties(stb.cpp PROPERTIES COMPILE_OPTIONS "-Wno-implicit-fallthrough;-Wno-missing-declarations;-Wno-missing-field-initializers")
set_source_files_properties(
stb.cpp
PROPERTIES
COMPILE_OPTIONS
"-Wno-implicit-fallthrough;-Wno-missing-declarations;-Wno-missing-field-initializers"
)
# Get around GCC failing with intrinsics in Debug
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug")
set_property(
SOURCE stb.cpp
APPEND
PROPERTY COMPILE_OPTIONS ";-O2"
)
PROPERTY COMPILE_OPTIONS ";-O2")
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(common PRIVATE
-fsized-deallocation
-Werror=unreachable-code-aggressive
)
target_compile_definitions(common PRIVATE
# Clang 14 and earlier have errors when explicitly instantiating Settings::Setting
target_compile_options(common PRIVATE -fsized-deallocation
-Werror=unreachable-code-aggressive)
target_compile_definitions(
common
PRIVATE
# Clang 14 and earlier have errors when explicitly instantiating
# Settings::Setting
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,15>:CANNOT_EXPLICITLY_INSTANTIATE>
)
endif()
target_link_libraries(common PUBLIC Boost::headers fmt::fmt microprofile stb::headers Threads::Threads)
target_link_libraries(common PUBLIC Boost::headers fmt::fmt microprofile
stb::headers Threads::Threads)
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
if(ANDROID)

View file

@ -20,6 +20,8 @@
#ifdef __unix__
#include <csignal>
#include <sys/socket.h>
#endif
#ifdef __linux__
#include "common/linux/gamemode.h"
#endif
@ -37,8 +39,8 @@
#include "configuration/configure_input.h"
#include "configuration/configure_per_game.h"
#include "configuration/configure_tas.h"
#include "core/file_sys/romfs_factory.h"
#include "core/core_timing.h"
#include "core/file_sys/romfs_factory.h"
#include "core/file_sys/vfs/vfs.h"
#include "core/file_sys/vfs/vfs_real.h"
#include "core/frontend/applets/cabinet.h"
@ -313,8 +315,7 @@ bool GMainWindow::CheckDarkMode() {
GMainWindow::GMainWindow(bool has_broken_vulkan)
: ui{std::make_unique<Ui::MainWindow>()}, system{std::make_unique<Core::System>()},
input_subsystem{std::make_shared<InputCommon::InputSubsystem>()},
user_data_migrator{this},
input_subsystem{std::make_shared<InputCommon::InputSubsystem>()}, user_data_migrator{this},
vfs{std::make_shared<FileSys::RealVfsFilesystem>()},
provider{std::make_unique<FileSys::ManualContentProvider>()} {
Common::FS::CreateEdenPaths();
@ -322,7 +323,8 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
if (user_data_migrator.migrated) {
// Sort-of hack whereby we only move the old dir if it's a subfolder of the user dir
#define MIGRATE_DIR(type) std::string type##path = Common::FS::GetEdenPathString(Common::FS::EdenPath::type##Dir); \
#define MIGRATE_DIR(type) \
std::string type##path = Common::FS::GetEdenPathString(Common::FS::EdenPath::type##Dir); \
if (type##path.starts_with(user_data_migrator.selected_emu.get_user_dir())) { \
boost::replace_all(type##path, user_data_migrator.selected_emu.lower_name(), "eden"); \
Common::FS::SetEdenPath(Common::FS::EdenPath::type##Dir, type##path); \
@ -338,8 +340,12 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
#ifdef __unix__
SetupSigInterrupts();
#endif
#ifdef __linux__
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
#endif
UISettings::RestoreWindowState(config);
system->Initialize();
@ -436,8 +442,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
#ifdef ENABLE_QT_UPDATE_CHECKER
if (UISettings::values.check_for_updates) {
update_future = QtConcurrent::run([]() -> QString {
const bool is_prerelease =
((strstr(Common::g_build_version, "pre-alpha") != NULL) ||
const bool is_prerelease = ((strstr(Common::g_build_version, "pre-alpha") != NULL) ||
(strstr(Common::g_build_version, "alpha") != NULL) ||
(strstr(Common::g_build_version, "beta") != NULL) ||
(strstr(Common::g_build_version, "rc") != NULL));
@ -1667,7 +1672,8 @@ void GMainWindow::ConnectMenuEvents() {
connect_menu(ui->action_Load_Home_Menu, &GMainWindow::OnHomeMenu);
connect_menu(ui->action_Open_Setup, &GMainWindow::OnInitialSetup);
connect_menu(ui->action_Desktop, &GMainWindow::OnCreateHomeMenuDesktopShortcut);
connect_menu(ui->action_Application_Menu, &GMainWindow::OnCreateHomeMenuApplicationMenuShortcut);
connect_menu(ui->action_Application_Menu,
&GMainWindow::OnCreateHomeMenuApplicationMenuShortcut);
connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot);
// TAS
@ -1872,7 +1878,6 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
system->GetUserChannel().clear();
}
system->SetFrontendAppletSet({
std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
(UISettings::values.controller_applet_disabled.GetValue() == true)
@ -1894,12 +1899,14 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
QSettings settings;
QStringList currentIgnored = settings.value("ignoredBadUpdates", {}).toStringList();
if (std::find(bad_update_games.begin(), bad_update_games.end(), params.program_id) != bad_update_games.end()
&& !currentIgnored.contains(QString::number(params.program_id))) {
if (std::find(bad_update_games.begin(), bad_update_games.end(), params.program_id) !=
bad_update_games.end() &&
!currentIgnored.contains(QString::number(params.program_id))) {
QMessageBox* msg = new QMessageBox(this);
msg->setWindowTitle(tr("Game Updates Warning"));
msg->setIcon(QMessageBox::Warning);
msg->setText(tr("The game you are trying to launch is known to have performance or booting "
msg->setText(
tr("The game you are trying to launch is known to have performance or booting "
"issues when updates are applied. Please try increasing the memory layout to "
"6GB or 8GB if any issues occur.<br><br>Press \"OK\" to continue launching, or "
"\"Cancel\" to cancel the launch."));
@ -1913,7 +1920,8 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
int result = msg->exec();
// wtf
QMessageBox::ButtonRole role = msg->buttonRole(msg->button((QMessageBox::StandardButton) result));
QMessageBox::ButtonRole role =
msg->buttonRole(msg->button((QMessageBox::StandardButton)result));
switch (role) {
case QMessageBox::RejectRole:
@ -1929,11 +1937,13 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
}
}
if (FirmwareManager::GameRequiresFirmware(params.program_id) && !FirmwareManager::CheckFirmwarePresence(*system)) {
if (FirmwareManager::GameRequiresFirmware(params.program_id) &&
!FirmwareManager::CheckFirmwarePresence(*system)) {
QMessageBox* msg = new QMessageBox(this);
msg->setWindowTitle(tr("Game Requires Firmware"));
msg->setIcon(QMessageBox::Warning);
msg->setText(tr("The game you are trying to launch requires firmware to boot or to get past the "
msg->setText(
tr("The game you are trying to launch requires firmware to boot or to get past the "
"opening menu. Please <a href='https://yuzu-mirror.github.io/help/quickstart'>"
"dump and install firmware</a>, or press \"OK\" to launch anyways."));
@ -1941,7 +1951,8 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
int exec_result = msg->exec();
QMessageBox::ButtonRole role = msg->buttonRole(msg->button((QMessageBox::StandardButton) exec_result));
QMessageBox::ButtonRole role =
msg->buttonRole(msg->button((QMessageBox::StandardButton)exec_result));
switch (role) {
case QMessageBox::RejectRole:
@ -1970,7 +1981,8 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
"outdated format that has been superseded by others such as NCA, NAX, XCI, or "
"NSP. Deconstructed ROM directories lack icons, metadata, and update "
"support.<br><br>For an explanation of the various Switch formats Eden supports, <a "
"href='https://eden-emulator.github.io/wiki/overview-of-switch-game-formats'>check out our "
"href='https://eden-emulator.github.io/wiki/overview-of-switch-game-formats'>check "
"out our "
"wiki</a>. This message will not be shown again."));
}
@ -2300,7 +2312,7 @@ void GMainWindow::OnEmulationStopped() {
discord_rpc->Update();
#ifdef __unix__
#ifdef __linux__
Common::Linux::StopGamemode();
#endif
@ -2996,7 +3008,8 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
directory = it->second.second;
}
QDesktopServices::openUrl(QUrl(QStringLiteral("https://eden-emulator.github.io/game/") + directory));
QDesktopServices::openUrl(
QUrl(QStringLiteral("https://eden-emulator.github.io/game/") + directory));
}
bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
@ -3485,7 +3498,7 @@ void GMainWindow::OnStartGame() {
discord_rpc->Update();
#ifdef __unix__
#ifdef __linux__
Common::Linux::StartGamemode();
#endif
}
@ -3509,7 +3522,7 @@ void GMainWindow::OnPauseGame() {
UpdateMenuState();
AllowOSSleep();
#ifdef __unix__
#ifdef __linux__
Common::Linux::StopGamemode();
#endif
}
@ -3621,7 +3634,8 @@ void GMainWindow::OnMenuReportCompatibility() {
} else {
QMessageBox::critical(
this, tr("Missing yuzu Account"),
tr("In order to submit a game compatibility test case, you must set up your web token and "
tr("In order to submit a game compatibility test case, you must set up your web token "
"and "
"username.<br><br/>To link your eden account, go to Emulation &gt; Configuration "
"&gt; "
"Web."));
@ -3653,8 +3667,7 @@ void GMainWindow::OnOpenFAQ() {
OpenURL(QUrl(QStringLiteral("https://eden-emu.dev")));
}
void GMainWindow::OnOpenDiscord()
{
void GMainWindow::OnOpenDiscord() {
OpenURL(QUrl(QStringLiteral("https://discord.gg/edenemu")));
}
@ -3798,7 +3811,7 @@ 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__
#ifdef __linux__
const bool old_gamemode = Settings::values.enable_gamemode.GetValue();
#endif
@ -3860,7 +3873,7 @@ void GMainWindow::OnConfigure() {
if (UISettings::values.enable_discord_presence.GetValue() != old_discord_presence) {
SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue());
}
#ifdef __unix__
#ifdef __linux__
if (Settings::values.enable_gamemode.GetValue() != old_gamemode) {
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
}
@ -4185,30 +4198,26 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
}
void GMainWindow::OnOpenRootDataFolder() {
QDesktopServices::openUrl(QUrl(
QString::fromStdString(Common::FS::GetEdenPathString(Common::FS::EdenPath::EdenDir))));
QDesktopServices::openUrl(
QUrl(QString::fromStdString(Common::FS::GetEdenPathString(Common::FS::EdenPath::EdenDir))));
}
void GMainWindow::OnOpenNANDFolder()
{
void GMainWindow::OnOpenNANDFolder() {
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdString(Common::FS::GetEdenPathString(Common::FS::EdenPath::NANDDir))));
}
void GMainWindow::OnOpenSDMCFolder()
{
void GMainWindow::OnOpenSDMCFolder() {
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdString(Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir))));
}
void GMainWindow::OnOpenModFolder()
{
void GMainWindow::OnOpenModFolder() {
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdString(Common::FS::GetEdenPathString(Common::FS::EdenPath::LoadDir))));
}
void GMainWindow::OnOpenLogFolder()
{
void GMainWindow::OnOpenLogFolder() {
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdString(Common::FS::GetEdenPathString(Common::FS::EdenPath::LogDir))));
}
@ -4243,8 +4252,7 @@ void GMainWindow::OnVerifyInstalledContents() {
}
}
void GMainWindow::InstallFirmware(const QString &location, bool recursive)
{
void GMainWindow::InstallFirmware(const QString& location, bool recursive) {
QProgressDialog progress(tr("Installing Firmware..."), tr("Cancel"), 0, 100, this);
progress.setWindowModality(Qt::WindowModal);
progress.setMinimumDuration(100);
@ -4281,9 +4289,11 @@ void GMainWindow::InstallFirmware(const QString &location, bool recursive)
QtProgressCallback(100, 10);
if (recursive) {
Common::FS::IterateDirEntriesRecursively(firmware_source_path, callback, Common::FS::DirEntryFilter::File);
Common::FS::IterateDirEntriesRecursively(firmware_source_path, callback,
Common::FS::DirEntryFilter::File);
} else {
Common::FS::IterateDirEntries(firmware_source_path, callback, Common::FS::DirEntryFilter::File);
Common::FS::IterateDirEntries(firmware_source_path, callback,
Common::FS::DirEntryFilter::File);
}
if (out.size() <= 0) {
@ -4391,8 +4401,7 @@ void GMainWindow::OnInstallFirmware() {
InstallFirmware(firmware_source_location);
}
void GMainWindow::OnInstallFirmwareFromZIP()
{
void GMainWindow::OnInstallFirmwareFromZIP() {
// Don't do this while emulation is running, that'd probably be a bad idea.
if (emu_thread != nullptr && emu_thread->IsRunning()) {
return;
@ -4442,17 +4451,18 @@ void GMainWindow::OnInstallFirmwareFromZIP()
if (ec) {
QMessageBox::warning(this, tr("Firmware cleanup failed"),
tr("Failed to clean up extracted firmware cache.\n"
"Check write permissions in the system temp directory and try again.\nOS reported error: %1")
"Check write permissions in the system temp directory and try "
"again.\nOS reported error: %1")
.arg(QString::fromStdString(ec.message())));
}
return;
}
unzipFailed:
QMessageBox::critical(this, tr("Firmware unzip failed"),
QMessageBox::critical(
this, tr("Firmware unzip failed"),
tr("Check write permissions in the system temp directory and try again."));
return;
}
void GMainWindow::OnInstallDecryptionKeys() {
@ -4468,7 +4478,8 @@ void GMainWindow::OnInstallDecryptionKeys() {
return;
}
FirmwareManager::KeyInstallResult result = FirmwareManager::InstallKeys(key_source_location.toStdString(), "keys");
FirmwareManager::KeyInstallResult result =
FirmwareManager::InstallKeys(key_source_location.toStdString(), "keys");
system->GetFileSystemController().CreateFactories(*vfs);
game_list->PopulateAsync(UISettings::values.game_dirs);
@ -4479,8 +4490,7 @@ void GMainWindow::OnInstallDecryptionKeys() {
tr("Decryption Keys were successfully installed"));
break;
default:
QMessageBox::critical(
this, tr("Decryption Keys install failed"),
QMessageBox::critical(this, tr("Decryption Keys install failed"),
tr(FirmwareManager::GetKeyInstallResultString(result)));
break;
}
@ -4507,8 +4517,7 @@ void GMainWindow::OnToggleStatusBar() {
statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
}
void GMainWindow::OnGameListRefresh()
{
void GMainWindow::OnGameListRefresh() {
// force reload add-ons etc
game_list->ForceRefreshGameDirectory();
}
@ -4631,8 +4640,7 @@ void GMainWindow::OnHomeMenu() {
BootGame(filename, LibraryAppletParameters(QLaunchId, Service::AM::AppletId::QLaunch));
}
void GMainWindow::OnInitialSetup()
{
void GMainWindow::OnInitialSetup() {
constexpr u64 Starter = static_cast<u64>(Service::AM::AppletProgramId::Starter);
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
if (!bis_system) {
@ -4655,18 +4663,15 @@ void GMainWindow::OnInitialSetup()
BootGame(filename, LibraryAppletParameters(Starter, Service::AM::AppletId::Starter));
}
void GMainWindow::OnCreateHomeMenuDesktopShortcut()
{
void GMainWindow::OnCreateHomeMenuDesktopShortcut() {
OnCreateHomeMenuShortcut(GameListShortcutTarget::Desktop);
}
void GMainWindow::OnCreateHomeMenuApplicationMenuShortcut()
{
void GMainWindow::OnCreateHomeMenuApplicationMenuShortcut() {
OnCreateHomeMenuShortcut(GameListShortcutTarget::Applications);
}
std::filesystem::path GMainWindow::GetEdenCommand()
{
std::filesystem::path GMainWindow::GetEdenCommand() {
std::filesystem::path command;
QString appimage = QString::fromLocal8Bit(getenv("APPIMAGE"));
@ -4685,8 +4690,7 @@ std::filesystem::path GMainWindow::GetEdenCommand()
return command;
}
std::filesystem::path GMainWindow::GetShortcutPath(GameListShortcutTarget target)
{
std::filesystem::path GMainWindow::GetShortcutPath(GameListShortcutTarget target) {
std::filesystem::path shortcut_path{};
if (target == GameListShortcutTarget::Desktop) {
shortcut_path =
@ -4699,7 +4703,9 @@ std::filesystem::path GMainWindow::GetShortcutPath(GameListShortcutTarget target
return shortcut_path;
}
void GMainWindow::CreateShortcut(const std::string &game_path, const u64 program_id, const std::string& game_title_, GameListShortcutTarget target, std::string arguments_, const bool needs_title) {
void GMainWindow::CreateShortcut(const std::string& game_path, const u64 program_id,
const std::string& game_title_, GameListShortcutTarget target,
std::string arguments_, const bool needs_title) {
// Get path to yuzu executable
std::filesystem::path command = GetEdenCommand();
@ -4780,8 +4786,8 @@ void GMainWindow::CreateShortcut(const std::string &game_path, const u64 program
const std::string categories = "Game;Emulator;Qt;";
const std::string keywords = "Switch;Nintendo;";
if (GMainWindow::CreateShortcutLink(shortcut_path, comment, out_icon_path, command,
arguments, categories, keywords, game_title)) {
if (GMainWindow::CreateShortcutLink(shortcut_path, comment, out_icon_path, command, arguments,
categories, keywords, game_title)) {
GMainWindow::CreateShortcutMessagesGUI(this, GMainWindow::CREATE_SHORTCUT_MSGBOX_SUCCESS,
qgame_title);
return;
@ -4790,8 +4796,7 @@ void GMainWindow::CreateShortcut(const std::string &game_path, const u64 program
qgame_title);
}
void GMainWindow::OnCreateHomeMenuShortcut(GameListShortcutTarget target)
{
void GMainWindow::OnCreateHomeMenuShortcut(GameListShortcutTarget target) {
constexpr u64 QLaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
if (!bis_system) {
@ -4884,8 +4889,8 @@ void GMainWindow::OnEmulatorUpdateAvailable() {
update_prompt.setIcon(QMessageBox::Information);
update_prompt.addButton(QMessageBox::Yes);
update_prompt.addButton(QMessageBox::Ignore);
update_prompt.setText(tr("Update %1 for Eden is available.\nWould you like to download it?")
.arg(version_string));
update_prompt.setText(
tr("Update %1 for Eden is available.\nWould you like to download it?").arg(version_string));
update_prompt.exec();
if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) {
QDesktopServices::openUrl(
@ -5015,7 +5020,8 @@ void GMainWindow::UpdateStatusBar() {
}
game_fps_label->setText(
tr("Game: %1 FPS").arg(std::round(results.average_game_fps), 0, 'f', 0) + tr(Settings::values.use_speed_limit ? "" : " (Unlocked)"));
tr("Game: %1 FPS").arg(std::round(results.average_game_fps), 0, 'f', 0) +
tr(Settings::values.use_speed_limit ? "" : " (Unlocked)"));
emu_frametime_label->setText(tr("Frame: %1 ms").arg(results.frametime * 1000.0, 0, 'f', 2));
@ -5142,24 +5148,21 @@ void GMainWindow::OnMouseActivity() {
void GMainWindow::OnCheckFirmwareDecryption() {
system->GetFileSystemController().CreateFactories(*vfs);
if (!ContentManager::AreKeysPresent()) {
QMessageBox::warning(
this, tr("Derivation Components Missing"),
QMessageBox::warning(this, tr("Derivation Components Missing"),
tr("Encryption keys are missing."));
}
SetFirmwareVersion();
UpdateMenuState();
}
void GMainWindow::OnCheckFirmware()
{
void GMainWindow::OnCheckFirmware() {
auto result = FirmwareManager::VerifyFirmware(*system.get());
switch (result) {
case FirmwareManager::FirmwareGood:
break;
default:
QMessageBox::warning(
this, tr("Firmware Read Error"),
QMessageBox::warning(this, tr("Firmware Read Error"),
tr(FirmwareManager::GetFirmwareCheckString(result)));
break;
}
@ -5476,7 +5479,7 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
discord_rpc->Update();
}
#ifdef __unix__
#ifdef __linux__
void GMainWindow::SetGamemodeEnabled(bool state) {
if (emulation_running) {
Common::Linux::SetGamemodeState(state);

View file

@ -68,7 +68,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
#ifdef __unix__
#ifdef __linux__
#include "common/linux/gamemode.h"
#endif
@ -410,9 +410,7 @@ int main(int argc, char** argv) {
"While attempting to load the ROM requested, an error occurred. Please "
"refer to the Eden wiki for more information or the Eden discord for "
"additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}",
loader_id,
error_id,
static_cast<Loader::ResultStatus>(error_id));
loader_id, error_id, static_cast<Loader::ResultStatus>(error_id));
}
break;
}
@ -447,7 +445,7 @@ int main(int argc, char** argv) {
exit(0);
});
#ifdef __unix__
#ifdef __linux__
Common::Linux::StartGamemode();
#endif
@ -462,7 +460,7 @@ int main(int argc, char** argv) {
void(system.Pause());
system.ShutdownMainProcess();
#ifdef __unix__
#ifdef __linux__
Common::Linux::StopGamemode();
#endif