From 82cb5f030d8d9c8903fdd20ec984836b36ec6f3d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Jul 2018 08:39:25 -0400 Subject: service/hid: Add irs services --- src/core/CMakeLists.txt | 2 ++ src/core/hle/service/hid/hid.cpp | 3 +++ src/core/hle/service/hid/irs.cpp | 49 ++++++++++++++++++++++++++++++++++++++++ src/core/hle/service/hid/irs.h | 21 +++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 src/core/hle/service/hid/irs.cpp create mode 100644 src/core/hle/service/hid/irs.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 063e18d64..73339e2e0 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -160,6 +160,8 @@ add_library(core STATIC hle/service/grc/grc.h hle/service/hid/hid.cpp hle/service/hid/hid.h + hle/service/hid/irs.cpp + hle/service/hid/irs.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 9a02ba686..64a6fdeed 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -14,6 +14,7 @@ #include "core/hle/kernel/event.h" #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/service.h" namespace Service::HID { @@ -559,6 +560,8 @@ void ReloadInputDevices() {} void InstallInterfaces(SM::ServiceManager& 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/irs.cpp b/src/core/hle/service/hid/irs.cpp new file mode 100644 index 000000000..aaf311912 --- /dev/null +++ b/src/core/hle/service/hid/irs.cpp @@ -0,0 +1,49 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/hid/irs.h" + +namespace Service::HID { + +IRS::IRS() : ServiceFramework{"irs"} { + // clang-format off + static const FunctionInfo functions[] = { + {302, nullptr, "ActivateIrsensor"}, + {303, nullptr, "DeactivateIrsensor"}, + {304, nullptr, "GetIrsensorSharedMemoryHandle"}, + {305, nullptr, "StopImageProcessor"}, + {306, nullptr, "RunMomentProcessor"}, + {307, nullptr, "RunClusteringProcessor"}, + {308, nullptr, "RunImageTransferProcessor"}, + {309, nullptr, "GetImageTransferProcessorState"}, + {310, nullptr, "RunTeraPluginProcessor"}, + {311, nullptr, "GetNpadIrCameraHandle"}, + {312, nullptr, "RunPointingProcessor"}, + {313, nullptr, "SuspendImageProcessor"}, + {314, nullptr, "CheckFirmwareVersion"}, + {315, nullptr, "SetFunctionLevel"}, + {316, nullptr, "RunImageTransferExProcessor"}, + {317, nullptr, "RunIrLedProcessor"}, + {318, nullptr, "StopImageProcessorAsync"}, + {319, nullptr, "ActivateIrsensorWithFunctionLevel"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IRS_SYS::IRS_SYS() : ServiceFramework{"irs:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {500, nullptr, "SetAppletResourceUserId"}, + {501, nullptr, "RegisterAppletResourceUserId"}, + {502, nullptr, "UnregisterAppletResourceUserId"}, + {503, nullptr, "EnableAppletToGetInput"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +} // namespace Service::HID diff --git a/src/core/hle/service/hid/irs.h b/src/core/hle/service/hid/irs.h new file mode 100644 index 000000000..a8be701c7 --- /dev/null +++ b/src/core/hle/service/hid/irs.h @@ -0,0 +1,21 @@ +// 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 IRS final : public ServiceFramework { +public: + explicit IRS(); +}; + +class IRS_SYS final : public ServiceFramework { +public: + explicit IRS_SYS(); +}; + +} // namespace Service::HID -- cgit v1.2.3 From 7550c2c86686ee19c8706580694bf08c3beb9746 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Jul 2018 08:50:32 -0400 Subject: 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 73339e2e0..b74e495ef 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 64a6fdeed..ed4243db3 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 000000000..49f733f60 --- /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 000000000..232a044df --- /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 -- cgit v1.2.3 From 1121622dc1a89aeaa1e28824831239edea116a4e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Jul 2018 08:56:16 -0400 Subject: service/hid: Add the hidbus, hid:dbg, hid:sys, and hid:tmp services --- src/core/hle/service/hid/hid.cpp | 220 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index ed4243db3..e4619a547 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -557,12 +557,232 @@ private: } }; +class HidDbg final : public ServiceFramework { +public: + explicit HidDbg() : ServiceFramework{"hid:dbg"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "DeactivateDebugPad"}, + {1, nullptr, "SetDebugPadAutoPilotState"}, + {2, nullptr, "UnsetDebugPadAutoPilotState"}, + {10, nullptr, "DeactivateTouchScreen"}, + {11, nullptr, "SetTouchScreenAutoPilotState"}, + {12, nullptr, "UnsetTouchScreenAutoPilotState"}, + {20, nullptr, "DeactivateMouse"}, + {21, nullptr, "SetMouseAutoPilotState"}, + {22, nullptr, "UnsetMouseAutoPilotState"}, + {30, nullptr, "DeactivateKeyboard"}, + {31, nullptr, "SetKeyboardAutoPilotState"}, + {32, nullptr, "UnsetKeyboardAutoPilotState"}, + {50, nullptr, "DeactivateXpad"}, + {51, nullptr, "SetXpadAutoPilotState"}, + {52, nullptr, "UnsetXpadAutoPilotState"}, + {60, nullptr, "DeactivateJoyXpad"}, + {91, nullptr, "DeactivateGesture"}, + {110, nullptr, "DeactivateHomeButton"}, + {111, nullptr, "SetHomeButtonAutoPilotState"}, + {112, nullptr, "UnsetHomeButtonAutoPilotState"}, + {120, nullptr, "DeactivateSleepButton"}, + {121, nullptr, "SetSleepButtonAutoPilotState"}, + {122, nullptr, "UnsetSleepButtonAutoPilotState"}, + {123, nullptr, "DeactivateInputDetector"}, + {130, nullptr, "DeactivateCaptureButton"}, + {131, nullptr, "SetCaptureButtonAutoPilotState"}, + {132, nullptr, "UnsetCaptureButtonAutoPilotState"}, + {133, nullptr, "SetShiftAccelerometerCalibrationValue"}, + {134, nullptr, "GetShiftAccelerometerCalibrationValue"}, + {135, nullptr, "SetShiftGyroscopeCalibrationValue"}, + {136, nullptr, "GetShiftGyroscopeCalibrationValue"}, + {140, nullptr, "DeactivateConsoleSixAxisSensor"}, + {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, + {142, nullptr, "DeactivateSevenSixAxisSensor"}, + {201, nullptr, "ActivateFirmwareUpdate"}, + {202, nullptr, "DeactivateFirmwareUpdate"}, + {203, nullptr, "StartFirmwareUpdate"}, + {204, nullptr, "GetFirmwareUpdateStage"}, + {205, nullptr, "GetFirmwareVersion"}, + {206, nullptr, "GetDestinationFirmwareVersion"}, + {207, nullptr, "DiscardFirmwareInfoCacheForRevert"}, + {208, nullptr, "StartFirmwareUpdateForRevert"}, + {209, nullptr, "GetAvailableFirmwareVersionForRevert"}, + {210, nullptr, "IsFirmwareUpdatingDevice"}, + {221, nullptr, "UpdateControllerColor"}, + {222, nullptr, "ConnectUsbPadsAsync"}, + {223, nullptr, "DisconnectUsbPadsAsync"}, + {224, nullptr, "UpdateDesignInfo"}, + {225, nullptr, "GetUniquePadDriverState"}, + {226, nullptr, "GetSixAxisSensorDriverStates"}, + {301, nullptr, "GetAbstractedPadHandles"}, + {302, nullptr, "GetAbstractedPadState"}, + {303, nullptr, "GetAbstractedPadsState"}, + {321, nullptr, "SetAutoPilotVirtualPadState"}, + {322, nullptr, "UnsetAutoPilotVirtualPadState"}, + {323, nullptr, "UnsetAllAutoPilotVirtualPadState"}, + {350, nullptr, "AddRegisteredDevice"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class HidSys final : public ServiceFramework { +public: + explicit HidSys() : ServiceFramework{"hid:sys"} { + // clang-format off + static const FunctionInfo functions[] = { + {31, nullptr, "SendKeyboardLockKeyEvent"}, + {101, nullptr, "AcquireHomeButtonEventHandle"}, + {111, nullptr, "ActivateHomeButton"}, + {121, nullptr, "AcquireSleepButtonEventHandle"}, + {131, nullptr, "ActivateSleepButton"}, + {141, nullptr, "AcquireCaptureButtonEventHandle"}, + {151, nullptr, "ActivateCaptureButton"}, + {210, nullptr, "AcquireNfcDeviceUpdateEventHandle"}, + {211, nullptr, "GetNpadsWithNfc"}, + {212, nullptr, "AcquireNfcActivateEventHandle"}, + {213, nullptr, "ActivateNfc"}, + {214, nullptr, "GetXcdHandleForNpadWithNfc"}, + {215, nullptr, "IsNfcActivated"}, + {230, nullptr, "AcquireIrSensorEventHandle"}, + {231, nullptr, "ActivateIrSensor"}, + {301, nullptr, "ActivateNpadSystem"}, + {303, nullptr, "ApplyNpadSystemCommonPolicy"}, + {304, nullptr, "EnableAssigningSingleOnSlSrPress"}, + {305, nullptr, "DisableAssigningSingleOnSlSrPress"}, + {306, nullptr, "GetLastActiveNpad"}, + {307, nullptr, "GetNpadSystemExtStyle"}, + {308, nullptr, "ApplyNpadSystemCommonPolicyFull"}, + {309, nullptr, "GetNpadFullKeyGripColor"}, + {311, nullptr, "SetNpadPlayerLedBlinkingDevice"}, + {321, nullptr, "GetUniquePadsFromNpad"}, + {322, nullptr, "GetIrSensorState"}, + {323, nullptr, "GetXcdHandleForNpadWithIrSensor"}, + {500, nullptr, "SetAppletResourceUserId"}, + {501, nullptr, "RegisterAppletResourceUserId"}, + {502, nullptr, "UnregisterAppletResourceUserId"}, + {503, nullptr, "EnableAppletToGetInput"}, + {504, nullptr, "SetAruidValidForVibration"}, + {505, nullptr, "EnableAppletToGetSixAxisSensor"}, + {510, nullptr, "SetVibrationMasterVolume"}, + {511, nullptr, "GetVibrationMasterVolume"}, + {512, nullptr, "BeginPermitVibrationSession"}, + {513, nullptr, "EndPermitVibrationSession"}, + {520, nullptr, "EnableHandheldHids"}, + {521, nullptr, "DisableHandheldHids"}, + {540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"}, + {541, nullptr, "GetPlayReportControllerUsages"}, + {542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"}, + {543, nullptr, "GetRegisteredDevicesOld"}, + {544, nullptr, "AcquireConnectionTriggerTimeoutEvent"}, + {545, nullptr, "SendConnectionTrigger"}, + {546, nullptr, "AcquireDeviceRegisteredEventForControllerSupport"}, + {547, nullptr, "GetAllowedBluetoothLinksCount"}, + {548, nullptr, "GetRegisteredDevices"}, + {700, nullptr, "ActivateUniquePad"}, + {702, nullptr, "AcquireUniquePadConnectionEventHandle"}, + {703, nullptr, "GetUniquePadIds"}, + {751, nullptr, "AcquireJoyDetachOnBluetoothOffEventHandle"}, + {800, nullptr, "ListSixAxisSensorHandles"}, + {801, nullptr, "IsSixAxisSensorUserCalibrationSupported"}, + {802, nullptr, "ResetSixAxisSensorCalibrationValues"}, + {803, nullptr, "StartSixAxisSensorUserCalibration"}, + {804, nullptr, "CancelSixAxisSensorUserCalibration"}, + {805, nullptr, "GetUniquePadBluetoothAddress"}, + {806, nullptr, "DisconnectUniquePad"}, + {807, nullptr, "GetUniquePadType"}, + {808, nullptr, "GetUniquePadInterface"}, + {809, nullptr, "GetUniquePadSerialNumber"}, + {810, nullptr, "GetUniquePadControllerNumber"}, + {811, nullptr, "GetSixAxisSensorUserCalibrationStage"}, + {821, nullptr, "StartAnalogStickManualCalibration"}, + {822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"}, + {823, nullptr, "CancelAnalogStickManualCalibration"}, + {824, nullptr, "ResetAnalogStickManualCalibration"}, + {825, nullptr, "GetAnalogStickState"}, + {826, nullptr, "GetAnalogStickManualCalibrationStage"}, + {827, nullptr, "IsAnalogStickButtonPressed"}, + {828, nullptr, "IsAnalogStickInReleasePosition"}, + {829, nullptr, "IsAnalogStickInCircumference"}, + {850, nullptr, "IsUsbFullKeyControllerEnabled"}, + {851, nullptr, "EnableUsbFullKeyController"}, + {852, nullptr, "IsUsbConnected"}, + {900, nullptr, "ActivateInputDetector"}, + {901, nullptr, "NotifyInputDetector"}, + {1000, nullptr, "InitializeFirmwareUpdate"}, + {1001, nullptr, "GetFirmwareVersion"}, + {1002, nullptr, "GetAvailableFirmwareVersion"}, + {1003, nullptr, "IsFirmwareUpdateAvailable"}, + {1004, nullptr, "CheckFirmwareUpdateRequired"}, + {1005, nullptr, "StartFirmwareUpdate"}, + {1006, nullptr, "AbortFirmwareUpdate"}, + {1007, nullptr, "GetFirmwareUpdateState"}, + {1008, nullptr, "ActivateAudioControl"}, + {1009, nullptr, "AcquireAudioControlEventHandle"}, + {1010, nullptr, "GetAudioControlStates"}, + {1011, nullptr, "DeactivateAudioControl"}, + {1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"}, + {1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"}, + {1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"}, + {1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"}, + {1100, nullptr, "GetHidbusSystemServiceObject"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class HidTmp final : public ServiceFramework { +public: + explicit HidTmp() : ServiceFramework{"hid:tmp"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class HidBus final : public ServiceFramework { +public: + explicit HidBus() : ServiceFramework{"hidbus"} { + // clang-format off + static const FunctionInfo functions[] = { + {1, nullptr, "GetBusHandle"}, + {2, nullptr, "IsExternalDeviceConnected"}, + {3, nullptr, "Initialize"}, + {4, nullptr, "Finalize"}, + {5, nullptr, "EnableExternalDevice"}, + {6, nullptr, "GetExternalDeviceId"}, + {7, nullptr, "SendCommandAsync"}, + {8, nullptr, "GetSendCommandAsynceResult"}, + {9, nullptr, "SetEventForSendCommandAsycResult"}, + {10, nullptr, "GetSharedMemoryHandle"}, + {11, nullptr, "EnableJoyPollingReceiveMode"}, + {12, nullptr, "DisableJoyPollingReceiveMode"}, + {13, nullptr, "GetPollingData"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + void ReloadInputDevices() {} 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); + std::make_shared()->InstallAsService(service_manager); + std::make_shared()->InstallAsService(service_manager); std::make_shared()->InstallAsService(service_manager); + std::make_shared()->InstallAsService(service_manager); } -- cgit v1.2.3