diff options
| author | 2021-09-20 20:18:26 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:23 -0600 | |
| commit | 6e2c84042d296272a2186feac67678c19fdb122b (patch) | |
| tree | 0f1c6e4ad0b158aff656bf73cdc0c42ed207d1de /src | |
| parent | debugger/controller: Remove TAS (diff) | |
| download | yuzu-6e2c84042d296272a2186feac67678c19fdb122b.tar.gz yuzu-6e2c84042d296272a2186feac67678c19fdb122b.tar.xz yuzu-6e2c84042d296272a2186feac67678c19fdb122b.zip | |
settings: Cleanup settings
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.h | 3 | ||||
| -rw-r--r-- | src/common/settings_input.h | 13 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/debug_pad.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/mouse.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 3 |
6 files changed, 16 insertions, 9 deletions
diff --git a/src/common/settings.h b/src/common/settings.h index fa4aa8747..4cf28617c 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -572,7 +572,6 @@ struct Values { | |||
| 572 | BasicSetting<bool> mouse_panning{false, "mouse_panning"}; | 572 | BasicSetting<bool> mouse_panning{false, "mouse_panning"}; |
| 573 | BasicRangedSetting<u8> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"}; | 573 | BasicRangedSetting<u8> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"}; |
| 574 | BasicSetting<bool> mouse_enabled{false, "mouse_enabled"}; | 574 | BasicSetting<bool> mouse_enabled{false, "mouse_enabled"}; |
| 575 | std::string mouse_device; | ||
| 576 | MouseButtonsRaw mouse_buttons; | 575 | MouseButtonsRaw mouse_buttons; |
| 577 | 576 | ||
| 578 | BasicSetting<bool> emulate_analog_keyboard{false, "emulate_analog_keyboard"}; | 577 | BasicSetting<bool> emulate_analog_keyboard{false, "emulate_analog_keyboard"}; |
| @@ -592,8 +591,6 @@ struct Values { | |||
| 592 | BasicSetting<int> touch_from_button_map_index{0, "touch_from_button_map"}; | 591 | BasicSetting<int> touch_from_button_map_index{0, "touch_from_button_map"}; |
| 593 | std::vector<TouchFromButtonMap> touch_from_button_maps; | 592 | std::vector<TouchFromButtonMap> touch_from_button_maps; |
| 594 | 593 | ||
| 595 | std::atomic_bool is_device_reload_pending{true}; | ||
| 596 | |||
| 597 | // Data Storage | 594 | // Data Storage |
| 598 | BasicSetting<bool> use_virtual_sd{true, "use_virtual_sd"}; | 595 | BasicSetting<bool> use_virtual_sd{true, "use_virtual_sd"}; |
| 599 | BasicSetting<bool> gamecard_inserted{false, "gamecard_inserted"}; | 596 | BasicSetting<bool> gamecard_inserted{false, "gamecard_inserted"}; |
diff --git a/src/common/settings_input.h b/src/common/settings_input.h index 609600582..2c0eb31d3 100644 --- a/src/common/settings_input.h +++ b/src/common/settings_input.h | |||
| @@ -62,11 +62,22 @@ enum Values : int { | |||
| 62 | 62 | ||
| 63 | constexpr int STICK_HID_BEGIN = LStick; | 63 | constexpr int STICK_HID_BEGIN = LStick; |
| 64 | constexpr int STICK_HID_END = NumAnalogs; | 64 | constexpr int STICK_HID_END = NumAnalogs; |
| 65 | constexpr int NUM_STICKS_HID = NumAnalogs; | ||
| 66 | 65 | ||
| 67 | extern const std::array<const char*, NumAnalogs> mapping; | 66 | extern const std::array<const char*, NumAnalogs> mapping; |
| 68 | } // namespace NativeAnalog | 67 | } // namespace NativeAnalog |
| 69 | 68 | ||
| 69 | namespace NativeTrigger { | ||
| 70 | enum Values : int { | ||
| 71 | LTrigger, | ||
| 72 | RTrigger, | ||
| 73 | |||
| 74 | NumTriggers, | ||
| 75 | }; | ||
| 76 | |||
| 77 | constexpr int TRIGGER_HID_BEGIN = LTrigger; | ||
| 78 | constexpr int TRIGGER_HID_END = NumTriggers; | ||
| 79 | } // namespace NativeTrigger | ||
| 80 | |||
| 70 | namespace NativeVibration { | 81 | namespace NativeVibration { |
| 71 | enum Values : int { | 82 | enum Values : int { |
| 72 | LeftVibrationDevice, | 83 | LeftVibrationDevice, |
diff --git a/src/core/hle/service/hid/controllers/debug_pad.h b/src/core/hle/service/hid/controllers/debug_pad.h index 1b1645184..e90ae8415 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.h +++ b/src/core/hle/service/hid/controllers/debug_pad.h | |||
| @@ -87,7 +87,7 @@ private: | |||
| 87 | 87 | ||
| 88 | std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID> | 88 | std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID> |
| 89 | buttons; | 89 | buttons; |
| 90 | std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID> | 90 | std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NumAnalogs> |
| 91 | analogs; | 91 | analogs; |
| 92 | }; | 92 | }; |
| 93 | } // namespace Service::HID | 93 | } // namespace Service::HID |
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp index 544a71948..2211f1144 100644 --- a/src/core/hle/service/hid/controllers/mouse.cpp +++ b/src/core/hle/service/hid/controllers/mouse.cpp | |||
| @@ -61,7 +61,7 @@ void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | void Controller_Mouse::OnLoadInputDevices() { | 63 | void Controller_Mouse::OnLoadInputDevices() { |
| 64 | mouse_device = Input::CreateDevice<Input::MouseDevice>(Settings::values.mouse_device); | 64 | //mouse_device = Input::CreateDevice<Input::MouseDevice>(Settings::values.mouse_device); |
| 65 | std::transform(Settings::values.mouse_buttons.begin(), Settings::values.mouse_buttons.end(), | 65 | std::transform(Settings::values.mouse_buttons.begin(), Settings::values.mouse_buttons.end(), |
| 66 | mouse_button_devices.begin(), Input::CreateDevice<Input::ButtonDevice>); | 66 | mouse_button_devices.begin(), Input::CreateDevice<Input::ButtonDevice>); |
| 67 | } | 67 | } |
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 9ee146caf..f3e868bdb 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h | |||
| @@ -563,7 +563,7 @@ private: | |||
| 563 | std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID>, | 563 | std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID>, |
| 564 | 10>; | 564 | 10>; |
| 565 | using StickArray = std::array< | 565 | using StickArray = std::array< |
| 566 | std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID>, | 566 | std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NumAnalogs>, |
| 567 | 10>; | 567 | 10>; |
| 568 | using VibrationArray = std::array<std::array<std::unique_ptr<Input::VibrationDevice>, | 568 | using VibrationArray = std::array<std::array<std::unique_ptr<Input::VibrationDevice>, |
| 569 | Settings::NativeVibration::NUM_VIBRATIONS_HID>, | 569 | Settings::NativeVibration::NUM_VIBRATIONS_HID>, |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 10c64d41a..9a5b60263 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -117,7 +117,7 @@ void IAppletResource::UpdateControllers(std::uintptr_t user_data, | |||
| 117 | std::chrono::nanoseconds ns_late) { | 117 | std::chrono::nanoseconds ns_late) { |
| 118 | auto& core_timing = system.CoreTiming(); | 118 | auto& core_timing = system.CoreTiming(); |
| 119 | 119 | ||
| 120 | const bool should_reload = Settings::values.is_device_reload_pending.exchange(false); | 120 | const bool should_reload = false; |
| 121 | for (const auto& controller : controllers) { | 121 | for (const auto& controller : controllers) { |
| 122 | if (should_reload) { | 122 | if (should_reload) { |
| 123 | controller->OnLoadInputDevices(); | 123 | controller->OnLoadInputDevices(); |
| @@ -2038,7 +2038,6 @@ public: | |||
| 2038 | }; | 2038 | }; |
| 2039 | 2039 | ||
| 2040 | void ReloadInputDevices() { | 2040 | void ReloadInputDevices() { |
| 2041 | Settings::values.is_device_reload_pending.store(true); | ||
| 2042 | } | 2041 | } |
| 2043 | 2042 | ||
| 2044 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { | 2043 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { |