IShopServiceAccessServerInterface.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Ryujinx.Common.Logging;
  2. using Ryujinx.HLE.FileSystem;
  3. using Ryujinx.HLE.HOS.Services.Arp;
  4. using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface;
  5. namespace Ryujinx.HLE.HOS.Services.Nim
  6. {
  7. [Service("nim:eca")] // 5.0.0+
  8. class IShopServiceAccessServerInterface : IpcService
  9. {
  10. public IShopServiceAccessServerInterface(ServiceCtx context) { }
  11. [CommandHipc(0)]
  12. // CreateServerInterface(pid, handle<unknown>, u64) -> object<nn::ec::IShopServiceAccessServer>
  13. public ResultCode CreateServerInterface(ServiceCtx context)
  14. {
  15. MakeObject(context, new IShopServiceAccessServer());
  16. Logger.Stub?.PrintStub(LogClass.ServiceNim);
  17. return ResultCode.Success;
  18. }
  19. [CommandHipc(4)] // 10.0.0+
  20. // IsLargeResourceAvailable(pid) -> b8
  21. public ResultCode IsLargeResourceAvailable(ServiceCtx context)
  22. {
  23. // TODO: Service calls arp:r GetApplicationInstanceId (10.0.0+) then if it fails it calls arp:r GetMicroApplicationInstanceId (10.0.0+)
  24. // then if it fails it returns the arp:r result code.
  25. // NOTE: Firmare 10.0.0+ don't use the Pid here anymore, but the returned InstanceId. We don't support that for now so we can just use the Pid instead.
  26. StorageId baseStorageId = (StorageId)ApplicationLaunchProperty.GetByPid(context).BaseGameStorageId;
  27. // NOTE: Service returns ResultCode.InvalidArgument if baseStorageId is null, doesn't occur in our case.
  28. context.ResponseData.Write(baseStorageId == StorageId.Host);
  29. return ResultCode.Success;
  30. }
  31. }
  32. }