2019-09-19 02:45:11 +02:00
|
|
|
using Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Arp;
|
2019-09-10 11:55:28 +02:00
|
|
|
|
2018-08-17 01:47:36 +02:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Bcat
|
2018-07-23 16:20:16 +02:00
|
|
|
{
|
2019-07-10 17:59:54 +02:00
|
|
|
[Service("bcat:a")]
|
|
|
|
[Service("bcat:m")]
|
|
|
|
[Service("bcat:u")]
|
|
|
|
[Service("bcat:s")]
|
2018-07-23 16:20:16 +02:00
|
|
|
class IServiceCreator : IpcService
|
|
|
|
{
|
2019-07-12 03:13:43 +02:00
|
|
|
public IServiceCreator(ServiceCtx context) { }
|
2018-07-23 16:20:16 +02:00
|
|
|
|
2019-07-12 03:13:43 +02:00
|
|
|
[Command(0)]
|
|
|
|
// CreateBcatService(u64, pid) -> object<nn::bcat::detail::ipc::IBcatService>
|
2019-07-14 21:04:38 +02:00
|
|
|
public ResultCode CreateBcatService(ServiceCtx context)
|
2018-07-23 16:20:16 +02:00
|
|
|
{
|
2019-09-10 11:55:28 +02:00
|
|
|
// TODO: Call arp:r GetApplicationLaunchProperty with the pid to get the TitleId.
|
|
|
|
// Add an instance of nn::bcat::detail::service::core::PassphraseManager.
|
|
|
|
// Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
MakeObject(context, new IBcatService(ApplicationLaunchProperty.GetByPid(context)));
|
2018-07-23 16:20:16 +02:00
|
|
|
|
2019-09-10 11:55:28 +02:00
|
|
|
// NOTE: If the IBcatService is null this error is returned, Doesn't occur in our case.
|
|
|
|
// return ResultCode.NullObject;
|
2018-08-17 01:47:36 +02:00
|
|
|
|
2019-07-14 21:04:38 +02:00
|
|
|
return ResultCode.Success;
|
2018-07-23 16:20:16 +02:00
|
|
|
}
|
|
|
|
|
2019-07-12 03:13:43 +02:00
|
|
|
[Command(1)]
|
|
|
|
// CreateDeliveryCacheStorageService(u64, pid) -> object<nn::bcat::detail::ipc::IDeliveryCacheStorageService>
|
2019-07-14 21:04:38 +02:00
|
|
|
public ResultCode CreateDeliveryCacheStorageService(ServiceCtx context)
|
2018-07-23 16:20:16 +02:00
|
|
|
{
|
2019-09-10 11:55:28 +02:00
|
|
|
// TODO: Call arp:r GetApplicationLaunchProperty with the pid to get the TitleId.
|
|
|
|
// Add an instance of nn::bcat::detail::service::core::ApplicationStorageManager who load "bcat-dc-X:/" system save data,
|
|
|
|
// return ResultCode.NullSaveData if failed.
|
|
|
|
// Where X depend of the ApplicationLaunchProperty stored in an array (range 0-3).
|
|
|
|
// Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
|
|
|
|
|
|
|
|
MakeObject(context, new IDeliveryCacheStorageService(context, ApplicationLaunchProperty.GetByPid(context)));
|
2018-07-23 16:20:16 +02:00
|
|
|
|
2019-09-10 11:55:28 +02:00
|
|
|
// NOTE: If the IDeliveryCacheStorageService is null this error is returned, Doesn't occur in our case.
|
|
|
|
// return ResultCode.NullObject;
|
2018-07-23 16:20:16 +02:00
|
|
|
|
2019-07-14 21:04:38 +02:00
|
|
|
return ResultCode.Success;
|
2018-07-23 16:20:16 +02:00
|
|
|
}
|
|
|
|
}
|
2019-07-14 21:04:38 +02:00
|
|
|
}
|