diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-09-16 17:40:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-16 17:40:42 +0200 |
commit | 9912704234fe1aae367ef6c93d6ffaa7ce819f42 (patch) | |
tree | a80e4779953422cb3392bc3ee791f3b25bd7575b /src/core/hle/service/hid/controllers | |
parent | Merge pull request #11518 from german77/bad-npad (diff) | |
parent | service: hid: Implement ApplyNpadSystemCommonPolicy (diff) | |
download | yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.tar yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.tar.gz yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.tar.bz2 yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.tar.lz yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.tar.xz yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.tar.zst yuzu-9912704234fe1aae367ef6c93d6ffaa7ce819f42.zip |
Diffstat (limited to 'src/core/hle/service/hid/controllers')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 25 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index e7d25e86e..146bb486d 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -1511,6 +1511,31 @@ Core::HID::NpadButton Controller_NPad::GetAndResetPressState() { return static_cast<Core::HID::NpadButton>(press_state.exchange(0)); } +void Controller_NPad::ApplyNpadSystemCommonPolicy() { + Core::HID::NpadStyleTag styletag{}; + styletag.fullkey.Assign(1); + styletag.handheld.Assign(1); + styletag.joycon_dual.Assign(1); + styletag.system_ext.Assign(1); + styletag.system.Assign(1); + SetSupportedStyleSet(styletag); + + SetNpadHandheldActivationMode(NpadHandheldActivationMode::Dual); + + supported_npad_id_types.clear(); + supported_npad_id_types.resize(10); + supported_npad_id_types[0] = Core::HID::NpadIdType::Player1; + supported_npad_id_types[1] = Core::HID::NpadIdType::Player2; + supported_npad_id_types[2] = Core::HID::NpadIdType::Player3; + supported_npad_id_types[3] = Core::HID::NpadIdType::Player4; + supported_npad_id_types[4] = Core::HID::NpadIdType::Player5; + supported_npad_id_types[5] = Core::HID::NpadIdType::Player6; + supported_npad_id_types[6] = Core::HID::NpadIdType::Player7; + supported_npad_id_types[7] = Core::HID::NpadIdType::Player8; + supported_npad_id_types[8] = Core::HID::NpadIdType::Other; + supported_npad_id_types[9] = Core::HID::NpadIdType::Handheld; +} + bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller) const { if (controller == Core::HID::NpadStyleIndex::Handheld) { const bool support_handheld = diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 09707d2f8..949e58a4c 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -190,6 +190,8 @@ public: // Specifically for cheat engine and other features. Core::HID::NpadButton GetAndResetPressState(); + void ApplyNpadSystemCommonPolicy(); + static bool IsNpadIdValid(Core::HID::NpadIdType npad_id); static Result IsDeviceHandleValid(const Core::HID::VibrationDeviceHandle& device_handle); static Result VerifyValidSixAxisSensorHandle( |