diff options
| author | Ac_K <Acoustik666@gmail.com> | 2020-11-08 21:00:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-08 17:00:54 -0300 |
| commit | eda6b78894eef3d9dc1e8ea6984e2f5bd319d68e (patch) | |
| tree | 546394d268af11a550a01099014747fa8fbdcf23 /Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy | |
| parent | 8d168574eb04ae1e7026ac2b058e3b184f068fae (diff) | |
apm/am: Refactoring/Unstub services (#1662)
* apm: Refactoring/Unstub service
This PR implement some IPC calls of apm service:
- nn::apm::IManager is fully implemented.
- nn::apm::ISession is fully implemented (close #1633).
- nn::apm::ISystemManager is partially implemented.
nn::appletAE::ICommonStateGetter have some calls which are just a layer of apm IPC calls. What we did in some calls was wrong, it's fixed now!
Everything is checked with RE.
* abstract Apm *Server as Thog requested
* abstract ISession and fix other classes
* Address gdkchan feedback
* Fix class
* Fix Logging
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs index a2113163..82e18922 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs @@ -2,17 +2,22 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Threading; -using Ryujinx.HLE.HOS.Services.Apm; using System; namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy { class ICommonStateGetter : IpcService { - private CpuBoostMode _cpuBoostMode = CpuBoostMode.Disabled; - private bool _vrModeEnabled = false; + private Apm.ManagerServer apmManagerServer; + private Apm.SystemManagerServer apmSystemManagerServer; - public ICommonStateGetter() { } + private bool _vrModeEnabled = false; + + public ICommonStateGetter(ServiceCtx context) + { + apmManagerServer = new Apm.ManagerServer(context); + apmSystemManagerServer = new Apm.SystemManagerServer(context); + } [Command(0)] // GetEventHandle() -> handle<copy> @@ -58,16 +63,10 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys } [Command(6)] - // GetPerformanceMode() -> u32 + // GetPerformanceMode() -> nn::apm::PerformanceMode public ResultCode GetPerformanceMode(ServiceCtx context) { - PerformanceMode mode = context.Device.System.State.DockedMode - ? PerformanceMode.Docked - : PerformanceMode.Handheld; - - context.ResponseData.Write((int)mode); - - return ResultCode.Success; + return (ResultCode)apmManagerServer.GetPerformanceMode(context); } [Command(8)] @@ -136,12 +135,18 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys return ResultCode.InvalidParameters; } - _cpuBoostMode = (CpuBoostMode)cpuBoostMode; + apmSystemManagerServer.SetCpuBoostMode((Apm.CpuBoostMode)cpuBoostMode); - // NOTE: There is a condition variable after the assignment, probably waiting something with apm:sys service (SetCpuBoostMode call?). - // Since we will probably never support CPU boost things, it's not needed to implement more. + // TODO: It signals an internal event of ICommonStateGetter. We have to determine where this event is used. return ResultCode.Success; } + + [Command(91)] // 7.0.0+ + // GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration + public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context) + { + return (ResultCode)apmSystemManagerServer.GetCurrentPerformanceConfiguration(context); + } } }
\ No newline at end of file |
