summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/hid/hid.cpp8
-rw-r--r--src/core/settings.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 0d31abe8b..a8e0c869f 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -2,7 +2,6 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <atomic>
6#include "common/logging/log.h" 5#include "common/logging/log.h"
7#include "core/core.h" 6#include "core/core.h"
8#include "core/core_timing.h" 7#include "core/core_timing.h"
@@ -78,7 +77,7 @@ private:
78 SharedMemory mem{}; 77 SharedMemory mem{};
79 std::memcpy(&mem, shared_mem->GetPointer(), sizeof(SharedMemory)); 78 std::memcpy(&mem, shared_mem->GetPointer(), sizeof(SharedMemory));
80 79
81 if (is_device_reload_pending.exchange(false)) 80 if (Settings::values.is_device_reload_pending.exchange(false))
82 LoadInputDevices(); 81 LoadInputDevices();
83 82
84 // Set up controllers as neon red+blue Joy-Con attached to console 83 // Set up controllers as neon red+blue Joy-Con attached to console
@@ -267,7 +266,6 @@ private:
267 CoreTiming::EventType* pad_update_event; 266 CoreTiming::EventType* pad_update_event;
268 267
269 // Stored input state info 268 // Stored input state info
270 std::atomic<bool> is_device_reload_pending{true};
271 std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID> 269 std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID>
272 buttons; 270 buttons;
273 std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID> sticks; 271 std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID> sticks;
@@ -797,7 +795,9 @@ public:
797 } 795 }
798}; 796};
799 797
800void ReloadInputDevices() {} 798void ReloadInputDevices() {
799 Settings::values.is_device_reload_pending.store(true);
800}
801 801
802void InstallInterfaces(SM::ServiceManager& service_manager) { 802void InstallInterfaces(SM::ServiceManager& service_manager) {
803 std::make_shared<Hid>()->InstallAsService(service_manager); 803 std::make_shared<Hid>()->InstallAsService(service_manager);
diff --git a/src/core/settings.h b/src/core/settings.h
index 5bf1863e6..08a16ef2c 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -5,6 +5,7 @@
5#pragma once 5#pragma once
6 6
7#include <array> 7#include <array>
8#include <atomic>
8#include <string> 9#include <string>
9#include "common/common_types.h" 10#include "common/common_types.h"
10 11
@@ -120,6 +121,7 @@ struct Values {
120 std::array<std::string, NativeAnalog::NumAnalogs> analogs; 121 std::array<std::string, NativeAnalog::NumAnalogs> analogs;
121 std::string motion_device; 122 std::string motion_device;
122 std::string touch_device; 123 std::string touch_device;
124 std::atomic_bool is_device_reload_pending{true};
123 125
124 // Core 126 // Core
125 bool use_cpu_jit; 127 bool use_cpu_jit;