Storage Types
This commit is contained in:
parent
fe6dc1717c
commit
ed5c8301ab
6 changed files with 109 additions and 7 deletions
37
src/Ryujinx.Horizon/Am/Ipc/Storage/Storage.cs
Normal file
37
src/Ryujinx.Horizon/Am/Ipc/Storage/Storage.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Am.Storage;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
|
||||
namespace Ryujinx.Horizon.Am.Ipc.Storage
|
||||
{
|
||||
partial class Storage : IStorage
|
||||
{
|
||||
[CmifCommand(0)]
|
||||
public Result Open(out IStorageAccessor storageAccessor)
|
||||
{
|
||||
storageAccessor = new StorageAccessor();
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
[CmifCommand(1)]
|
||||
public Result OpenTransferStorage(out ITransferStorageAccessor transferStorageAccessor)
|
||||
{
|
||||
transferStorageAccessor = new TransferStorageAccessor();
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
// TODO: Get CMD No.
|
||||
public Result GetAndInvalidate(out IStorage storage)
|
||||
{
|
||||
storage = new Storage();
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
36
src/Ryujinx.Horizon/Am/Ipc/Storage/StorageAccessor.cs
Normal file
36
src/Ryujinx.Horizon/Am/Ipc/Storage/StorageAccessor.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Am.Storage;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Horizon.Am.Ipc.Storage
|
||||
{
|
||||
partial class StorageAccessor : IStorageAccessor
|
||||
{
|
||||
[CmifCommand(0)]
|
||||
public Result GetSize(out long size)
|
||||
{
|
||||
size = 0;
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
[CmifCommand(10)]
|
||||
public Result Write(long arg0, ReadOnlySpan<byte> span)
|
||||
{
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
[CmifCommand(11)]
|
||||
public Result Read(long arg0, ReadOnlySpan<byte> span)
|
||||
{
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Am.Storage;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
|
||||
namespace Ryujinx.Horizon.Am.Ipc.Storage
|
||||
{
|
||||
partial class TransferStorageAccessor : ITransferStorageAccessor
|
||||
{
|
||||
[CmifCommand(0)]
|
||||
public Result GetSize(out long size)
|
||||
{
|
||||
size = 0;
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
[CmifCommand(1)]
|
||||
public Result GetHandle(out int arg0, out ulong arg1)
|
||||
{
|
||||
arg0 = 0;
|
||||
arg1 = 0;
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,8 +5,8 @@ namespace Ryujinx.Horizon.Sdk.Am.Storage
|
|||
{
|
||||
interface IStorage : IServiceObject
|
||||
{
|
||||
Result Open(out IStorageAccessor arg0);
|
||||
Result OpenTransferStorage(out ITransferStorageAccessor arg0);
|
||||
Result GetAndInvalidate(out IStorage arg0);
|
||||
Result Open(out IStorageAccessor storageAccessor);
|
||||
Result OpenTransferStorage(out ITransferStorageAccessor transferStorageAccessor);
|
||||
Result GetAndInvalidate(out IStorage storage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ namespace Ryujinx.Horizon.Sdk.Am.Storage
|
|||
{
|
||||
interface IStorageAccessor : IServiceObject
|
||||
{
|
||||
Result GetSize(out long arg0);
|
||||
Result Write(long arg0, ReadOnlySpan<byte> arg1);
|
||||
Result Read(long arg0, Span<byte> arg1);
|
||||
Result GetSize(out long size);
|
||||
Result Write(long arg0, ReadOnlySpan<byte> span);
|
||||
Result Read(long arg0, ReadOnlySpan<byte> span);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Ryujinx.Horizon.Sdk.Am.Storage
|
|||
{
|
||||
interface ITransferStorageAccessor : IServiceObject
|
||||
{
|
||||
Result GetSize(out long arg0);
|
||||
Result GetSize(out long size);
|
||||
Result GetHandle(out int arg0, out ulong arg1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue