Add ApplicationLaunchPropertyHelper

This commit is contained in:
Ac_K 2019-09-09 20:52:45 +02:00
commit e3e3365447
3 changed files with 39 additions and 31 deletions

View file

@ -173,26 +173,14 @@ namespace Ryujinx.HLE.HOS.Services.Acc
/* /*
if (nn::arp::detail::IReader::GetApplicationLaunchProperty() == 0xCC9D) // InvalidProcessId if (nn::arp::detail::IReader::GetApplicationLaunchProperty() == 0xCC9D) // InvalidProcessId
{ {
_applicationLaunchProperty = new ApplicationLaunchProperty _applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetDefault();
{
TitleId = 0x00;
Version = 0x00;
BaseGameStorageId = 0x03;
UpdateGameStorageId = 0x00;
}
return ResultCode.InvalidArgument; return ResultCode.InvalidArgument;
} }
else else
*/ */
{ {
_applicationLaunchProperty = new ApplicationLaunchProperty _applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context);
{
TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0),
Version = 0x00,
BaseGameStorageId = (byte)StorageId.NandSystem,
UpdateGameStorageId = (byte)StorageId.None
};
} }
Logger.PrintStub(LogClass.ServiceAcc, new { unknown }); Logger.PrintStub(LogClass.ServiceAcc, new { unknown });

View file

@ -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
};
}
}
}

View file

@ -1,7 +1,4 @@
using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS.Services.Arp; using Ryujinx.HLE.HOS.Services.Arp;
using Ryujinx.HLE.Utilities;
using System;
namespace Ryujinx.HLE.HOS.Services.Bcat 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". // 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. // 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 ApplicationLaunchProperty applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context);
{
TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0),
Version = 0x00,
BaseGameStorageId = (byte)StorageId.NandSystem,
UpdateGameStorageId = (byte)StorageId.None
};
MakeObject(context, new IBcatService(applicationLaunchProperty)); 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). // Where X depend of the ApplicationLaunchProperty stored in an array (range 0-3).
// Add an instance of nn::bcat::detail::service::ServiceMemoryManager. // Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
ApplicationLaunchProperty applicationLaunchProperty = new ApplicationLaunchProperty ApplicationLaunchProperty applicationLaunchProperty = ApplicationLaunchPropertyHelper.GetByPid(context);
{
TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0),
Version = 0x00,
BaseGameStorageId = (byte)StorageId.NandSystem,
UpdateGameStorageId = (byte)StorageId.None
};
MakeObject(context, new IDeliveryCacheStorageService(context, applicationLaunchProperty)); MakeObject(context, new IDeliveryCacheStorageService(context, applicationLaunchProperty));