aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Am
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2023-05-06 03:33:50 +0200
committerGitHub <noreply@github.com>2023-05-06 03:33:50 +0200
commitfab11ba3f1fec3e3827a8350791d76d2fcd50173 (patch)
tree066f2e9a31ac721981e192532f37e34d64d22da0 /src/Ryujinx.HLE/HOS/Services/Am
parent332891b5ff44a2f7647da2c59c600ac6a88e36d5 (diff)
AM: Stub some service calls (#4825)1.1.762
* AM: Stub some service call Some IPC I have stubbed during private testing and I don't want to deal with them anymore. Nothing more. * ICommonStateGetter disposable
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Am')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs9
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs51
2 files changed, 59 insertions, 1 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs
index dc26d80c..93dff041 100644
--- a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs
@@ -92,6 +92,15 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
return ResultCode.Success;
}
+ [CommandCmif(23)]
+ // GetAppletCommonFunctions() -> object<nn::am::service::IAppletCommonFunctions>
+ public ResultCode GetAppletCommonFunctions(ServiceCtx context)
+ {
+ MakeObject(context, new IAppletCommonFunctions());
+
+ return ResultCode.Success;
+ }
+
[CommandCmif(1000)]
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
public ResultCode GetDebugFunctions(ServiceCtx context)
diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
index 381267b0..5e7d0bae 100644
--- a/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
@@ -9,8 +9,10 @@ using System;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{
- class ICommonStateGetter : IpcService
+ class ICommonStateGetter : DisposableIpcService
{
+ private readonly ServiceCtx _context;
+
private Apm.ManagerServer _apmManagerServer;
private Apm.SystemManagerServer _apmSystemManagerServer;
private Lbl.LblControllerServer _lblControllerServer;
@@ -23,11 +25,18 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
private int _messageEventHandle;
private int _displayResolutionChangedEventHandle;
+ private KEvent _acquiredSleepLockEvent;
+ private int _acquiredSleepLockEventHandle;
+
public ICommonStateGetter(ServiceCtx context)
{
+ _context = context;
+
_apmManagerServer = new Apm.ManagerServer(context);
_apmSystemManagerServer = new Apm.SystemManagerServer(context);
_lblControllerServer = new Lbl.LblControllerServer(context);
+
+ _acquiredSleepLockEvent = new KEvent(context.Device.System.KernelContext);
}
[CommandCmif(0)]
@@ -117,6 +126,34 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success;
}
+ [CommandCmif(10)]
+ // RequestToAcquireSleepLock()
+ public ResultCode RequestToAcquireSleepLock(ServiceCtx context)
+ {
+ Logger.Stub?.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [CommandCmif(13)]
+ // GetAcquiredSleepLockEvent() -> handle<copy>
+ public ResultCode GetAcquiredSleepLockEvent(ServiceCtx context)
+ {
+ if (_acquiredSleepLockEventHandle == 0)
+ {
+ if (context.Process.HandleTable.GenerateHandle(_acquiredSleepLockEvent.ReadableEvent, out _acquiredSleepLockEventHandle) != Result.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
+ }
+
+ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_acquiredSleepLockEventHandle);
+
+ Logger.Stub?.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
[CommandCmif(50)] // 3.0.0+
// IsVrModeEnabled() -> b8
public ResultCode IsVrModeEnabled(ServiceCtx context)
@@ -281,5 +318,17 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
return ResultCode.Success;
}
+
+ protected override void Dispose(bool isDisposing)
+ {
+ if (isDisposing)
+ {
+ if (_acquiredSleepLockEventHandle != 0)
+ {
+ _context.Process.HandleTable.CloseHandle(_acquiredSleepLockEventHandle);
+ _acquiredSleepLockEventHandle = 0;
+ }
+ }
+ }
}
} \ No newline at end of file