ServicePl.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Ryujinx.Core.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.Core.OsHle.IpcServices.Pl
  4. {
  5. class ServicePl : IIpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> m_Commands;
  8. public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  9. public ServicePl()
  10. {
  11. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  12. {
  13. { 1, GetLoadState },
  14. { 2, GetFontSize },
  15. { 3, GetSharedMemoryAddressOffset },
  16. { 4, GetSharedMemoryNativeHandle }
  17. };
  18. }
  19. public static long GetLoadState(ServiceCtx Context)
  20. {
  21. Context.ResponseData.Write(1); //Loaded
  22. return 0;
  23. }
  24. public static long GetFontSize(ServiceCtx Context)
  25. {
  26. Context.ResponseData.Write(Horizon.FontSize);
  27. return 0;
  28. }
  29. public static long GetSharedMemoryAddressOffset(ServiceCtx Context)
  30. {
  31. Context.ResponseData.Write(0);
  32. return 0;
  33. }
  34. public static long GetSharedMemoryNativeHandle(ServiceCtx Context)
  35. {
  36. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Context.Ns.Os.FontHandle);
  37. return 0;
  38. }
  39. }
  40. }