From 7550c2c86686ee19c8706580694bf08c3beb9746 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Jul 2018 08:50:32 -0400 Subject: [PATCH] service/hid: Add the xcd:sys service --- src/core/CMakeLists.txt | 2 ++ src/core/hle/service/hid/hid.cpp | 2 ++ src/core/hle/service/hid/xcd.cpp | 37 ++++++++++++++++++++++++++++++++ src/core/hle/service/hid/xcd.h | 16 ++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 src/core/hle/service/hid/xcd.cpp create mode 100644 src/core/hle/service/hid/xcd.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 73339e2e00..b74e495ef1 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -162,6 +162,8 @@ add_library(core STATIC hle/service/hid/hid.h hle/service/hid/irs.cpp hle/service/hid/irs.h + hle/service/hid/xcd.cpp + hle/service/hid/xcd.h hle/service/ldn/ldn.cpp hle/service/ldn/ldn.h hle/service/ldr/ldr.cpp diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 64a6fdeedf..ed4243db35 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -15,6 +15,7 @@ #include "core/hle/kernel/shared_memory.h" #include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/irs.h" +#include "core/hle/service/hid/xcd.h" #include "core/hle/service/service.h" namespace Service::HID { @@ -562,6 +563,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) { std::make_shared()->InstallAsService(service_manager); std::make_shared()->InstallAsService(service_manager); std::make_shared()->InstallAsService(service_manager); + std::make_shared()->InstallAsService(service_manager); } } // namespace Service::HID diff --git a/src/core/hle/service/hid/xcd.cpp b/src/core/hle/service/hid/xcd.cpp new file mode 100644 index 0000000000..49f733f607 --- /dev/null +++ b/src/core/hle/service/hid/xcd.cpp @@ -0,0 +1,37 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/hid/xcd.h" + +namespace Service::HID { + +XCD_SYS::XCD_SYS() : ServiceFramework{"xcd:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetDataFormat"}, + {1, nullptr, "SetDataFormat"}, + {2, nullptr, "GetMcuState"}, + {3, nullptr, "SetMcuState"}, + {4, nullptr, "GetMcuVersionForNfc"}, + {5, nullptr, "CheckNfcDevicePower"}, + {10, nullptr, "SetNfcEvent"}, + {11, nullptr, "GetNfcInfo"}, + {12, nullptr, "StartNfcDiscovery"}, + {13, nullptr, "StopNfcDiscovery"}, + {14, nullptr, "StartNtagRead"}, + {15, nullptr, "StartNtagWrite"}, + {16, nullptr, "SendNfcRawData"}, + {17, nullptr, "RegisterMifareKey"}, + {18, nullptr, "ClearMifareKey"}, + {19, nullptr, "StartMifareRead"}, + {20, nullptr, "StartMifareWrite"}, + {101, nullptr, "GetAwakeTriggerReasonForLeftRail"}, + {102, nullptr, "GetAwakeTriggerReasonForRightRail"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +} // namespace Service::HID diff --git a/src/core/hle/service/hid/xcd.h b/src/core/hle/service/hid/xcd.h new file mode 100644 index 0000000000..232a044df0 --- /dev/null +++ b/src/core/hle/service/hid/xcd.h @@ -0,0 +1,16 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service::HID { + +class XCD_SYS final : public ServiceFramework { +public: + explicit XCD_SYS(); +}; + +} // namespace Service::HID