IFileSystemProxy.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Ryujinx.Core.OsHle.Ipc;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.Core.OsHle.Services.FspSrv
  4. {
  5. class IFileSystemProxy : IpcService
  6. {
  7. private Dictionary<int, ServiceProcessRequest> m_Commands;
  8. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  9. public IFileSystemProxy()
  10. {
  11. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  12. {
  13. { 1, SetCurrentProcess },
  14. { 18, OpenSdCardFileSystem },
  15. { 51, OpenSaveDataFileSystem },
  16. { 200, OpenDataStorageByCurrentProcess },
  17. { 203, OpenPatchDataStorageByCurrentProcess },
  18. { 1005, GetGlobalAccessLogMode }
  19. };
  20. }
  21. public long SetCurrentProcess(ServiceCtx Context)
  22. {
  23. return 0;
  24. }
  25. public long OpenSdCardFileSystem(ServiceCtx Context)
  26. {
  27. MakeObject(Context, new IFileSystem(Context.Ns.VFs.GetSdCardPath()));
  28. return 0;
  29. }
  30. public long OpenSaveDataFileSystem(ServiceCtx Context)
  31. {
  32. MakeObject(Context, new IFileSystem(Context.Ns.VFs.GetGameSavesPath()));
  33. return 0;
  34. }
  35. public long OpenDataStorageByCurrentProcess(ServiceCtx Context)
  36. {
  37. MakeObject(Context, new IStorage(Context.Ns.VFs.RomFs));
  38. return 0;
  39. }
  40. public long OpenPatchDataStorageByCurrentProcess(ServiceCtx Context)
  41. {
  42. MakeObject(Context, new IStorage(Context.Ns.VFs.RomFs));
  43. return 0;
  44. }
  45. public long GetGlobalAccessLogMode(ServiceCtx Context)
  46. {
  47. Context.ResponseData.Write(0);
  48. return 0;
  49. }
  50. }
  51. }