summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-10-11 07:43:11 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:24 +0100
commit06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch)
tree867fa1153c7285c858cdb5bd7f60f08266532a88 /src/core/hle
parentcore: Update input interpreter (diff)
downloadyuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.bz2
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.lz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.zst
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp27
-rw-r--r--src/core/hle/service/hid/controllers/npad.h18
2 files changed, 5 insertions, 40 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 03cbd42f4..a2e9ddf4d 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -796,7 +796,7 @@ void Controller_NPad::InitializeVibrationDeviceAtIndex(std::size_t npad_index,
}
controller.vibration[device_index].device_mounted =
- controller.device->TestVibration(device_index) == 1;
+ controller.device->TestVibration(device_index);
}
void Controller_NPad::SetPermitVibrationSession(bool permit_vibration_session) {
@@ -954,31 +954,12 @@ bool Controller_NPad::SwapNpadAssignment(u32 npad_id_1, u32 npad_id_2) {
return true;
}
-Controller_NPad::LedPattern Controller_NPad::GetLedPattern(u32 npad_id) {
+Core::HID::LedPattern Controller_NPad::GetLedPattern(u32 npad_id) {
if (npad_id == npad_id_list.back() || npad_id == npad_id_list[npad_id_list.size() - 2]) {
// These are controllers without led patterns
- return LedPattern{0, 0, 0, 0};
- }
- switch (npad_id) {
- case 0:
- return LedPattern{1, 0, 0, 0};
- case 1:
- return LedPattern{1, 1, 0, 0};
- case 2:
- return LedPattern{1, 1, 1, 0};
- case 3:
- return LedPattern{1, 1, 1, 1};
- case 4:
- return LedPattern{1, 0, 0, 1};
- case 5:
- return LedPattern{1, 0, 1, 0};
- case 6:
- return LedPattern{1, 0, 1, 1};
- case 7:
- return LedPattern{0, 1, 1, 0};
- default:
- return LedPattern{0, 0, 0, 0};
+ return Core::HID::LedPattern{0, 0, 0, 0};
}
+ return controller_data[npad_id].device->GetLedPattern();
}
bool Controller_NPad::IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const {
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 483cae5b6..b0e2f8430 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -115,22 +115,6 @@ public:
.freq_high = 320.0f,
};
- struct LedPattern {
- explicit LedPattern(u64 light1, u64 light2, u64 light3, u64 light4) {
- position1.Assign(light1);
- position2.Assign(light2);
- position3.Assign(light3);
- position4.Assign(light4);
- }
- union {
- u64 raw{};
- BitField<0, 1, u64> position1;
- BitField<1, 1, u64> position2;
- BitField<2, 1, u64> position3;
- BitField<3, 1, u64> position4;
- };
- };
-
void SetSupportedStyleSet(Core::HID::NpadStyleTag style_set);
Core::HID::NpadStyleTag GetSupportedStyleSet() const;
@@ -186,7 +170,7 @@ public:
void SetSixAxisFusionParameters(f32 parameter1, f32 parameter2);
std::pair<f32, f32> GetSixAxisFusionParameters();
void ResetSixAxisFusionParameters();
- LedPattern GetLedPattern(u32 npad_id);
+ Core::HID::LedPattern GetLedPattern(u32 npad_id);
bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const;
void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id);
void SetAnalogStickUseCenterClamp(bool use_center_clamp);