From dfa56765d6d869a317ec46dcf3a8f4f35b146382 Mon Sep 17 00:00:00 2001 From: xcfrg <30675315+xcfrg@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:45:33 -0400 Subject: yuzu: integrate gamemode support on linux --- src/yuzu_cmd/yuzu.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/yuzu_cmd/yuzu.cpp') 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 +#endif + static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] \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; } -- cgit v1.2.3