diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 417bef41b8..1053be3b3e 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -112,6 +112,8 @@ struct EmuCallbacks std::function enable_display_sleep; std::function check_microphone_permissions; std::function()> make_video_source; + std::function gamemode_supported; + std::function enable_gamemode; }; namespace utils diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index 2b35e70cb9..066f3f5798 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -358,7 +358,7 @@ struct cfg_root : cfg::node cfg::_bool silence_all_logs{ this, "Silence All Logs", false, true }; cfg::string title_format{ this, "Window Title Format", "FPS: %F | %R | %V | %T [%t]", true }; cfg::_bool pause_during_home_menu{this, "Pause Emulation During Home Menu", false, false }; - cfg::_bool enable_gamemode{ this, "Enable GameMode", false, false }; + cfg::_bool enable_gamemode{ this, "Enable GameMode", false, true }; } misc{ this }; diff --git a/rpcs3/gamemode_control.cpp b/rpcs3/gamemode_control.cpp index 9d13f42e97..9ca665cccb 100644 --- a/rpcs3/gamemode_control.cpp +++ b/rpcs3/gamemode_control.cpp @@ -17,18 +17,23 @@ bool gamemode_supported() #endif } -// Enables GameMode -// Returns -2 if Gamemode isn't supported. -// Returns the value of gamemode_request_start() otherwise. -// This is either 0 or -1 depending on whether gamemode was successfully enabled or not respectively. -int enable_gamemode(bool enabled) { +// TODO: Might add later +/* +static int gamemode_status() { + return gamemode_query_status(); +} +*/ + +// Enables and Disables GameMode based on user settings and system +void enable_gamemode(bool enabled) { if (!gamemode_supported()) { - return -2; + return; } - // Enable Gamemode + // Enable and Disable Gamemode if (enabled) { - u8 s_gamemode_start = gamemode_request_start(); - return s_gamemode_start; + gamemode_request_start(); + } else { + gamemode_request_end(); } } diff --git a/rpcs3/gamemode_control.h b/rpcs3/gamemode_control.h index f447a953a4..091bacd676 100644 --- a/rpcs3/gamemode_control.h +++ b/rpcs3/gamemode_control.h @@ -1,4 +1,5 @@ #pragma once bool gamemode_supported(); -int enable_gamemode(bool enabled); +void enable_gamemode(bool enabled); +//static int gamemode_status(); // Might add later TODO diff --git a/rpcs3/main_application.cpp b/rpcs3/main_application.cpp index 65a8117b7f..137b82d803 100644 --- a/rpcs3/main_application.cpp +++ b/rpcs3/main_application.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "main_application.h" #include "display_sleep_control.h" +#include "gamemode_control.h" #include "util/types.hpp" #include "util/logs.hpp" diff --git a/rpcs3/rpcs3qt/gui_application.cpp b/rpcs3/rpcs3qt/gui_application.cpp index 82f29fcdbd..970d139782 100644 --- a/rpcs3/rpcs3qt/gui_application.cpp +++ b/rpcs3/rpcs3qt/gui_application.cpp @@ -15,6 +15,7 @@ #include "qt_music_handler.h" #include "rpcs3_version.h" #include "display_sleep_control.h" +#include "gamemode_control.h" #ifdef WITH_DISCORD_RPC #include "_discord_utils.h"