summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-27 07:18:29 -0700
committerGravatar GitHub2018-07-27 07:18:29 -0700
commite247bd577c4725fc36e58308a2d9f652ecdf7d80 (patch)
treee7eda5b32d09450ac6030c02cfaa8145e18ebe47
parentMerge pull request #836 from FearlessTobi/port-3594 (diff)
parentservice/hid: Add the hidbus, hid:dbg, hid:sys, and hid:tmp services (diff)
downloadyuzu-e247bd577c4725fc36e58308a2d9f652ecdf7d80.tar.gz
yuzu-e247bd577c4725fc36e58308a2d9f652ecdf7d80.tar.xz
yuzu-e247bd577c4725fc36e58308a2d9f652ecdf7d80.zip
Merge pull request #833 from lioncash/irs
service/hid: Add missing services
Diffstat (limited to '')
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/hle/service/hid/hid.cpp225
-rw-r--r--src/core/hle/service/hid/irs.cpp49
-rw-r--r--src/core/hle/service/hid/irs.h21
-rw-r--r--src/core/hle/service/hid/xcd.cpp37
-rw-r--r--src/core/hle/service/hid/xcd.h16
6 files changed, 352 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 063e18d64..b74e495ef 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -160,6 +160,10 @@ add_library(core STATIC
160 hle/service/grc/grc.h 160 hle/service/grc/grc.h
161 hle/service/hid/hid.cpp 161 hle/service/hid/hid.cpp
162 hle/service/hid/hid.h 162 hle/service/hid/hid.h
163 hle/service/hid/irs.cpp
164 hle/service/hid/irs.h
165 hle/service/hid/xcd.cpp
166 hle/service/hid/xcd.h
163 hle/service/ldn/ldn.cpp 167 hle/service/ldn/ldn.cpp
164 hle/service/ldn/ldn.h 168 hle/service/ldn/ldn.h
165 hle/service/ldr/ldr.cpp 169 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..e4619a547 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -14,6 +14,8 @@
14#include "core/hle/kernel/event.h" 14#include "core/hle/kernel/event.h"
15#include "core/hle/kernel/shared_memory.h" 15#include "core/hle/kernel/shared_memory.h"
16#include "core/hle/service/hid/hid.h" 16#include "core/hle/service/hid/hid.h"
17#include "core/hle/service/hid/irs.h"
18#include "core/hle/service/hid/xcd.h"
17#include "core/hle/service/service.h" 19#include "core/hle/service/service.h"
18 20
19namespace Service::HID { 21namespace Service::HID {
@@ -555,10 +557,233 @@ private:
555 } 557 }
556}; 558};
557 559
560class HidDbg final : public ServiceFramework<HidDbg> {
561public:
562 explicit HidDbg() : ServiceFramework{"hid:dbg"} {
563 // clang-format off
564 static const FunctionInfo functions[] = {
565 {0, nullptr, "DeactivateDebugPad"},
566 {1, nullptr, "SetDebugPadAutoPilotState"},
567 {2, nullptr, "UnsetDebugPadAutoPilotState"},
568 {10, nullptr, "DeactivateTouchScreen"},
569 {11, nullptr, "SetTouchScreenAutoPilotState"},
570 {12, nullptr, "UnsetTouchScreenAutoPilotState"},
571 {20, nullptr, "DeactivateMouse"},
572 {21, nullptr, "SetMouseAutoPilotState"},
573 {22, nullptr, "UnsetMouseAutoPilotState"},
574 {30, nullptr, "DeactivateKeyboard"},
575 {31, nullptr, "SetKeyboardAutoPilotState"},
576 {32, nullptr, "UnsetKeyboardAutoPilotState"},
577 {50, nullptr, "DeactivateXpad"},
578 {51, nullptr, "SetXpadAutoPilotState"},
579 {52, nullptr, "UnsetXpadAutoPilotState"},
580 {60, nullptr, "DeactivateJoyXpad"},
581 {91, nullptr, "DeactivateGesture"},
582 {110, nullptr, "DeactivateHomeButton"},
583 {111, nullptr, "SetHomeButtonAutoPilotState"},
584 {112, nullptr, "UnsetHomeButtonAutoPilotState"},
585 {120, nullptr, "DeactivateSleepButton"},
586 {121, nullptr, "SetSleepButtonAutoPilotState"},
587 {122, nullptr, "UnsetSleepButtonAutoPilotState"},
588 {123, nullptr, "DeactivateInputDetector"},
589 {130, nullptr, "DeactivateCaptureButton"},
590 {131, nullptr, "SetCaptureButtonAutoPilotState"},
591 {132, nullptr, "UnsetCaptureButtonAutoPilotState"},
592 {133, nullptr, "SetShiftAccelerometerCalibrationValue"},
593 {134, nullptr, "GetShiftAccelerometerCalibrationValue"},
594 {135, nullptr, "SetShiftGyroscopeCalibrationValue"},
595 {136, nullptr, "GetShiftGyroscopeCalibrationValue"},
596 {140, nullptr, "DeactivateConsoleSixAxisSensor"},
597 {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"},
598 {142, nullptr, "DeactivateSevenSixAxisSensor"},
599 {201, nullptr, "ActivateFirmwareUpdate"},
600 {202, nullptr, "DeactivateFirmwareUpdate"},
601 {203, nullptr, "StartFirmwareUpdate"},
602 {204, nullptr, "GetFirmwareUpdateStage"},
603 {205, nullptr, "GetFirmwareVersion"},
604 {206, nullptr, "GetDestinationFirmwareVersion"},
605 {207, nullptr, "DiscardFirmwareInfoCacheForRevert"},
606 {208, nullptr, "StartFirmwareUpdateForRevert"},
607 {209, nullptr, "GetAvailableFirmwareVersionForRevert"},
608 {210, nullptr, "IsFirmwareUpdatingDevice"},
609 {221, nullptr, "UpdateControllerColor"},
610 {222, nullptr, "ConnectUsbPadsAsync"},
611 {223, nullptr, "DisconnectUsbPadsAsync"},
612 {224, nullptr, "UpdateDesignInfo"},
613 {225, nullptr, "GetUniquePadDriverState"},
614 {226, nullptr, "GetSixAxisSensorDriverStates"},
615 {301, nullptr, "GetAbstractedPadHandles"},
616 {302, nullptr, "GetAbstractedPadState"},
617 {303, nullptr, "GetAbstractedPadsState"},
618 {321, nullptr, "SetAutoPilotVirtualPadState"},
619 {322, nullptr, "UnsetAutoPilotVirtualPadState"},
620 {323, nullptr, "UnsetAllAutoPilotVirtualPadState"},
621 {350, nullptr, "AddRegisteredDevice"},
622 };
623 // clang-format on
624
625 RegisterHandlers(functions);
626 }
627};
628
629class HidSys final : public ServiceFramework<HidSys> {
630public:
631 explicit HidSys() : ServiceFramework{"hid:sys"} {
632 // clang-format off
633 static const FunctionInfo functions[] = {
634 {31, nullptr, "SendKeyboardLockKeyEvent"},
635 {101, nullptr, "AcquireHomeButtonEventHandle"},
636 {111, nullptr, "ActivateHomeButton"},
637 {121, nullptr, "AcquireSleepButtonEventHandle"},
638 {131, nullptr, "ActivateSleepButton"},
639 {141, nullptr, "AcquireCaptureButtonEventHandle"},
640 {151, nullptr, "ActivateCaptureButton"},
641 {210, nullptr, "AcquireNfcDeviceUpdateEventHandle"},
642 {211, nullptr, "GetNpadsWithNfc"},
643 {212, nullptr, "AcquireNfcActivateEventHandle"},
644 {213, nullptr, "ActivateNfc"},
645 {214, nullptr, "GetXcdHandleForNpadWithNfc"},
646 {215, nullptr, "IsNfcActivated"},
647 {230, nullptr, "AcquireIrSensorEventHandle"},
648 {231, nullptr, "ActivateIrSensor"},
649 {301, nullptr, "ActivateNpadSystem"},
650 {303, nullptr, "ApplyNpadSystemCommonPolicy"},
651 {304, nullptr, "EnableAssigningSingleOnSlSrPress"},
652 {305, nullptr, "DisableAssigningSingleOnSlSrPress"},
653 {306, nullptr, "GetLastActiveNpad"},
654 {307, nullptr, "GetNpadSystemExtStyle"},
655 {308, nullptr, "ApplyNpadSystemCommonPolicyFull"},
656 {309, nullptr, "GetNpadFullKeyGripColor"},
657 {311, nullptr, "SetNpadPlayerLedBlinkingDevice"},
658 {321, nullptr, "GetUniquePadsFromNpad"},
659 {322, nullptr, "GetIrSensorState"},
660 {323, nullptr, "GetXcdHandleForNpadWithIrSensor"},
661 {500, nullptr, "SetAppletResourceUserId"},
662 {501, nullptr, "RegisterAppletResourceUserId"},
663 {502, nullptr, "UnregisterAppletResourceUserId"},
664 {503, nullptr, "EnableAppletToGetInput"},
665 {504, nullptr, "SetAruidValidForVibration"},
666 {505, nullptr, "EnableAppletToGetSixAxisSensor"},
667 {510, nullptr, "SetVibrationMasterVolume"},
668 {511, nullptr, "GetVibrationMasterVolume"},
669 {512, nullptr, "BeginPermitVibrationSession"},
670 {513, nullptr, "EndPermitVibrationSession"},
671 {520, nullptr, "EnableHandheldHids"},
672 {521, nullptr, "DisableHandheldHids"},
673 {540, nullptr, "AcquirePlayReportControllerUsageUpdateEvent"},
674 {541, nullptr, "GetPlayReportControllerUsages"},
675 {542, nullptr, "AcquirePlayReportRegisteredDeviceUpdateEvent"},
676 {543, nullptr, "GetRegisteredDevicesOld"},
677 {544, nullptr, "AcquireConnectionTriggerTimeoutEvent"},
678 {545, nullptr, "SendConnectionTrigger"},
679 {546, nullptr, "AcquireDeviceRegisteredEventForControllerSupport"},
680 {547, nullptr, "GetAllowedBluetoothLinksCount"},
681 {548, nullptr, "GetRegisteredDevices"},
682 {700, nullptr, "ActivateUniquePad"},
683 {702, nullptr, "AcquireUniquePadConnectionEventHandle"},
684 {703, nullptr, "GetUniquePadIds"},
685 {751, nullptr, "AcquireJoyDetachOnBluetoothOffEventHandle"},
686 {800, nullptr, "ListSixAxisSensorHandles"},
687 {801, nullptr, "IsSixAxisSensorUserCalibrationSupported"},
688 {802, nullptr, "ResetSixAxisSensorCalibrationValues"},
689 {803, nullptr, "StartSixAxisSensorUserCalibration"},
690 {804, nullptr, "CancelSixAxisSensorUserCalibration"},
691 {805, nullptr, "GetUniquePadBluetoothAddress"},
692 {806, nullptr, "DisconnectUniquePad"},
693 {807, nullptr, "GetUniquePadType"},
694 {808, nullptr, "GetUniquePadInterface"},
695 {809, nullptr, "GetUniquePadSerialNumber"},
696 {810, nullptr, "GetUniquePadControllerNumber"},
697 {811, nullptr, "GetSixAxisSensorUserCalibrationStage"},
698 {821, nullptr, "StartAnalogStickManualCalibration"},
699 {822, nullptr, "RetryCurrentAnalogStickManualCalibrationStage"},
700 {823, nullptr, "CancelAnalogStickManualCalibration"},
701 {824, nullptr, "ResetAnalogStickManualCalibration"},
702 {825, nullptr, "GetAnalogStickState"},
703 {826, nullptr, "GetAnalogStickManualCalibrationStage"},
704 {827, nullptr, "IsAnalogStickButtonPressed"},
705 {828, nullptr, "IsAnalogStickInReleasePosition"},
706 {829, nullptr, "IsAnalogStickInCircumference"},
707 {850, nullptr, "IsUsbFullKeyControllerEnabled"},
708 {851, nullptr, "EnableUsbFullKeyController"},
709 {852, nullptr, "IsUsbConnected"},
710 {900, nullptr, "ActivateInputDetector"},
711 {901, nullptr, "NotifyInputDetector"},
712 {1000, nullptr, "InitializeFirmwareUpdate"},
713 {1001, nullptr, "GetFirmwareVersion"},
714 {1002, nullptr, "GetAvailableFirmwareVersion"},
715 {1003, nullptr, "IsFirmwareUpdateAvailable"},
716 {1004, nullptr, "CheckFirmwareUpdateRequired"},
717 {1005, nullptr, "StartFirmwareUpdate"},
718 {1006, nullptr, "AbortFirmwareUpdate"},
719 {1007, nullptr, "GetFirmwareUpdateState"},
720 {1008, nullptr, "ActivateAudioControl"},
721 {1009, nullptr, "AcquireAudioControlEventHandle"},
722 {1010, nullptr, "GetAudioControlStates"},
723 {1011, nullptr, "DeactivateAudioControl"},
724 {1050, nullptr, "IsSixAxisSensorAccurateUserCalibrationSupported"},
725 {1051, nullptr, "StartSixAxisSensorAccurateUserCalibration"},
726 {1052, nullptr, "CancelSixAxisSensorAccurateUserCalibration"},
727 {1053, nullptr, "GetSixAxisSensorAccurateUserCalibrationState"},
728 {1100, nullptr, "GetHidbusSystemServiceObject"},
729 };
730 // clang-format on
731
732 RegisterHandlers(functions);
733 }
734};
735
736class HidTmp final : public ServiceFramework<HidTmp> {
737public:
738 explicit HidTmp() : ServiceFramework{"hid:tmp"} {
739 // clang-format off
740 static const FunctionInfo functions[] = {
741 {0, nullptr, "GetConsoleSixAxisSensorCalibrationValues"},
742 };
743 // clang-format on
744
745 RegisterHandlers(functions);
746 }
747};
748
749class HidBus final : public ServiceFramework<HidBus> {
750public:
751 explicit HidBus() : ServiceFramework{"hidbus"} {
752 // clang-format off
753 static const FunctionInfo functions[] = {
754 {1, nullptr, "GetBusHandle"},
755 {2, nullptr, "IsExternalDeviceConnected"},
756 {3, nullptr, "Initialize"},
757 {4, nullptr, "Finalize"},
758 {5, nullptr, "EnableExternalDevice"},
759 {6, nullptr, "GetExternalDeviceId"},
760 {7, nullptr, "SendCommandAsync"},
761 {8, nullptr, "GetSendCommandAsynceResult"},
762 {9, nullptr, "SetEventForSendCommandAsycResult"},
763 {10, nullptr, "GetSharedMemoryHandle"},
764 {11, nullptr, "EnableJoyPollingReceiveMode"},
765 {12, nullptr, "DisableJoyPollingReceiveMode"},
766 {13, nullptr, "GetPollingData"},
767 };
768 // clang-format on
769
770 RegisterHandlers(functions);
771 }
772};
773
558void ReloadInputDevices() {} 774void ReloadInputDevices() {}
559 775
560void InstallInterfaces(SM::ServiceManager& service_manager) { 776void InstallInterfaces(SM::ServiceManager& service_manager) {
561 std::make_shared<Hid>()->InstallAsService(service_manager); 777 std::make_shared<Hid>()->InstallAsService(service_manager);
778 std::make_shared<HidBus>()->InstallAsService(service_manager);
779 std::make_shared<HidDbg>()->InstallAsService(service_manager);
780 std::make_shared<HidSys>()->InstallAsService(service_manager);
781 std::make_shared<HidTmp>()->InstallAsService(service_manager);
782
783 std::make_shared<IRS>()->InstallAsService(service_manager);
784 std::make_shared<IRS_SYS>()->InstallAsService(service_manager);
785
786 std::make_shared<XCD_SYS>()->InstallAsService(service_manager);
562} 787}
563 788
564} // namespace Service::HID 789} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/hid/irs.h"
6
7namespace Service::HID {
8
9IRS::IRS() : ServiceFramework{"irs"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {302, nullptr, "ActivateIrsensor"},
13 {303, nullptr, "DeactivateIrsensor"},
14 {304, nullptr, "GetIrsensorSharedMemoryHandle"},
15 {305, nullptr, "StopImageProcessor"},
16 {306, nullptr, "RunMomentProcessor"},
17 {307, nullptr, "RunClusteringProcessor"},
18 {308, nullptr, "RunImageTransferProcessor"},
19 {309, nullptr, "GetImageTransferProcessorState"},
20 {310, nullptr, "RunTeraPluginProcessor"},
21 {311, nullptr, "GetNpadIrCameraHandle"},
22 {312, nullptr, "RunPointingProcessor"},
23 {313, nullptr, "SuspendImageProcessor"},
24 {314, nullptr, "CheckFirmwareVersion"},
25 {315, nullptr, "SetFunctionLevel"},
26 {316, nullptr, "RunImageTransferExProcessor"},
27 {317, nullptr, "RunIrLedProcessor"},
28 {318, nullptr, "StopImageProcessorAsync"},
29 {319, nullptr, "ActivateIrsensorWithFunctionLevel"},
30 };
31 // clang-format on
32
33 RegisterHandlers(functions);
34}
35
36IRS_SYS::IRS_SYS() : ServiceFramework{"irs:sys"} {
37 // clang-format off
38 static const FunctionInfo functions[] = {
39 {500, nullptr, "SetAppletResourceUserId"},
40 {501, nullptr, "RegisterAppletResourceUserId"},
41 {502, nullptr, "UnregisterAppletResourceUserId"},
42 {503, nullptr, "EnableAppletToGetInput"},
43 };
44 // clang-format on
45
46 RegisterHandlers(functions);
47}
48
49} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::HID {
10
11class IRS final : public ServiceFramework<IRS> {
12public:
13 explicit IRS();
14};
15
16class IRS_SYS final : public ServiceFramework<IRS_SYS> {
17public:
18 explicit IRS_SYS();
19};
20
21} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/hid/xcd.h"
6
7namespace Service::HID {
8
9XCD_SYS::XCD_SYS() : ServiceFramework{"xcd:sys"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetDataFormat"},
13 {1, nullptr, "SetDataFormat"},
14 {2, nullptr, "GetMcuState"},
15 {3, nullptr, "SetMcuState"},
16 {4, nullptr, "GetMcuVersionForNfc"},
17 {5, nullptr, "CheckNfcDevicePower"},
18 {10, nullptr, "SetNfcEvent"},
19 {11, nullptr, "GetNfcInfo"},
20 {12, nullptr, "StartNfcDiscovery"},
21 {13, nullptr, "StopNfcDiscovery"},
22 {14, nullptr, "StartNtagRead"},
23 {15, nullptr, "StartNtagWrite"},
24 {16, nullptr, "SendNfcRawData"},
25 {17, nullptr, "RegisterMifareKey"},
26 {18, nullptr, "ClearMifareKey"},
27 {19, nullptr, "StartMifareRead"},
28 {20, nullptr, "StartMifareWrite"},
29 {101, nullptr, "GetAwakeTriggerReasonForLeftRail"},
30 {102, nullptr, "GetAwakeTriggerReasonForRightRail"},
31 };
32 // clang-format on
33
34 RegisterHandlers(functions);
35}
36
37} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::HID {
10
11class XCD_SYS final : public ServiceFramework<XCD_SYS> {
12public:
13 explicit XCD_SYS();
14};
15
16} // namespace Service::HID