From 0d2f07315248a38febec3b015673e3421a787c49 Mon Sep 17 00:00:00 2001 From: emmauss Date: Fri, 23 Mar 2018 14:26:11 +0200 Subject: [PATCH] implement isession:getperformanceconfiguration (#64) --- Ryujinx.Core/OsHle/Services/Apm/ISession.cs | 16 +++++++++++++--- .../Services/Apm/PerformanceConfiguration.cs | 18 ++++++++++++++++++ .../OsHle/Services/Apm/PerformanceMode.cs | 8 ++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 Ryujinx.Core/OsHle/Services/Apm/PerformanceConfiguration.cs create mode 100644 Ryujinx.Core/OsHle/Services/Apm/PerformanceMode.cs diff --git a/Ryujinx.Core/OsHle/Services/Apm/ISession.cs b/Ryujinx.Core/OsHle/Services/Apm/ISession.cs index a2faa01a4..850ce803f 100644 --- a/Ryujinx.Core/OsHle/Services/Apm/ISession.cs +++ b/Ryujinx.Core/OsHle/Services/Apm/ISession.cs @@ -13,14 +13,24 @@ namespace Ryujinx.Core.OsHle.Services.Apm { m_Commands = new Dictionary() { - { 0, SetPerformanceConfiguration } + { 0, SetPerformanceConfiguration }, + { 1, GetPerformanceConfiguration } }; } public long SetPerformanceConfiguration(ServiceCtx Context) { - int PerfMode = Context.RequestData.ReadInt32(); - int PerfConfig = Context.RequestData.ReadInt32(); + PerformanceMode PerfMode = (PerformanceMode)Context.RequestData.ReadInt32(); + PerformanceConfiguration PerfConfig = (PerformanceConfiguration)Context.RequestData.ReadInt32(); + + return 0; + } + + public long GetPerformanceConfiguration(ServiceCtx Context) + { + PerformanceMode PerfMode = (PerformanceMode)Context.RequestData.ReadInt32(); + + Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1); return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Apm/PerformanceConfiguration.cs b/Ryujinx.Core/OsHle/Services/Apm/PerformanceConfiguration.cs new file mode 100644 index 000000000..5a4d072e2 --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Apm/PerformanceConfiguration.cs @@ -0,0 +1,18 @@ +namespace Ryujinx.Core.OsHle.Services.Apm +{ + enum PerformanceConfiguration : uint + { + PerformanceConfiguration1 = 0x00010000, + PerformanceConfiguration2 = 0x00010001, + PerformanceConfiguration3 = 0x00010002, + PerformanceConfiguration4 = 0x00020000, + PerformanceConfiguration5 = 0x00020001, + PerformanceConfiguration6 = 0x00020002, + PerformanceConfiguration7 = 0x00020003, + PerformanceConfiguration8 = 0x00020004, + PerformanceConfiguration9 = 0x00020005, + PerformanceConfiguration10 = 0x00020006, + PerformanceConfiguration11 = 0x92220007, + PerformanceConfiguration12 = 0x92220008 + } +} diff --git a/Ryujinx.Core/OsHle/Services/Apm/PerformanceMode.cs b/Ryujinx.Core/OsHle/Services/Apm/PerformanceMode.cs new file mode 100644 index 000000000..db6ef4072 --- /dev/null +++ b/Ryujinx.Core/OsHle/Services/Apm/PerformanceMode.cs @@ -0,0 +1,8 @@ +namespace Ryujinx.Core.OsHle.Services.Apm +{ + enum PerformanceMode + { + Handheld = 0, + Docked = 1 + } +}