IFileSystemProxy.cs 2.1 KB

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