From 06922908ff4c4dadf8ea9085512f3f8b32494189 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Tue, 10 Sep 2019 07:31:30 +0200 Subject: [PATCH] Fix ApplicationLaunchProperty 2 --- .../HOS/Services/Acc/IAccountService.cs | 4 ++-- .../Services/Acc/IManagerForApplication.cs | 2 +- .../Services/Arp/ApplicationLaunchProperty.cs | 18 ++++++++++++++- .../Arp/ApplicationLaunchPropertyHelper.cs | 23 ------------------- Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs | 2 +- .../Bcat/IDeliveryCacheStorageService.cs | 3 +-- .../HOS/Services/Bcat/IServiceCreator.cs | 10 +++----- 7 files changed, 25 insertions(+), 37 deletions(-) delete mode 100644 Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchPropertyHelper.cs diff --git a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs index 4d8c80f3ee..23f3eec79c 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs @@ -1,6 +1,6 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.HOS.Services.Arp; +using Ryujinx.HLE.HOS.Services.Glue; using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.Utilities; using System; @@ -180,7 +180,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc else */ { - _applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context); + _applicationLaunchProperty = ApplicationLaunchProperty.GetByPid(context); } Logger.PrintStub(LogClass.ServiceAcc, new { unknown }); diff --git a/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs b/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs index 02cafd2500..8fb901c5b7 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs @@ -1,5 +1,5 @@ using Ryujinx.Common.Logging; -using Ryujinx.HLE.HOS.Services.Arp; +using Ryujinx.HLE.HOS.Services.Glue; using Ryujinx.HLE.Utilities; namespace Ryujinx.HLE.HOS.Services.Acc diff --git a/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchProperty.cs b/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchProperty.cs index 501484d3c8..b96f0d0549 100644 --- a/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchProperty.cs +++ b/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchProperty.cs @@ -1,6 +1,8 @@ using Ryujinx.HLE.FileSystem; +using Ryujinx.HLE.Utilities; +using System; -namespace Ryujinx.HLE.HOS.Services.Arp +namespace Ryujinx.HLE.HOS.Services.Glue { class ApplicationLaunchProperty { @@ -23,5 +25,19 @@ namespace Ryujinx.HLE.HOS.Services.Arp }; } } + + 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/Arp/ApplicationLaunchPropertyHelper.cs b/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchPropertyHelper.cs deleted file mode 100644 index aa14d92400..0000000000 --- a/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchPropertyHelper.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.Utilities; -using System; - -namespace Ryujinx.HLE.HOS.Services.Arp -{ - static class ApplicationLaunchPropertyHelper - { - 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/IBcatService.cs b/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs index c8906678c9..030f9110b0 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IBcatService.cs @@ -1,4 +1,4 @@ -using Ryujinx.HLE.HOS.Services.Arp; +using Ryujinx.HLE.HOS.Services.Glue; namespace Ryujinx.HLE.HOS.Services.Bcat { diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs b/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs index bc326bba45..1c9aed1183 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IDeliveryCacheStorageService.cs @@ -1,6 +1,5 @@ -using Ryujinx.HLE.HOS.Services.Arp; +using Ryujinx.HLE.HOS.Services.Glue; using System; -using System.Collections.Generic; using System.Text; namespace Ryujinx.HLE.HOS.Services.Bcat diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs index 508fce65bc..4e9d36563d 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs @@ -1,4 +1,4 @@ -using Ryujinx.HLE.HOS.Services.Arp; +using Ryujinx.HLE.HOS.Services.Glue; namespace Ryujinx.HLE.HOS.Services.Bcat { @@ -20,9 +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 = ApplicationLaunchPropertyHelper.GetByPid(context); - - MakeObject(context, new IBcatService(applicationLaunchProperty)); + MakeObject(context, new IBcatService(ApplicationLaunchProperty.GetByPid(context))); // NOTE: If the IBcatService is null this error is returned, Doesn't occur in our case. // return ResultCode.NullObject; @@ -40,9 +38,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 = ApplicationLaunchPropertyHelper.GetByPid(context); - - MakeObject(context, new IDeliveryCacheStorageService(context, applicationLaunchProperty)); + MakeObject(context, new IDeliveryCacheStorageService(context, ApplicationLaunchProperty.GetByPid(context))); // NOTE: If the IDeliveryCacheStorageService is null this error is returned, Doesn't occur in our case. // return ResultCode.NullObject;