2019-10-17 02:17:44 -04:00
|
|
|
|
using LibHac;
|
2020-09-01 16:08:59 -04:00
|
|
|
|
using LibHac.FsSrv;
|
2019-10-17 02:17:44 -04:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Fs
|
|
|
|
|
{
|
2021-07-13 10:48:54 -04:00
|
|
|
|
class IDeviceOperator : IpcService
|
2019-10-17 02:17:44 -04:00
|
|
|
|
{
|
2021-07-13 10:48:54 -04:00
|
|
|
|
private LibHac.FsSrv.IDeviceOperator _baseOperator;
|
2019-10-17 02:17:44 -04:00
|
|
|
|
|
2021-07-13 10:48:54 -04:00
|
|
|
|
public IDeviceOperator(LibHac.FsSrv.IDeviceOperator baseOperator)
|
2019-10-17 02:17:44 -04:00
|
|
|
|
{
|
|
|
|
|
_baseOperator = baseOperator;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 18:01:24 -04:00
|
|
|
|
[CommandHipc(0)]
|
2020-03-03 09:07:06 -05:00
|
|
|
|
// IsSdCardInserted() -> b8 is_inserted
|
|
|
|
|
public ResultCode IsSdCardInserted(ServiceCtx context)
|
|
|
|
|
{
|
2021-07-13 10:48:54 -04:00
|
|
|
|
Result result = _baseOperator.IsSdCardInserted(out bool isInserted);
|
2020-03-03 09:07:06 -05:00
|
|
|
|
|
|
|
|
|
context.ResponseData.Write(isInserted);
|
|
|
|
|
|
|
|
|
|
return (ResultCode)result.Value;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 18:01:24 -04:00
|
|
|
|
[CommandHipc(200)]
|
2019-10-17 02:17:44 -04:00
|
|
|
|
// IsGameCardInserted() -> b8 is_inserted
|
|
|
|
|
public ResultCode IsGameCardInserted(ServiceCtx context)
|
|
|
|
|
{
|
2021-07-13 10:48:54 -04:00
|
|
|
|
Result result = _baseOperator.IsGameCardInserted(out bool isInserted);
|
2019-10-17 02:17:44 -04:00
|
|
|
|
|
|
|
|
|
context.ResponseData.Write(isInserted);
|
|
|
|
|
|
|
|
|
|
return (ResultCode)result.Value;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 18:01:24 -04:00
|
|
|
|
[CommandHipc(202)]
|
2019-10-17 02:17:44 -04:00
|
|
|
|
// GetGameCardHandle() -> u32 gamecard_handle
|
|
|
|
|
public ResultCode GetGameCardHandle(ServiceCtx context)
|
|
|
|
|
{
|
2021-07-13 10:48:54 -04:00
|
|
|
|
Result result = _baseOperator.GetGameCardHandle(out GameCardHandle handle);
|
2019-10-17 02:17:44 -04:00
|
|
|
|
|
|
|
|
|
context.ResponseData.Write(handle.Value);
|
|
|
|
|
|
|
|
|
|
return (ResultCode)result.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|