summaryrefslogtreecommitdiffstats
path: root/src/yuzu_cmd
diff options
context:
space:
mode:
authorxcfrg <30675315+xcfrg@users.noreply.github.com>2023-07-17 00:45:33 +0200
committerflodavid <fl.david.53@gmail.com>2023-11-25 19:30:29 +0100
commitdfa56765d6d869a317ec46dcf3a8f4f35b146382 (patch)
tree827c46ada3f60e9bdef93c25a26319f00377d15f /src/yuzu_cmd
parentMerge pull request #11889 from t895/ini-lib (diff)
downloadyuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.tar
yuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.tar.gz
yuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.tar.bz2
yuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.tar.lz
yuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.tar.xz
yuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.tar.zst
yuzu-dfa56765d6d869a317ec46dcf3a8f4f35b146382.zip
Diffstat (limited to 'src/yuzu_cmd')
-rw-r--r--src/yuzu_cmd/CMakeLists.txt1
-rw-r--r--src/yuzu_cmd/yuzu.cpp24
2 files changed, 25 insertions, 0 deletions
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt
index fbeba8813..002f3e841 100644
--- a/src/yuzu_cmd/CMakeLists.txt
+++ b/src/yuzu_cmd/CMakeLists.txt
@@ -44,6 +44,7 @@ target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
if(UNIX AND NOT APPLE)
install(TARGETS yuzu-cmd)
+ target_link_libraries(yuzu-cmd PRIVATE gamemode)
endif()
if(WIN32)
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 0416d5951..1c3a1809b 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -63,6 +63,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
+#ifdef __linux__
+#include <gamemode_client.h>
+#endif
+
static void PrintHelp(const char* argv0) {
std::cout << "Usage: " << argv0
<< " [options] <filename>\n"
@@ -425,6 +429,16 @@ int main(int argc, char** argv) {
exit(0);
});
+#ifdef __linux__
+ if (Settings::values.disable_gamemode) {
+ if (gamemode_request_start() < 0) {
+ LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string());
+ } else {
+ LOG_INFO(Frontend, "Started gamemode");
+ }
+ }
+#endif
+
void(system.Run());
if (system.DebuggerEnabled()) {
system.InitializeDebugger();
@@ -436,6 +450,16 @@ int main(int argc, char** argv) {
void(system.Pause());
system.ShutdownMainProcess();
+#ifdef __linux__
+ if (Settings::values.disable_gamemode) {
+ if (gamemode_request_end() < 0) {
+ LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string());
+ } else {
+ LOG_INFO(Frontend, "Stopped gamemode");
+ }
+ }
+#endif
+
detached_tasks.WaitForAllTasks();
return 0;
}