diff --git a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs index 4bda472ebd..ac7081699e 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs @@ -173,26 +173,14 @@ namespace Ryujinx.HLE.HOS.Services.Acc /* if (nn::arp::detail::IReader::GetApplicationLaunchProperty() == 0xCC9D) // InvalidProcessId { - _applicationLaunchProperty = new ApplicationLaunchProperty - { - TitleId = 0x00; - Version = 0x00; - BaseGameStorageId = 0x03; - UpdateGameStorageId = 0x00; - } + _applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetDefault(); return ResultCode.InvalidArgument; } else */ { - _applicationLaunchProperty = new ApplicationLaunchProperty - { - TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0), - Version = 0x00, - BaseGameStorageId = (byte)StorageId.NandSystem, - UpdateGameStorageId = (byte)StorageId.None - }; + _applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context); } Logger.PrintStub(LogClass.ServiceAcc, new { unknown }); diff --git a/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchPropertyHelper.cs b/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchPropertyHelper.cs new file mode 100644 index 0000000000..0268ed4b4d --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchPropertyHelper.cs @@ -0,0 +1,35 @@ +using Ryujinx.HLE.FileSystem; +using Ryujinx.HLE.Utilities; +using System; +using System.Collections.Generic; + +namespace Ryujinx.HLE.HOS.Services.Arp +{ + static class ApplicationLaunchPropertyHelper + { + public static ApplicationLaunchProperty GetDefault() + { + return new ApplicationLaunchProperty + { + TitleId = 0x00, + Version = 0x00, + BaseGameStorageId = (byte)StorageId.NandSystem, + UpdateGameStorageId = (byte)StorageId.None + }; + } + + public static ApplicationLaunchProperty GetByPid(ServiceCtx context) + { + // TODO: Handle ApplicationLaunchProperty as array when pid will be supported and return the right item. + // For now we can hardcode values, and fix it after GetApplicationLaunchProperty is implemented. + + return new ApplicationLaunchProperty + { + TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0), + Version = 0x00, + BaseGameStorageId = (byte)StorageId.NandSystem, + UpdateGameStorageId = (byte)StorageId.None + }; + } + } +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs index cf9e4ddb33..508fce65bc 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs @@ -1,7 +1,4 @@ -using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.HOS.Services.Arp; -using Ryujinx.HLE.Utilities; -using System; namespace Ryujinx.HLE.HOS.Services.Bcat { @@ -23,13 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat // Add an instance of nn::bcat::detail::service::core::TaskManager who load "bcat-sys:/" system save data and open "dc/task.bin". // If the file don't exist, create a new one (size of 0x800) and write 2 empty struct with a size of 0x400. - ApplicationLaunchProperty applicationLaunchProperty = new ApplicationLaunchProperty - { - TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0), - Version = 0x00, - BaseGameStorageId = (byte)StorageId.NandSystem, - UpdateGameStorageId = (byte)StorageId.None - }; + ApplicationLaunchProperty applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context); MakeObject(context, new IBcatService(applicationLaunchProperty)); @@ -49,13 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat // Where X depend of the ApplicationLaunchProperty stored in an array (range 0-3). // Add an instance of nn::bcat::detail::service::ServiceMemoryManager. - ApplicationLaunchProperty applicationLaunchProperty = new ApplicationLaunchProperty - { - TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0), - Version = 0x00, - BaseGameStorageId = (byte)StorageId.NandSystem, - UpdateGameStorageId = (byte)StorageId.None - }; + ApplicationLaunchProperty applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context); MakeObject(context, new IDeliveryCacheStorageService(context, applicationLaunchProperty));