diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-11-17 18:46:26 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-11-21 00:19:17 +0100 |
commit | cff2d0e19e164d879b57bab9d06306fa70a1049e (patch) | |
tree | d3288aa0bc2b7988a492fe51bc04e2c822ceb275 /src/core/hle/service/hid/controllers/console_sixaxis.cpp | |
parent | Merge pull request #12011 from Macj0rdan/controller-applet (diff) | |
download | yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.tar yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.tar.gz yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.tar.bz2 yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.tar.lz yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.tar.xz yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.tar.zst yuzu-cff2d0e19e164d879b57bab9d06306fa70a1049e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/seven_six_axis.cpp (renamed from src/core/hle/service/hid/controllers/console_sixaxis.cpp) | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/src/core/hle/service/hid/controllers/console_sixaxis.cpp b/src/core/hle/service/hid/controllers/seven_six_axis.cpp index bcb272eaf..495568484 100644 --- a/src/core/hle/service/hid/controllers/console_sixaxis.cpp +++ b/src/core/hle/service/hid/controllers/seven_six_axis.cpp @@ -1,32 +1,29 @@ -// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later +#include <cstring> +#include "common/common_types.h" #include "core/core.h" #include "core/core_timing.h" +#include "core/frontend/emu_window.h" #include "core/hid/emulated_console.h" +#include "core/hid/emulated_devices.h" #include "core/hid/hid_core.h" -#include "core/hle/service/hid/controllers/console_sixaxis.h" +#include "core/hle/service/hid/controllers/seven_six_axis.h" #include "core/memory.h" namespace Service::HID { -constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C200; - -Controller_ConsoleSixAxis::Controller_ConsoleSixAxis(Core::System& system_, u8* raw_shared_memory_) +SevenSixAxis::SevenSixAxis(Core::System& system_) : ControllerBase{system_.HIDCore()}, system{system_} { 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)); } -Controller_ConsoleSixAxis::~Controller_ConsoleSixAxis() = default; - -void Controller_ConsoleSixAxis::OnInit() {} +SevenSixAxis::~SevenSixAxis() = default; -void Controller_ConsoleSixAxis::OnRelease() {} +void SevenSixAxis::OnInit() {} +void SevenSixAxis::OnRelease() {} -void Controller_ConsoleSixAxis::OnUpdate(const Core::Timing::CoreTiming& core_timing) { +void SevenSixAxis::OnUpdate(const Core::Timing::CoreTiming& core_timing) { if (!IsControllerActivated() || transfer_memory == 0) { seven_sixaxis_lifo.buffer_count = 0; seven_sixaxis_lifo.buffer_tail = 0; @@ -53,22 +50,17 @@ void Controller_ConsoleSixAxis::OnUpdate(const Core::Timing::CoreTiming& core_ti -motion_status.quaternion.xyz.z, }; - 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; - - // Update seven six axis transfer memory seven_sixaxis_lifo.WriteNextEntry(next_seven_sixaxis_state); system.ApplicationMemory().WriteBlock(transfer_memory, &seven_sixaxis_lifo, sizeof(seven_sixaxis_lifo)); } -void Controller_ConsoleSixAxis::SetTransferMemoryAddress(Common::ProcessAddress t_mem) { +void SevenSixAxis::SetTransferMemoryAddress(Common::ProcessAddress t_mem) { transfer_memory = t_mem; } -void Controller_ConsoleSixAxis::ResetTimestamp() { +void SevenSixAxis::ResetTimestamp() { last_saved_timestamp = last_global_timestamp; } + } // namespace Service::HID |