aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2019-09-19 02:45:11 +0200
committerjduncanator <1518948+jduncanator@users.noreply.github.com>2019-09-19 10:45:11 +1000
commita0720b5681852f3d786d77bd3793b0359dea321c (patch)
tree9d8f61e540d1d1d827999902dad95e5c0c1e076e /Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy
parent4af3101b22e6957d6aa48a2768566d658699f4ed (diff)
Refactoring HOS folder structure (#771)
* Refactoring HOS folder structure Refactoring HOS folder structure: - Added some subfolders when needed (Following structure decided in private). - Added some `Types` folders when needed. - Little cleanup here and there. - Add services placeholders for every HOS services (close #766 and #753). * Remove Types namespaces
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy')
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IApplicationCreator.cs7
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs66
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs142
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDebugFunctions.cs7
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDisplayController.cs7
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IGlobalStateController.cs7
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs44
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs29
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs200
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs29
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/FocusState.cs8
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs9
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/OperationMode.cs8
13 files changed, 563 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IApplicationCreator.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IApplicationCreator.cs
new file mode 100644
index 00000000..79e5b050
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IApplicationCreator.cs
@@ -0,0 +1,7 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IApplicationCreator : IpcService
+ {
+ public IApplicationCreator() { }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs
new file mode 100644
index 00000000..e630c80d
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IAudioController.cs
@@ -0,0 +1,66 @@
+using Ryujinx.Common.Logging;
+
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IAudioController : IpcService
+ {
+ public IAudioController() { }
+
+ [Command(0)]
+ // SetExpectedMasterVolume(f32, f32)
+ public ResultCode SetExpectedMasterVolume(ServiceCtx context)
+ {
+ float appletVolume = context.RequestData.ReadSingle();
+ float libraryAppletVolume = context.RequestData.ReadSingle();
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(1)]
+ // GetMainAppletExpectedMasterVolume() -> f32
+ public ResultCode GetMainAppletExpectedMasterVolume(ServiceCtx context)
+ {
+ context.ResponseData.Write(1f);
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(2)]
+ // GetLibraryAppletExpectedMasterVolume() -> f32
+ public ResultCode GetLibraryAppletExpectedMasterVolume(ServiceCtx context)
+ {
+ context.ResponseData.Write(1f);
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(3)]
+ // ChangeMainAppletMasterVolume(f32, u64)
+ public ResultCode ChangeMainAppletMasterVolume(ServiceCtx context)
+ {
+ float unknown0 = context.RequestData.ReadSingle();
+ long unknown1 = context.RequestData.ReadInt64();
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(4)]
+ // SetTransparentVolumeRate(f32)
+ public ResultCode SetTransparentVolumeRate(ServiceCtx context)
+ {
+ float unknown0 = context.RequestData.ReadSingle();
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
new file mode 100644
index 00000000..085d9fe6
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs
@@ -0,0 +1,142 @@
+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 KEvent _displayResolutionChangeEvent;
+
+ private CpuBoostMode _cpuBoostMode = CpuBoostMode.Disabled;
+
+ public ICommonStateGetter(Horizon system)
+ {
+ _displayResolutionChangeEvent = new KEvent(system);
+ }
+
+ [Command(0)]
+ // GetEventHandle() -> handle<copy>
+ public ResultCode GetEventHandle(ServiceCtx context)
+ {
+ KEvent Event = context.Device.System.AppletState.MessageEvent;
+
+ if (context.Process.HandleTable.GenerateHandle(Event.ReadableEvent, out int handle) != KernelResult.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
+
+ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
+
+ return ResultCode.Success;
+ }
+
+ [Command(1)]
+ // ReceiveMessage() -> nn::am::AppletMessage
+ public ResultCode ReceiveMessage(ServiceCtx context)
+ {
+ if (!context.Device.System.AppletState.TryDequeueMessage(out MessageInfo message))
+ {
+ return ResultCode.NoMessages;
+ }
+
+ context.ResponseData.Write((int)message);
+
+ return ResultCode.Success;
+ }
+
+ [Command(5)]
+ // GetOperationMode() -> u8
+ public ResultCode GetOperationMode(ServiceCtx context)
+ {
+ OperationMode mode = context.Device.System.State.DockedMode
+ ? OperationMode.Docked
+ : OperationMode.Handheld;
+
+ context.ResponseData.Write((byte)mode);
+
+ return ResultCode.Success;
+ }
+
+ [Command(6)]
+ // GetPerformanceMode() -> u32
+ public ResultCode GetPerformanceMode(ServiceCtx context)
+ {
+ PerformanceMode mode = context.Device.System.State.DockedMode
+ ? PerformanceMode.Docked
+ : PerformanceMode.Handheld;
+
+ context.ResponseData.Write((int)mode);
+
+ return ResultCode.Success;
+ }
+
+ [Command(8)]
+ // GetBootMode() -> u8
+ public ResultCode GetBootMode(ServiceCtx context)
+ {
+ context.ResponseData.Write((byte)0); //Unknown value.
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(9)]
+ // GetCurrentFocusState() -> u8
+ public ResultCode GetCurrentFocusState(ServiceCtx context)
+ {
+ context.ResponseData.Write((byte)context.Device.System.AppletState.FocusState);
+
+ return ResultCode.Success;
+ }
+
+ [Command(60)] // 3.0.0+
+ // GetDefaultDisplayResolution() -> (u32, u32)
+ public ResultCode GetDefaultDisplayResolution(ServiceCtx context)
+ {
+ context.ResponseData.Write(1280);
+ context.ResponseData.Write(720);
+
+ return ResultCode.Success;
+ }
+
+ [Command(61)] // 3.0.0+
+ // GetDefaultDisplayResolutionChangeEvent() -> handle<copy>
+ public ResultCode GetDefaultDisplayResolutionChangeEvent(ServiceCtx context)
+ {
+ if (context.Process.HandleTable.GenerateHandle(_displayResolutionChangeEvent.ReadableEvent, out int handle) != KernelResult.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
+
+ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(66)] // 6.0.0+
+ // SetCpuBoostMode(u32 cpu_boost_mode)
+ public ResultCode SetCpuBoostMode(ServiceCtx context)
+ {
+ uint cpuBoostMode = context.RequestData.ReadUInt32();
+
+ if (cpuBoostMode > 1)
+ {
+ return ResultCode.CpuBoostModeInvalid;
+ }
+
+ _cpuBoostMode = (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.
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDebugFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDebugFunctions.cs
new file mode 100644
index 00000000..51a112fd
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDebugFunctions.cs
@@ -0,0 +1,7 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IDebugFunctions : IpcService
+ {
+ public IDebugFunctions() { }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDisplayController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDisplayController.cs
new file mode 100644
index 00000000..2b04dbb5
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IDisplayController.cs
@@ -0,0 +1,7 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IDisplayController : IpcService
+ {
+ public IDisplayController() { }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IGlobalStateController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IGlobalStateController.cs
new file mode 100644
index 00000000..24eeefb9
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IGlobalStateController.cs
@@ -0,0 +1,7 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IGlobalStateController : IpcService
+ {
+ public IGlobalStateController() { }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs
new file mode 100644
index 00000000..a5819132
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IHomeMenuFunctions.cs
@@ -0,0 +1,44 @@
+using Ryujinx.Common.Logging;
+using Ryujinx.HLE.HOS.Ipc;
+using Ryujinx.HLE.HOS.Kernel.Common;
+using Ryujinx.HLE.HOS.Kernel.Threading;
+using System;
+
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IHomeMenuFunctions : IpcService
+ {
+ private KEvent _channelEvent;
+
+ public IHomeMenuFunctions(Horizon system)
+ {
+ // TODO: Signal this Event somewhere in future.
+ _channelEvent = new KEvent(system);
+ }
+
+ [Command(10)]
+ // RequestToGetForeground()
+ public ResultCode RequestToGetForeground(ServiceCtx context)
+ {
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(21)]
+ // GetPopFromGeneralChannelEvent() -> handle<copy>
+ public ResultCode GetPopFromGeneralChannelEvent(ServiceCtx context)
+ {
+ if (context.Process.HandleTable.GenerateHandle(_channelEvent.ReadableEvent, out int handle) != KernelResult.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
+
+ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs
new file mode 100644
index 00000000..8b0b225b
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ILibraryAppletCreator.cs
@@ -0,0 +1,29 @@
+using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletCreator;
+
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class ILibraryAppletCreator : IpcService
+ {
+ public ILibraryAppletCreator() { }
+
+ [Command(0)]
+ // CreateLibraryApplet(u32, u32) -> object<nn::am::service::ILibraryAppletAccessor>
+ public ResultCode CreateLibraryApplet(ServiceCtx context)
+ {
+ MakeObject(context, new ILibraryAppletAccessor(context.Device.System));
+
+ return ResultCode.Success;
+ }
+
+ [Command(10)]
+ // CreateStorage(u64) -> object<nn::am::service::IStorage>
+ public ResultCode CreateStorage(ServiceCtx context)
+ {
+ long size = context.RequestData.ReadInt64();
+
+ MakeObject(context, new IStorage(new byte[size]));
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs
new file mode 100644
index 00000000..62f1beec
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs
@@ -0,0 +1,200 @@
+using Ryujinx.Common.Logging;
+using Ryujinx.HLE.HOS.Ipc;
+using Ryujinx.HLE.HOS.Kernel.Common;
+using Ryujinx.HLE.HOS.Kernel.Threading;
+using System;
+
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class ISelfController : IpcService
+ {
+ private KEvent _libraryAppletLaunchableEvent;
+
+ private KEvent _accumulatedSuspendedTickChangedEvent;
+ private int _accumulatedSuspendedTickChangedEventHandle = 0;
+
+ private int _idleTimeDetectionExtension;
+
+ public ISelfController(Horizon system)
+ {
+ _libraryAppletLaunchableEvent = new KEvent(system);
+ }
+
+ [Command(0)]
+ // Exit()
+ public ResultCode Exit(ServiceCtx context)
+ {
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(1)]
+ // LockExit()
+ public ResultCode LockExit(ServiceCtx context)
+ {
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(2)]
+ // UnlockExit()
+ public ResultCode UnlockExit(ServiceCtx context)
+ {
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(9)]
+ // GetLibraryAppletLaunchableEvent() -> handle<copy>
+ public ResultCode GetLibraryAppletLaunchableEvent(ServiceCtx context)
+ {
+ _libraryAppletLaunchableEvent.ReadableEvent.Signal();
+
+ if (context.Process.HandleTable.GenerateHandle(_libraryAppletLaunchableEvent.ReadableEvent, out int handle) != KernelResult.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
+
+ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(10)]
+ // SetScreenShotPermission(u32)
+ public ResultCode SetScreenShotPermission(ServiceCtx context)
+ {
+ bool enable = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(11)]
+ // SetOperationModeChangedNotification(b8)
+ public ResultCode SetOperationModeChangedNotification(ServiceCtx context)
+ {
+ bool enable = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(12)]
+ // SetPerformanceModeChangedNotification(b8)
+ public ResultCode SetPerformanceModeChangedNotification(ServiceCtx context)
+ {
+ bool enable = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(13)]
+ // SetFocusHandlingMode(b8, b8, b8)
+ public ResultCode SetFocusHandlingMode(ServiceCtx context)
+ {
+ bool flag1 = context.RequestData.ReadByte() != 0;
+ bool flag2 = context.RequestData.ReadByte() != 0;
+ bool flag3 = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(14)]
+ // SetRestartMessageEnabled(b8)
+ public ResultCode SetRestartMessageEnabled(ServiceCtx context)
+ {
+ bool enable = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(16)] // 2.0.0+
+ // SetOutOfFocusSuspendingEnabled(b8)
+ public ResultCode SetOutOfFocusSuspendingEnabled(ServiceCtx context)
+ {
+ bool enable = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(19)] // 3.0.0+
+ public ResultCode SetScreenShotImageOrientation(ServiceCtx context)
+ {
+ int orientation = context.RequestData.ReadInt32();
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(50)]
+ // SetHandlesRequestToDisplay(b8)
+ public ResultCode SetHandlesRequestToDisplay(ServiceCtx context)
+ {
+ bool enable = context.RequestData.ReadByte() != 0;
+
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+
+ [Command(62)]
+ // SetIdleTimeDetectionExtension(u32)
+ public ResultCode SetIdleTimeDetectionExtension(ServiceCtx context)
+ {
+ _idleTimeDetectionExtension = context.RequestData.ReadInt32();
+
+ Logger.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension });
+
+ return ResultCode.Success;
+ }
+
+ [Command(63)]
+ // GetIdleTimeDetectionExtension() -> u32
+ public ResultCode GetIdleTimeDetectionExtension(ServiceCtx context)
+ {
+ context.ResponseData.Write(_idleTimeDetectionExtension);
+
+ Logger.PrintStub(LogClass.ServiceAm, new { _idleTimeDetectionExtension });
+
+ return ResultCode.Success;
+ }
+
+ [Command(91)] // 6.0.0+
+ // GetAccumulatedSuspendedTickChangedEvent() -> handle<copy>
+ public ResultCode GetAccumulatedSuspendedTickChangedEvent(ServiceCtx context)
+ {
+ if (_accumulatedSuspendedTickChangedEventHandle == 0)
+ {
+ _accumulatedSuspendedTickChangedEvent = new KEvent(context.Device.System);
+
+ _accumulatedSuspendedTickChangedEvent.ReadableEvent.Signal();
+
+ if (context.Process.HandleTable.GenerateHandle(_accumulatedSuspendedTickChangedEvent.ReadableEvent, out _accumulatedSuspendedTickChangedEventHandle) != KernelResult.Success)
+ {
+ throw new InvalidOperationException("Out of handles!");
+ }
+ }
+
+ context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_accumulatedSuspendedTickChangedEventHandle);
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs
new file mode 100644
index 00000000..449658cf
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs
@@ -0,0 +1,29 @@
+using Ryujinx.Common.Logging;
+
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ class IWindowController : IpcService
+ {
+ public IWindowController() { }
+
+ [Command(1)]
+ // GetAppletResourceUserId() -> nn::applet::AppletResourceUserId
+ public ResultCode GetAppletResourceUserId(ServiceCtx context)
+ {
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ context.ResponseData.Write(0L);
+
+ return ResultCode.Success;
+ }
+
+ [Command(10)]
+ // AcquireForegroundRights()
+ public ResultCode AcquireForegroundRights(ServiceCtx context)
+ {
+ Logger.PrintStub(LogClass.ServiceAm);
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/FocusState.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/FocusState.cs
new file mode 100644
index 00000000..dfd7d7f2
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/FocusState.cs
@@ -0,0 +1,8 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ enum FocusState
+ {
+ InFocus = 1,
+ OutOfFocus = 2
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs
new file mode 100644
index 00000000..ff699315
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs
@@ -0,0 +1,9 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ enum MessageInfo
+ {
+ FocusStateChanged = 0xf,
+ OperationModeChanged = 0x1e,
+ PerformanceModeChanged = 0x1f
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/OperationMode.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/OperationMode.cs
new file mode 100644
index 00000000..a82ed476
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/OperationMode.cs
@@ -0,0 +1,8 @@
+namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
+{
+ enum OperationMode
+ {
+ Handheld = 0,
+ Docked = 1
+ }
+} \ No newline at end of file