1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-05 01:42:03 +00:00
Ryujinx/Ryujinx.HLE/HOS/Services/Fs/IDeviceOperator.cs
Alex Barney cecbd256a5
Add support for cache storage (#936)
* Update LibHac

* Run EnsureApplicationCacheStorage when launching a game

* Add new FS commands
2020-03-03 15:07:06 +01:00

48 lines
1.3 KiB
C#

using LibHac;
using LibHac.FsService;
namespace Ryujinx.HLE.HOS.Services.Fs
{
class IDeviceOperator : IpcService
{
private LibHac.FsService.IDeviceOperator _baseOperator;
public IDeviceOperator(LibHac.FsService.IDeviceOperator baseOperator)
{
_baseOperator = baseOperator;
}
[Command(0)]
// IsSdCardInserted() -> b8 is_inserted
public ResultCode IsSdCardInserted(ServiceCtx context)
{
Result result = _baseOperator.IsSdCardInserted(out bool isInserted);
context.ResponseData.Write(isInserted);
return (ResultCode)result.Value;
}
[Command(200)]
// IsGameCardInserted() -> b8 is_inserted
public ResultCode IsGameCardInserted(ServiceCtx context)
{
Result result = _baseOperator.IsGameCardInserted(out bool isInserted);
context.ResponseData.Write(isInserted);
return (ResultCode)result.Value;
}
[Command(202)]
// GetGameCardHandle() -> u32 gamecard_handle
public ResultCode GetGameCardHandle(ServiceCtx context)
{
Result result = _baseOperator.GetGameCardHandle(out GameCardHandle handle);
context.ResponseData.Write(handle.Value);
return (ResultCode)result.Value;
}
}
}