diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-14 04:39:38 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-14 06:24:28 +0100 |
commit | 64f68e96354df3afb9bb563c888793f98ecb5026 (patch) | |
tree | 82a1f3f51902e0a926bae4ae8a84ba1dcf2a145b /src/core/hle/service/hid/controllers/console_six_axis.cpp | |
parent | Merge pull request #12342 from FearlessTobi/fix-msvc (diff) | |
download | yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.gz yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.bz2 yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.lz yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.xz yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.zst yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/console_six_axis.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/core/hle/service/hid/controllers/console_six_axis.cpp b/src/core/hle/service/hid/controllers/console_six_axis.cpp index b2bf1d78d..084e99556 100644 --- a/src/core/hle/service/hid/controllers/console_six_axis.cpp +++ b/src/core/hle/service/hid/controllers/console_six_axis.cpp @@ -6,18 +6,15 @@ #include "core/hid/emulated_console.h" #include "core/hid/hid_core.h" #include "core/hle/service/hid/controllers/console_six_axis.h" +#include "core/hle/service/hid/controllers/shared_memory_format.h" #include "core/memory.h" namespace Service::HID { -constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C200; -ConsoleSixAxis::ConsoleSixAxis(Core::HID::HIDCore& hid_core_, u8* raw_shared_memory_) - : ControllerBase{hid_core_} { +ConsoleSixAxis::ConsoleSixAxis(Core::HID::HIDCore& hid_core_, + ConsoleSixAxisSensorSharedMemoryFormat& console_shared_memory) + : ControllerBase{hid_core_}, shared_memory{console_shared_memory} { console = hid_core.GetEmulatedConsole(); - static_assert(SHARED_MEMORY_OFFSET + sizeof(ConsoleSharedMemory) < shared_memory_size, - "ConsoleSharedMemory is bigger than the shared memory"); - shared_memory = std::construct_at( - reinterpret_cast<ConsoleSharedMemory*>(raw_shared_memory_ + SHARED_MEMORY_OFFSET)); } ConsoleSixAxis::~ConsoleSixAxis() = default; @@ -33,10 +30,10 @@ void ConsoleSixAxis::OnUpdate(const Core::Timing::CoreTiming& core_timing) { const auto motion_status = console->GetMotion(); - shared_memory->sampling_number++; - shared_memory->is_seven_six_axis_sensor_at_rest = motion_status.is_at_rest; - shared_memory->verticalization_error = motion_status.verticalization_error; - shared_memory->gyro_bias = motion_status.gyro_bias; + shared_memory.sampling_number++; + shared_memory.is_seven_six_axis_sensor_at_rest = motion_status.is_at_rest; + shared_memory.verticalization_error = motion_status.verticalization_error; + shared_memory.gyro_bias = motion_status.gyro_bias; } } // namespace Service::HID |