summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfp/nfp_interface.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-04-14 04:24:35 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2023-04-14 06:24:27 +0200
commit101c0df79ca31aa950c340812f09cdeadbb89732 (patch)
treee85d93096d94afd676da6d65199e6d37dd849ba4 /src/core/hle/service/nfp/nfp_interface.h
parentMerge pull request #10008 from vonchenplus/texture_cache (diff)
downloadyuzu-101c0df79ca31aa950c340812f09cdeadbb89732.tar
yuzu-101c0df79ca31aa950c340812f09cdeadbb89732.tar.gz
yuzu-101c0df79ca31aa950c340812f09cdeadbb89732.tar.bz2
yuzu-101c0df79ca31aa950c340812f09cdeadbb89732.tar.lz
yuzu-101c0df79ca31aa950c340812f09cdeadbb89732.tar.xz
yuzu-101c0df79ca31aa950c340812f09cdeadbb89732.tar.zst
yuzu-101c0df79ca31aa950c340812f09cdeadbb89732.zip
Diffstat (limited to 'src/core/hle/service/nfp/nfp_interface.h')
-rw-r--r--src/core/hle/service/nfp/nfp_interface.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/core/hle/service/nfp/nfp_interface.h b/src/core/hle/service/nfp/nfp_interface.h
new file mode 100644
index 000000000..11f29c2ba
--- /dev/null
+++ b/src/core/hle/service/nfp/nfp_interface.h
@@ -0,0 +1,63 @@
+// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <array>
+#include <memory>
+#include <optional>
+
+#include "core/hle/service/kernel_helpers.h"
+#include "core/hle/service/service.h"
+
+namespace Service::NFP {
+class NfpDevice;
+
+class Interface : public ServiceFramework<Interface> {
+public:
+ explicit Interface(Core::System& system_, const char* name);
+ ~Interface() override;
+
+ void Initialize(HLERequestContext& ctx);
+ void Finalize(HLERequestContext& ctx);
+ void ListDevices(HLERequestContext& ctx);
+ void StartDetection(HLERequestContext& ctx);
+ void StopDetection(HLERequestContext& ctx);
+ void Mount(HLERequestContext& ctx);
+ void Unmount(HLERequestContext& ctx);
+ void OpenApplicationArea(HLERequestContext& ctx);
+ void GetApplicationArea(HLERequestContext& ctx);
+ void SetApplicationArea(HLERequestContext& ctx);
+ void Flush(HLERequestContext& ctx);
+ void Restore(HLERequestContext& ctx);
+ void CreateApplicationArea(HLERequestContext& ctx);
+ void GetTagInfo(HLERequestContext& ctx);
+ void GetRegisterInfo(HLERequestContext& ctx);
+ void GetCommonInfo(HLERequestContext& ctx);
+ void GetModelInfo(HLERequestContext& ctx);
+ void AttachActivateEvent(HLERequestContext& ctx);
+ void AttachDeactivateEvent(HLERequestContext& ctx);
+ void GetState(HLERequestContext& ctx);
+ void GetDeviceState(HLERequestContext& ctx);
+ void GetNpadId(HLERequestContext& ctx);
+ void GetApplicationAreaSize(HLERequestContext& ctx);
+ void AttachAvailabilityChangeEvent(HLERequestContext& ctx);
+ void RecreateApplicationArea(HLERequestContext& ctx);
+
+private:
+ enum class State : u32 {
+ NonInitialized,
+ Initialized,
+ };
+
+ std::optional<std::shared_ptr<NfpDevice>> GetNfpDevice(u64 handle);
+
+ KernelHelpers::ServiceContext service_context;
+
+ std::array<std::shared_ptr<NfpDevice>, 10> devices{};
+
+ State state{State::NonInitialized};
+ Kernel::KEvent* availability_change_event;
+};
+
+} // namespace Service::NFP