summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2019-09-24 09:24:37 +0200
committerDavid Marcec <dmarcecguzman@gmail.com>2019-09-24 09:24:37 +0200
commit77fbf29047ff00760a809876739181da1c477d5f (patch)
tree902e206852f5e4ea1a56e6a1f64aacb51b2f0487
parentMerge pull request #2869 from ReinUsesLisp/suld (diff)
downloadyuzu-77fbf29047ff00760a809876739181da1c477d5f.tar
yuzu-77fbf29047ff00760a809876739181da1c477d5f.tar.gz
yuzu-77fbf29047ff00760a809876739181da1c477d5f.tar.bz2
yuzu-77fbf29047ff00760a809876739181da1c477d5f.tar.lz
yuzu-77fbf29047ff00760a809876739181da1c477d5f.tar.xz
yuzu-77fbf29047ff00760a809876739181da1c477d5f.tar.zst
yuzu-77fbf29047ff00760a809876739181da1c477d5f.zip
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 44b668fbf..a9cd119c4 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -165,13 +165,14 @@ void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) {
controller.battery_level[0] = BATTERY_FULL;
controller.battery_level[1] = BATTERY_FULL;
controller.battery_level[2] = BATTERY_FULL;
+ styleset_changed_events[controller_idx].writable->Signal();
}
void Controller_NPad::OnInit() {
auto& kernel = system.Kernel();
for (std::size_t i = 0; i < styleset_changed_events.size(); i++) {
styleset_changed_events[i] = Kernel::WritableEvent::CreateEventPair(
- kernel, Kernel::ResetType::Automatic, fmt::format("npad:NpadStyleSetChanged_{}", i));
+ kernel, Kernel::ResetType::Manual, fmt::format("npad:NpadStyleSetChanged_{}", i));
}
if (!IsControllerActivated()) {
@@ -433,7 +434,6 @@ void Controller_NPad::SetSupportedNPadIdTypes(u8* data, std::size_t length) {
supported_npad_id_types.clear();
supported_npad_id_types.resize(length / sizeof(u32));
std::memcpy(supported_npad_id_types.data(), data, length);
- bool had_controller_update = false;
for (std::size_t i = 0; i < connected_controllers.size(); i++) {
auto& controller = connected_controllers[i];
if (!controller.is_connected) {
@@ -452,10 +452,6 @@ void Controller_NPad::SetSupportedNPadIdTypes(u8* data, std::size_t length) {
controller.type = requested_controller;
InitNewlyAddedControler(i);
}
- had_controller_update = true;
- }
- if (had_controller_update) {
- styleset_changed_events[i].writable->Signal();
}
}
}
@@ -481,7 +477,6 @@ 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());
if (shared_memory_entries[npad_index].pad_assignment != assignment_mode) {
- styleset_changed_events[npad_index].writable->Signal();
shared_memory_entries[npad_index].pad_assignment = assignment_mode;
}
}
@@ -507,7 +502,6 @@ Kernel::SharedPtr<Kernel::ReadableEvent> Controller_NPad::GetStyleSetChangedEven
// TODO(ogniK): Figure out the best time to signal this event. This event seems that it should
// be signalled at least once, and signaled after a new controller is connected?
const auto& styleset_event = styleset_changed_events[NPadIdToIndex(npad_id)];
- styleset_event.writable->Signal();
return styleset_event.readable;
}