diff options
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 220 |
1 files changed, 220 insertions, 0 deletions
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: | |||
| 557 | } | 557 | } |
| 558 | }; | 558 | }; |
| 559 | 559 | ||
| 560 | class HidDbg final : public ServiceFramework<HidDbg> { | ||
| 561 | public: | ||
| 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 | |||
| 629 | class HidSys final : public ServiceFramework<HidSys> { | ||
| 630 | public: | ||
| 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 | |||
| 736 | class HidTmp final : public ServiceFramework<HidTmp> { | ||
| 737 | public: | ||
| 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 | |||
| 749 | class HidBus final : public ServiceFramework<HidBus> { | ||
| 750 | public: | ||
| 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 | |||
| 560 | void ReloadInputDevices() {} | 774 | void ReloadInputDevices() {} |
| 561 | 775 | ||
| 562 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 776 | void InstallInterfaces(SM::ServiceManager& service_manager) { |
| 563 | 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 | |||
| 564 | std::make_shared<IRS>()->InstallAsService(service_manager); | 783 | std::make_shared<IRS>()->InstallAsService(service_manager); |
| 565 | std::make_shared<IRS_SYS>()->InstallAsService(service_manager); | 784 | std::make_shared<IRS_SYS>()->InstallAsService(service_manager); |
| 785 | |||
| 566 | std::make_shared<XCD_SYS>()->InstallAsService(service_manager); | 786 | std::make_shared<XCD_SYS>()->InstallAsService(service_manager); |
| 567 | } | 787 | } |
| 568 | 788 | ||