diff options
| author | 2023-12-23 13:58:09 -0500 | |
|---|---|---|
| committer | 2023-12-23 15:36:44 -0500 | |
| commit | f34d3d7e84a1396d4d4f07ec1434b06b1f39bb8a (patch) | |
| tree | e04a08b7ecf57be7aa7a9d2801f09eddd5d19018 /src/core/hle/service/hid | |
| parent | Merge pull request #12412 from ameerj/gl-query-prims (diff) | |
| download | yuzu-f34d3d7e84a1396d4d4f07ec1434b06b1f39bb8a.tar.gz yuzu-f34d3d7e84a1396d4d4f07ec1434b06b1f39bb8a.tar.xz yuzu-f34d3d7e84a1396d4d4f07ec1434b06b1f39bb8a.zip | |
core_timing: remove user data value
Diffstat (limited to 'src/core/hle/service/hid')
| -rw-r--r-- | src/core/hle/service/hid/hidbus.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hidbus.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/resource_manager.cpp | 42 | ||||
| -rw-r--r-- | src/core/hle/service/hid/resource_manager.h | 8 |
4 files changed, 29 insertions, 31 deletions
diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp index 80aac221b..854de2fe2 100644 --- a/src/core/hle/service/hid/hidbus.cpp +++ b/src/core/hle/service/hid/hidbus.cpp | |||
| @@ -49,10 +49,10 @@ HidBus::HidBus(Core::System& system_) | |||
| 49 | // Register update callbacks | 49 | // Register update callbacks |
| 50 | hidbus_update_event = Core::Timing::CreateEvent( | 50 | hidbus_update_event = Core::Timing::CreateEvent( |
| 51 | "Hidbus::UpdateCallback", | 51 | "Hidbus::UpdateCallback", |
| 52 | [this](std::uintptr_t user_data, s64 time, | 52 | [this](s64 time, |
| 53 | std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { | 53 | std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { |
| 54 | const auto guard = LockService(); | 54 | const auto guard = LockService(); |
| 55 | UpdateHidbus(user_data, ns_late); | 55 | UpdateHidbus(ns_late); |
| 56 | return std::nullopt; | 56 | return std::nullopt; |
| 57 | }); | 57 | }); |
| 58 | 58 | ||
| @@ -61,10 +61,10 @@ HidBus::HidBus(Core::System& system_) | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | HidBus::~HidBus() { | 63 | HidBus::~HidBus() { |
| 64 | system.CoreTiming().UnscheduleEvent(hidbus_update_event, 0); | 64 | system.CoreTiming().UnscheduleEvent(hidbus_update_event); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | void HidBus::UpdateHidbus(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { | 67 | void HidBus::UpdateHidbus(std::chrono::nanoseconds ns_late) { |
| 68 | if (is_hidbus_enabled) { | 68 | if (is_hidbus_enabled) { |
| 69 | for (std::size_t i = 0; i < devices.size(); ++i) { | 69 | for (std::size_t i = 0; i < devices.size(); ++i) { |
| 70 | if (!devices[i].is_device_initializated) { | 70 | if (!devices[i].is_device_initializated) { |
diff --git a/src/core/hle/service/hid/hidbus.h b/src/core/hle/service/hid/hidbus.h index c29b5e882..85a1df133 100644 --- a/src/core/hle/service/hid/hidbus.h +++ b/src/core/hle/service/hid/hidbus.h | |||
| @@ -108,7 +108,7 @@ private: | |||
| 108 | void DisableJoyPollingReceiveMode(HLERequestContext& ctx); | 108 | void DisableJoyPollingReceiveMode(HLERequestContext& ctx); |
| 109 | void SetStatusManagerType(HLERequestContext& ctx); | 109 | void SetStatusManagerType(HLERequestContext& ctx); |
| 110 | 110 | ||
| 111 | void UpdateHidbus(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 111 | void UpdateHidbus(std::chrono::nanoseconds ns_late); |
| 112 | std::optional<std::size_t> GetDeviceIndexFromHandle(BusHandle handle) const; | 112 | std::optional<std::size_t> GetDeviceIndexFromHandle(BusHandle handle) const; |
| 113 | 113 | ||
| 114 | template <typename T> | 114 | template <typename T> |
diff --git a/src/core/hle/service/hid/resource_manager.cpp b/src/core/hle/service/hid/resource_manager.cpp index 6c6cbd802..afc61f70d 100644 --- a/src/core/hle/service/hid/resource_manager.cpp +++ b/src/core/hle/service/hid/resource_manager.cpp | |||
| @@ -227,8 +227,7 @@ void ResourceManager::EnableTouchScreen(u64 aruid, bool is_enabled) { | |||
| 227 | applet_resource->EnableTouchScreen(aruid, is_enabled); | 227 | applet_resource->EnableTouchScreen(aruid, is_enabled); |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | void ResourceManager::UpdateControllers(std::uintptr_t user_data, | 230 | void ResourceManager::UpdateControllers(std::chrono::nanoseconds ns_late) { |
| 231 | std::chrono::nanoseconds ns_late) { | ||
| 232 | auto& core_timing = system.CoreTiming(); | 231 | auto& core_timing = system.CoreTiming(); |
| 233 | debug_pad->OnUpdate(core_timing); | 232 | debug_pad->OnUpdate(core_timing); |
| 234 | digitizer->OnUpdate(core_timing); | 233 | digitizer->OnUpdate(core_timing); |
| @@ -241,20 +240,19 @@ void ResourceManager::UpdateControllers(std::uintptr_t user_data, | |||
| 241 | capture_button->OnUpdate(core_timing); | 240 | capture_button->OnUpdate(core_timing); |
| 242 | } | 241 | } |
| 243 | 242 | ||
| 244 | void ResourceManager::UpdateNpad(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { | 243 | void ResourceManager::UpdateNpad(std::chrono::nanoseconds ns_late) { |
| 245 | auto& core_timing = system.CoreTiming(); | 244 | auto& core_timing = system.CoreTiming(); |
| 246 | npad->OnUpdate(core_timing); | 245 | npad->OnUpdate(core_timing); |
| 247 | } | 246 | } |
| 248 | 247 | ||
| 249 | void ResourceManager::UpdateMouseKeyboard(std::uintptr_t user_data, | 248 | void ResourceManager::UpdateMouseKeyboard(std::chrono::nanoseconds ns_late) { |
| 250 | std::chrono::nanoseconds ns_late) { | ||
| 251 | auto& core_timing = system.CoreTiming(); | 249 | auto& core_timing = system.CoreTiming(); |
| 252 | mouse->OnUpdate(core_timing); | 250 | mouse->OnUpdate(core_timing); |
| 253 | debug_mouse->OnUpdate(core_timing); | 251 | debug_mouse->OnUpdate(core_timing); |
| 254 | keyboard->OnUpdate(core_timing); | 252 | keyboard->OnUpdate(core_timing); |
| 255 | } | 253 | } |
| 256 | 254 | ||
| 257 | void ResourceManager::UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { | 255 | void ResourceManager::UpdateMotion(std::chrono::nanoseconds ns_late) { |
| 258 | auto& core_timing = system.CoreTiming(); | 256 | auto& core_timing = system.CoreTiming(); |
| 259 | six_axis->OnUpdate(core_timing); | 257 | six_axis->OnUpdate(core_timing); |
| 260 | seven_six_axis->OnUpdate(core_timing); | 258 | seven_six_axis->OnUpdate(core_timing); |
| @@ -273,34 +271,34 @@ IAppletResource::IAppletResource(Core::System& system_, std::shared_ptr<Resource | |||
| 273 | // Register update callbacks | 271 | // Register update callbacks |
| 274 | npad_update_event = Core::Timing::CreateEvent( | 272 | npad_update_event = Core::Timing::CreateEvent( |
| 275 | "HID::UpdatePadCallback", | 273 | "HID::UpdatePadCallback", |
| 276 | [this, resource](std::uintptr_t user_data, s64 time, std::chrono::nanoseconds ns_late) | 274 | [this, resource]( |
| 277 | -> std::optional<std::chrono::nanoseconds> { | 275 | s64 time, std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { |
| 278 | const auto guard = LockService(); | 276 | const auto guard = LockService(); |
| 279 | resource->UpdateNpad(user_data, ns_late); | 277 | resource->UpdateNpad(ns_late); |
| 280 | return std::nullopt; | 278 | return std::nullopt; |
| 281 | }); | 279 | }); |
| 282 | default_update_event = Core::Timing::CreateEvent( | 280 | default_update_event = Core::Timing::CreateEvent( |
| 283 | "HID::UpdateDefaultCallback", | 281 | "HID::UpdateDefaultCallback", |
| 284 | [this, resource](std::uintptr_t user_data, s64 time, std::chrono::nanoseconds ns_late) | 282 | [this, resource]( |
| 285 | -> std::optional<std::chrono::nanoseconds> { | 283 | s64 time, std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { |
| 286 | const auto guard = LockService(); | 284 | const auto guard = LockService(); |
| 287 | resource->UpdateControllers(user_data, ns_late); | 285 | resource->UpdateControllers(ns_late); |
| 288 | return std::nullopt; | 286 | return std::nullopt; |
| 289 | }); | 287 | }); |
| 290 | mouse_keyboard_update_event = Core::Timing::CreateEvent( | 288 | mouse_keyboard_update_event = Core::Timing::CreateEvent( |
| 291 | "HID::UpdateMouseKeyboardCallback", | 289 | "HID::UpdateMouseKeyboardCallback", |
| 292 | [this, resource](std::uintptr_t user_data, s64 time, std::chrono::nanoseconds ns_late) | 290 | [this, resource]( |
| 293 | -> std::optional<std::chrono::nanoseconds> { | 291 | s64 time, std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { |
| 294 | const auto guard = LockService(); | 292 | const auto guard = LockService(); |
| 295 | resource->UpdateMouseKeyboard(user_data, ns_late); | 293 | resource->UpdateMouseKeyboard(ns_late); |
| 296 | return std::nullopt; | 294 | return std::nullopt; |
| 297 | }); | 295 | }); |
| 298 | motion_update_event = Core::Timing::CreateEvent( | 296 | motion_update_event = Core::Timing::CreateEvent( |
| 299 | "HID::UpdateMotionCallback", | 297 | "HID::UpdateMotionCallback", |
| 300 | [this, resource](std::uintptr_t user_data, s64 time, std::chrono::nanoseconds ns_late) | 298 | [this, resource]( |
| 301 | -> std::optional<std::chrono::nanoseconds> { | 299 | s64 time, std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { |
| 302 | const auto guard = LockService(); | 300 | const auto guard = LockService(); |
| 303 | resource->UpdateMotion(user_data, ns_late); | 301 | resource->UpdateMotion(ns_late); |
| 304 | return std::nullopt; | 302 | return std::nullopt; |
| 305 | }); | 303 | }); |
| 306 | 304 | ||
| @@ -314,10 +312,10 @@ IAppletResource::IAppletResource(Core::System& system_, std::shared_ptr<Resource | |||
| 314 | } | 312 | } |
| 315 | 313 | ||
| 316 | IAppletResource::~IAppletResource() { | 314 | IAppletResource::~IAppletResource() { |
| 317 | system.CoreTiming().UnscheduleEvent(npad_update_event, 0); | 315 | system.CoreTiming().UnscheduleEvent(npad_update_event); |
| 318 | system.CoreTiming().UnscheduleEvent(default_update_event, 0); | 316 | system.CoreTiming().UnscheduleEvent(default_update_event); |
| 319 | system.CoreTiming().UnscheduleEvent(mouse_keyboard_update_event, 0); | 317 | system.CoreTiming().UnscheduleEvent(mouse_keyboard_update_event); |
| 320 | system.CoreTiming().UnscheduleEvent(motion_update_event, 0); | 318 | system.CoreTiming().UnscheduleEvent(motion_update_event); |
| 321 | resource_manager->FreeAppletResourceId(aruid); | 319 | resource_manager->FreeAppletResourceId(aruid); |
| 322 | } | 320 | } |
| 323 | 321 | ||
diff --git a/src/core/hle/service/hid/resource_manager.h b/src/core/hle/service/hid/resource_manager.h index 5ad7cb564..5a6596099 100644 --- a/src/core/hle/service/hid/resource_manager.h +++ b/src/core/hle/service/hid/resource_manager.h | |||
| @@ -81,10 +81,10 @@ public: | |||
| 81 | void EnablePadInput(u64 aruid, bool is_enabled); | 81 | void EnablePadInput(u64 aruid, bool is_enabled); |
| 82 | void EnableTouchScreen(u64 aruid, bool is_enabled); | 82 | void EnableTouchScreen(u64 aruid, bool is_enabled); |
| 83 | 83 | ||
| 84 | void UpdateControllers(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 84 | void UpdateControllers(std::chrono::nanoseconds ns_late); |
| 85 | void UpdateNpad(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 85 | void UpdateNpad(std::chrono::nanoseconds ns_late); |
| 86 | void UpdateMouseKeyboard(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 86 | void UpdateMouseKeyboard(std::chrono::nanoseconds ns_late); |
| 87 | void UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); | 87 | void UpdateMotion(std::chrono::nanoseconds ns_late); |
| 88 | 88 | ||
| 89 | private: | 89 | private: |
| 90 | Result CreateAppletResourceImpl(u64 aruid); | 90 | Result CreateAppletResourceImpl(u64 aruid); |