summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2023-09-16 16:38:10 +0200
committergerman77 <juangerman-13@hotmail.com>2023-09-16 16:38:10 +0200
commita3f235f8a23303796a3727978806f2dcb13894eb (patch)
treec325b9f1d190913dcd885c703bebe4e545cda6ed /src/core/hle/service/hid/controllers
parentMerge pull request #11385 from liamwhite/acceptcancel (diff)
downloadyuzu-a3f235f8a23303796a3727978806f2dcb13894eb.tar
yuzu-a3f235f8a23303796a3727978806f2dcb13894eb.tar.gz
yuzu-a3f235f8a23303796a3727978806f2dcb13894eb.tar.bz2
yuzu-a3f235f8a23303796a3727978806f2dcb13894eb.tar.lz
yuzu-a3f235f8a23303796a3727978806f2dcb13894eb.tar.xz
yuzu-a3f235f8a23303796a3727978806f2dcb13894eb.tar.zst
yuzu-a3f235f8a23303796a3727978806f2dcb13894eb.zip
Diffstat (limited to 'src/core/hle/service/hid/controllers')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp25
-rw-r--r--src/core/hle/service/hid/controllers/npad.h2
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 3b349b4c4..c744b0f87 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -1508,6 +1508,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 776411261..0e9f899a4 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(