diff options
| author | Ac_K <Acoustik666@gmail.com> | 2021-06-24 01:05:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-24 01:05:40 +0200 |
| commit | 55e0c714898cc331173628714bdc8e64fb9a3756 (patch) | |
| tree | 93eb7218e9ced707b0d12cf542a3b5aadf32ebf7 /Ryujinx.HLE/HOS/Services/Nfc/NfcManager | |
| parent | aea7a6631caa625d0cc97c03f1f134b623101f0e (diff) | |
nfc/nfp: Implement ISystemManager and ISystem (#2381)
* nfc/nfp: Implement ISystemManager and ISystem
This PR add permission levels for `nfc` and `nfp` services:
- `nfc`: `CreateUserInterface` and `CreateSystemInterface` are implemented.
- `INfc`: `Initialize` and `IsNfcEnabled` calls are stubbed.
- `nfp`: `CreateDebugInterface` and `CreateSystemInterface` are implemented.
- `INfp`: `GetRegisterInfo2` for `IDebug` and `ISystem` are implemented.
* Addresses gdkchan feedback
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Nfc/NfcManager')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nfc/NfcManager/INfc.cs | 37 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nfc/NfcManager/Types/NfcPermissionLevel.cs | 8 |
2 files changed, 45 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nfc/NfcManager/INfc.cs b/Ryujinx.HLE/HOS/Services/Nfc/NfcManager/INfc.cs new file mode 100644 index 00000000..f2fc867d --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Nfc/NfcManager/INfc.cs @@ -0,0 +1,37 @@ +using Ryujinx.Common.Logging; + +namespace Ryujinx.HLE.HOS.Services.Nfc.NfcManager +{ + class INfc : IpcService + { + private NfcPermissionLevel _permissionLevel; + + public INfc(NfcPermissionLevel permissionLevel) + { + _permissionLevel = permissionLevel; + } + + [CommandHipc(0)] + [CommandHipc(400)] // 4.0.0+ + // Initialize() + public ResultCode Initialize(ServiceCtx context) + { + Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel }); + + return ResultCode.Success; + } + + [CommandHipc(3)] + [CommandHipc(403)] // 4.0.0+ + // IsNfcEnabled() -> b8 + public ResultCode IsNfcEnabled(ServiceCtx context) + { + // NOTE: Write false value here could make nfp service not called. + context.ResponseData.Write(true); + + Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel }); + + return ResultCode.Success; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Nfc/NfcManager/Types/NfcPermissionLevel.cs b/Ryujinx.HLE/HOS/Services/Nfc/NfcManager/Types/NfcPermissionLevel.cs new file mode 100644 index 00000000..39babc73 --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Nfc/NfcManager/Types/NfcPermissionLevel.cs @@ -0,0 +1,8 @@ +namespace Ryujinx.HLE.HOS.Services.Nfc.NfcManager +{ + enum NfcPermissionLevel + { + User, + System + } +}
\ No newline at end of file |
