diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-31 07:42:23 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-31 17:51:01 +0100 |
commit | 865abfc37c5b3e8945d833bd44db428ad720bd58 (patch) | |
tree | af37ccf552aad0403898fb371e639393efe7b9d4 /src/core/hle/service/hid/controllers/applet_resource.cpp | |
parent | Merge pull request #12509 from liamwhite/ktrace (diff) | |
download | yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.gz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.bz2 yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.lz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.xz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.zst yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/applet_resource.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/applet_resource.cpp b/src/core/hle/service/hid/controllers/applet_resource.cpp index c8e74c764..b4ff663c2 100644 --- a/src/core/hle/service/hid/controllers/applet_resource.cpp +++ b/src/core/hle/service/hid/controllers/applet_resource.cpp @@ -4,7 +4,7 @@ #include "core/core.h" #include "core/hle/kernel/k_shared_memory.h" #include "core/hle/service/hid/controllers/applet_resource.h" -#include "core/hle/service/hid/controllers/shared_memory_format.h" +#include "core/hle/service/hid/controllers/types/shared_memory_format.h" #include "core/hle/service/hid/errors.h" namespace Service::HID { @@ -164,6 +164,22 @@ Result AppletResource::GetSharedMemoryFormat(SharedMemoryFormat** out_shared_mem return ResultSuccess; } +AruidData* AppletResource::GetAruidData(u64 aruid) { + const u64 aruid_index = GetIndexFromAruid(aruid); + if (aruid_index == AruidIndexMax) { + return nullptr; + } + return &data[aruid_index]; +} + +AruidData* AppletResource::GetAruidDataByIndex(std::size_t aruid_index) { + return &data[aruid_index]; +} + +bool AppletResource::IsVibrationAruidActive(u64 aruid) const { + return aruid == 0 || aruid == active_vibration_aruid; +} + u64 AppletResource::GetIndexFromAruid(u64 aruid) { for (std::size_t i = 0; i < AruidIndexMax; i++) { if (registration_list.flag[i] == RegistrationStatus::Initialized && |