IHomeMenuFunctions.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using Ryujinx.HLE.HOS.Kernel;
  3. using Ryujinx.HLE.Logging;
  4. using System.Collections.Generic;
  5. namespace Ryujinx.HLE.HOS.Services.Am
  6. {
  7. class IHomeMenuFunctions : IpcService
  8. {
  9. private Dictionary<int, ServiceProcessRequest> m_Commands;
  10. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  11. private KEvent ChannelEvent;
  12. public IHomeMenuFunctions()
  13. {
  14. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  15. {
  16. { 10, RequestToGetForeground },
  17. { 21, GetPopFromGeneralChannelEvent }
  18. };
  19. //ToDo: Signal this Event somewhere in future.
  20. ChannelEvent = new KEvent();
  21. }
  22. public long RequestToGetForeground(ServiceCtx Context)
  23. {
  24. Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  25. return 0;
  26. }
  27. public long GetPopFromGeneralChannelEvent(ServiceCtx Context)
  28. {
  29. int Handle = Context.Process.HandleTable.OpenHandle(ChannelEvent);
  30. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
  31. Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  32. return 0;
  33. }
  34. }
  35. }