2019-10-17 08:17:44 +02:00
|
|
|
|
using LibHac;
|
2020-09-01 22:08:59 +02:00
|
|
|
|
using LibHac.FsSrv;
|
2019-10-17 08:17:44 +02:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Fs
|
|
|
|
|
{
|
|
|
|
|
class IDeviceOperator : IpcService
|
|
|
|
|
{
|
2020-09-01 22:08:59 +02:00
|
|
|
|
private LibHac.FsSrv.IDeviceOperator _baseOperator;
|
2019-10-17 08:17:44 +02:00
|
|
|
|
|
2020-09-01 22:08:59 +02:00
|
|
|
|
public IDeviceOperator(LibHac.FsSrv.IDeviceOperator baseOperator)
|
2019-10-17 08:17:44 +02:00
|
|
|
|
{
|
|
|
|
|
_baseOperator = baseOperator;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 15:07:06 +01:00
|
|
|
|
[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;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-17 08:17:44 +02:00
|
|
|
|
[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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|