summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/console_sixaxis.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-09-21 03:36:05 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:24 +0100
commita2ad5762e61f5d63d9a8c8a409f32c24409df67f (patch)
treebb344f907bde5a1049ec31ccfc488c6c637a62fe /src/core/hle/service/hid/controllers/console_sixaxis.h
parentservice/hid: Update mouse and keyboard to use ring lifo and the emulated device (diff)
downloadyuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.tar
yuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.tar.gz
yuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.tar.bz2
yuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.tar.lz
yuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.tar.xz
yuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.tar.zst
yuzu-a2ad5762e61f5d63d9a8c8a409f32c24409df67f.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/console_sixaxis.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/hle/service/hid/controllers/console_sixaxis.h b/src/core/hle/service/hid/controllers/console_sixaxis.h
index fd8a427af..6d18d2ce0 100644
--- a/src/core/hle/service/hid/controllers/console_sixaxis.h
+++ b/src/core/hle/service/hid/controllers/console_sixaxis.h
@@ -5,10 +5,10 @@
#pragma once
#include <array>
-#include "common/bit_field.h"
#include "common/common_types.h"
#include "common/quaternion.h"
-#include "core/frontend/input.h"
+#include "core/hid/hid_core.h"
+#include "core/hid/hid_types.h"
#include "core/hle/service/hid/controllers/controller_base.h"
namespace Service::HID {
@@ -26,9 +26,6 @@ public:
// When the controller is requesting an update for the shared memory
void OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data, size_t size) override;
- // Called when input devices should be loaded
- void OnLoadInputDevices() override;
-
// Called on InitializeSevenSixAxisSensor
void SetTransferMemoryPointer(u8* t_mem);
@@ -47,12 +44,22 @@ private:
};
static_assert(sizeof(SevenSixAxisState) == 0x50, "SevenSixAxisState is an invalid size");
+ struct CommonHeader {
+ s64_le timestamp;
+ s64_le total_entry_count;
+ s64_le last_entry_index;
+ s64_le entry_count;
+ };
+ static_assert(sizeof(CommonHeader) == 0x20, "CommonHeader is an invalid size");
+
+ // TODO(german77): SevenSixAxisMemory doesn't follow the standard lifo. Investigate
struct SevenSixAxisMemory {
CommonHeader header{};
std::array<SevenSixAxisState, 0x21> sevensixaxis_states{};
};
static_assert(sizeof(SevenSixAxisMemory) == 0xA70, "SevenSixAxisMemory is an invalid size");
+ // This is nn::hid::detail::ConsoleSixAxisSensorSharedMemoryFormat
struct ConsoleSharedMemory {
u64_le sampling_number{};
bool is_seven_six_axis_sensor_at_rest{};
@@ -69,9 +76,7 @@ private:
Common::Quaternion<f32> quaternion;
};
- using MotionArray =
- std::array<std::unique_ptr<Input::MotionDevice>, Settings::NativeMotion::NUM_MOTIONS_HID>;
- MotionArray motions;
+ Core::HID::EmulatedConsole* console;
u8* transfer_memory = nullptr;
bool is_transfer_memory_set = false;
ConsoleSharedMemory console_six_axis{};