ILibraryAppletAccessor.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using Ryujinx.HLE.Logging;
  2. using Ryujinx.HLE.OsHle.Handles;
  3. using Ryujinx.HLE.OsHle.Ipc;
  4. using System.Collections.Generic;
  5. namespace Ryujinx.HLE.OsHle.Services.Am
  6. {
  7. class ILibraryAppletAccessor : IpcService
  8. {
  9. private Dictionary<int, ServiceProcessRequest> m_Commands;
  10. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  11. private KEvent StateChangedEvent;
  12. public ILibraryAppletAccessor()
  13. {
  14. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  15. {
  16. { 0, GetAppletStateChangedEvent },
  17. { 10, Start },
  18. { 30, GetResult },
  19. { 100, PushInData },
  20. { 101, PopOutData }
  21. };
  22. StateChangedEvent = new KEvent();
  23. }
  24. public long GetAppletStateChangedEvent(ServiceCtx Context)
  25. {
  26. StateChangedEvent.WaitEvent.Set();
  27. int Handle = Context.Process.HandleTable.OpenHandle(StateChangedEvent);
  28. Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);
  29. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  30. return 0;
  31. }
  32. public long Start(ServiceCtx Context)
  33. {
  34. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  35. return 0;
  36. }
  37. public long GetResult(ServiceCtx Context)
  38. {
  39. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  40. return 0;
  41. }
  42. public long PushInData(ServiceCtx Context)
  43. {
  44. Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
  45. return 0;
  46. }
  47. public long PopOutData(ServiceCtx Context)
  48. {
  49. MakeObject(Context, new IStorage(StorageHelper.MakeLaunchParams()));
  50. return 0;
  51. }
  52. }
  53. }