From aa44c4a244f4b2aa0b5e4007493be675e279119f Mon Sep 17 00:00:00 2001 From: greggameplayer <33609333+greggameplayer@users.noreply.github.com> Date: Sun, 8 Jul 2018 00:43:55 +0200 Subject: [PATCH] Add a toggleable DockedMode bool --- .../OsHle/Services/Am/ICommonStateGetter.cs | 15 ++++++++++++--- Ryujinx.HLE/OsHle/SystemStateMgr.cs | 4 +++- Ryujinx/Config.cs | 4 ++++ Ryujinx/Ryujinx.conf | 5 ++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs b/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs index e1a13c5979..70d0d56792 100644 --- a/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs +++ b/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs @@ -3,6 +3,7 @@ using Ryujinx.HLE.OsHle.Handles; using Ryujinx.HLE.OsHle.Ipc; using System.Collections.Generic; +using static Ryujinx.HLE.OsHle.SystemStateMgr; using static Ryujinx.HLE.OsHle.ErrorCode; namespace Ryujinx.HLE.OsHle.Services.Am @@ -57,14 +58,22 @@ namespace Ryujinx.HLE.OsHle.Services.Am public long GetOperationMode(ServiceCtx Context) { - Context.ResponseData.Write((byte)OperationMode.Handheld); + if(DockedMode == false){ + Context.ResponseData.Write((byte)OperationMode.Handheld); + }else{ + Context.ResponseData.Write((byte)OperationMode.Docked); + } return 0; } public long GetPerformanceMode(ServiceCtx Context) { - Context.ResponseData.Write((byte)Apm.PerformanceMode.Handheld); + if(DockedMode == false){ + Context.ResponseData.Write((byte)Apm.PerformanceMode.Handheld); + }else{ + Context.ResponseData.Write((byte)Apm.PerformanceMode.Docked); + } return 0; } @@ -104,4 +113,4 @@ namespace Ryujinx.HLE.OsHle.Services.Am return 0; } } -} \ No newline at end of file +} diff --git a/Ryujinx.HLE/OsHle/SystemStateMgr.cs b/Ryujinx.HLE/OsHle/SystemStateMgr.cs index e78082c45a..c8c44c025f 100644 --- a/Ryujinx.HLE/OsHle/SystemStateMgr.cs +++ b/Ryujinx.HLE/OsHle/SystemStateMgr.cs @@ -35,6 +35,8 @@ namespace Ryujinx.HLE.OsHle internal long DesiredLanguageCode { get; private set; } internal string ActiveAudioOutput { get; private set; } + + public static bool DockedMode = false; public SystemStateMgr() { @@ -81,4 +83,4 @@ namespace Ryujinx.HLE.OsHle return Code; } } -} \ No newline at end of file +} diff --git a/Ryujinx/Config.cs b/Ryujinx/Config.cs index 940753ba53..f359b6f80c 100644 --- a/Ryujinx/Config.cs +++ b/Ryujinx/Config.cs @@ -7,6 +7,8 @@ using System.IO; using System.Linq; using System.Reflection; +using static Ryujinx.HLE.OsHle.SystemStateMgr; + namespace Ryujinx { public static class Config @@ -34,6 +36,8 @@ namespace Ryujinx Log.SetEnable(LogLevel.Info, Convert.ToBoolean(Parser.Value("Logging_Enable_Info"))); Log.SetEnable(LogLevel.Warning, Convert.ToBoolean(Parser.Value("Logging_Enable_Warn"))); Log.SetEnable(LogLevel.Error, Convert.ToBoolean(Parser.Value("Logging_Enable_Error"))); + + DockedMode = Convert.ToBoolean(Parser.Value("Docked_Mode")); GamePadEnable = Convert.ToBoolean(Parser.Value("GamePad_Enable")); GamePadIndex = Convert.ToInt32 (Parser.Value("GamePad_Index")); diff --git a/Ryujinx/Ryujinx.conf b/Ryujinx/Ryujinx.conf index 59f7f859e7..08e4f13070 100644 --- a/Ryujinx/Ryujinx.conf +++ b/Ryujinx/Ryujinx.conf @@ -19,6 +19,9 @@ Logging_Enable_Error = true #Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS` Logging_Filtered_Classes = +#Enable or Disable Docked Mode +Docked_Mode = false + #Controller Device Index GamePad_Index = 0 @@ -79,4 +82,4 @@ Controls_Right_JoyConController_Button_R = RShoulder Controls_Right_JoyConController_Button_ZR = RTrigger Controls_Left_JoyConController_Stick = LJoystick -Controls_Right_JoyConController_Stick = RJoystick \ No newline at end of file +Controls_Right_JoyConController_Stick = RJoystick