ServicePl.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Ryujinx.Core.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.Core.OsHle.Services.Pl
  4. {
  5. class ServicePl : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> m_Commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  9. public ServicePl()
  10. {
  11. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  12. {
  13. { 0, RequestLoad },
  14. { 1, GetLoadState },
  15. { 2, GetFontSize },
  16. { 3, GetSharedMemoryAddressOffset },
  17. { 4, GetSharedMemoryNativeHandle }
  18. };
  19. }
  20. public long RequestLoad(ServiceCtx Context)
  21. {
  22. SharedFontType FontType = (SharedFontType)Context.RequestData.ReadInt32();
  23. return 0;
  24. }
  25. public long GetLoadState(ServiceCtx Context)
  26. {
  27. Context.ResponseData.Write(1); //Loaded
  28. return 0;
  29. }
  30. public long GetFontSize(ServiceCtx Context)
  31. {
  32. Context.ResponseData.Write(Horizon.FontSize);
  33. return 0;
  34. }
  35. public long GetSharedMemoryAddressOffset(ServiceCtx Context)
  36. {
  37. Context.ResponseData.Write(0);
  38. return 0;
  39. }
  40. public long GetSharedMemoryNativeHandle(ServiceCtx Context)
  41. {
  42. int Handle = Context.Process.HandleTable.OpenHandle(Context.Ns.Os.FontSharedMem);
  43. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
  44. return 0;
  45. }
  46. }
  47. }