2020-09-20 05:32:48 +02:00
|
|
|
using Ryujinx.Common.Logging;
|
2021-06-25 00:37:48 +02:00
|
|
|
using Ryujinx.Cpu;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Caps.Types;
|
2020-09-20 05:32:48 +02:00
|
|
|
|
2019-09-19 02:45:11 +02:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Caps
|
|
|
|
{
|
|
|
|
[Service("caps:u")]
|
|
|
|
class IAlbumApplicationService : IpcService
|
|
|
|
{
|
|
|
|
public IAlbumApplicationService(ServiceCtx context) { }
|
2020-09-20 05:32:48 +02:00
|
|
|
|
2021-04-14 00:01:24 +02:00
|
|
|
[CommandHipc(32)] // 7.0.0+
|
2020-09-20 05:32:48 +02:00
|
|
|
// SetShimLibraryVersion(pid, u64, nn::applet::AppletResourceUserId)
|
|
|
|
public ResultCode SetShimLibraryVersion(ServiceCtx context)
|
|
|
|
{
|
2021-03-26 01:16:08 +01:00
|
|
|
return context.Device.System.CaptureManager.SetShimLibraryVersion(context);
|
2020-09-20 05:32:48 +02:00
|
|
|
}
|
2021-06-25 00:37:48 +02:00
|
|
|
|
|
|
|
[CommandHipc(102)]
|
|
|
|
// GetAlbumFileList0AafeAruidDeprecated(pid, u16 content_type, u64 start_time, u64 end_time, nn::applet::AppletResourceUserId) -> (u64 count, buffer<ApplicationAlbumFileEntry, 0x6>)
|
|
|
|
public ResultCode GetAlbumFileList0AafeAruidDeprecated(ServiceCtx context)
|
|
|
|
{
|
|
|
|
// NOTE: ApplicationAlbumFileEntry size is 0x30.
|
|
|
|
return GetAlbumFileList(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
[CommandHipc(142)]
|
|
|
|
// GetAlbumFileList3AaeAruid(pid, u16 content_type, u64 start_time, u64 end_time, nn::applet::AppletResourceUserId) -> (u64 count, buffer<ApplicationAlbumFileEntry, 0x6>)
|
|
|
|
public ResultCode GetAlbumFileList3AaeAruid(ServiceCtx context)
|
|
|
|
{
|
|
|
|
// NOTE: ApplicationAlbumFileEntry size is 0x20.
|
|
|
|
return GetAlbumFileList(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
private ResultCode GetAlbumFileList(ServiceCtx context)
|
|
|
|
{
|
|
|
|
ResultCode resultCode = ResultCode.Success;
|
|
|
|
ulong count = 0;
|
|
|
|
|
|
|
|
ContentType contentType = (ContentType)context.RequestData.ReadUInt16();
|
|
|
|
ulong startTime = context.RequestData.ReadUInt64();
|
|
|
|
ulong endTime = context.RequestData.ReadUInt64();
|
|
|
|
|
|
|
|
context.RequestData.ReadUInt16(); // Alignment.
|
|
|
|
|
|
|
|
ulong appletResourceUserId = context.RequestData.ReadUInt64();
|
|
|
|
|
|
|
|
ulong applicationAlbumFileEntryPosition = context.Request.ReceiveBuff[0].Position;
|
|
|
|
ulong applicationAlbumFileEntrySize = context.Request.ReceiveBuff[0].Size;
|
|
|
|
|
|
|
|
MemoryHelper.FillWithZeros(context.Memory, applicationAlbumFileEntryPosition, (int)applicationAlbumFileEntrySize);
|
|
|
|
|
|
|
|
if (contentType > ContentType.Unknown || contentType == ContentType.ExtraMovie)
|
|
|
|
{
|
|
|
|
resultCode = ResultCode.InvalidContentType;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Service checks if the pid is present in an internal list and returns ResultCode.BlacklistedPid if it is.
|
|
|
|
// The list contents needs to be determined.
|
|
|
|
// Service populate the buffer with a ApplicationAlbumFileEntry related to the pid.
|
|
|
|
|
|
|
|
Logger.Stub?.PrintStub(LogClass.ServiceCaps, new { contentType, startTime, endTime, appletResourceUserId });
|
|
|
|
|
|
|
|
context.ResponseData.Write(count);
|
|
|
|
|
|
|
|
return resultCode;
|
|
|
|
}
|
2019-09-19 02:45:11 +02:00
|
|
|
}
|
|
|
|
}
|