summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-09-18 16:10:30 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-09-18 16:10:30 +0200
commitab961e07014cb308cc983fa869696bf5cb9a0c7d (patch)
tree3ff650bd2d018c916ca331cc7cd27f941e6e4b0d /src/core/hle/service/hid/controllers
parentMerge pull request #4323 from ReinUsesLisp/no-spin (diff)
downloadyuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.tar
yuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.tar.gz
yuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.tar.bz2
yuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.tar.lz
yuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.tar.xz
yuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.tar.zst
yuzu-ab961e07014cb308cc983fa869696bf5cb9a0c7d.zip
Diffstat (limited to 'src/core/hle/service/hid/controllers')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp8
-rw-r--r--src/core/hle/service/hid/controllers/npad.h10
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 7818c098f..59f528dfb 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -495,6 +495,14 @@ Controller_NPad::NpadHoldType Controller_NPad::GetHoldType() const {
return hold_type;
}
+void Controller_NPad::SetNpadHandheldActivationMode(NpadHandheldActivationMode activation_mode) {
+ handheld_activation_mode = activation_mode;
+}
+
+Controller_NPad::NpadHandheldActivationMode Controller_NPad::GetNpadHandheldActivationMode() const {
+ return handheld_activation_mode;
+}
+
void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) {
const std::size_t npad_index = NPadIdToIndex(npad_id);
ASSERT(npad_index < shared_memory_entries.size());
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index e9788da8d..54e950e1b 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -74,6 +74,12 @@ public:
Single = 1,
};
+ enum class NpadHandheldActivationMode : u64 {
+ Dual = 0,
+ Single = 1,
+ None = 2,
+ };
+
enum class NPadControllerType {
None,
ProController,
@@ -110,6 +116,9 @@ public:
void SetHoldType(NpadHoldType joy_hold_type);
NpadHoldType GetHoldType() const;
+ void SetNpadHandheldActivationMode(NpadHandheldActivationMode activation_mode);
+ NpadHandheldActivationMode GetNpadHandheldActivationMode() const;
+
void SetNpadMode(u32 npad_id, NPadAssignments assignment_mode);
void VibrateController(const std::vector<u32>& controller_ids,
@@ -335,6 +344,7 @@ private:
sticks;
std::vector<u32> supported_npad_id_types{};
NpadHoldType hold_type{NpadHoldType::Vertical};
+ NpadHandheldActivationMode handheld_activation_mode{NpadHandheldActivationMode::Dual};
// Each controller should have their own styleset changed event
std::array<Kernel::EventPair, 10> styleset_changed_events;
Vibration last_processed_vibration{};