summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/hidbus/ringcon.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2022-01-09 06:23:40 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2022-04-16 07:49:26 +0200
commitd2f9412cf1717f884855af22793f3a1e5815c967 (patch)
treea1beab6c5d35dbfb8a58ef45f919e9d4a7d1d58d /src/core/hle/service/hid/hidbus/ringcon.h
parenthidbus: Implement hidbus and ringcon (diff)
downloadyuzu-d2f9412cf1717f884855af22793f3a1e5815c967.tar
yuzu-d2f9412cf1717f884855af22793f3a1e5815c967.tar.gz
yuzu-d2f9412cf1717f884855af22793f3a1e5815c967.tar.bz2
yuzu-d2f9412cf1717f884855af22793f3a1e5815c967.tar.lz
yuzu-d2f9412cf1717f884855af22793f3a1e5815c967.tar.xz
yuzu-d2f9412cf1717f884855af22793f3a1e5815c967.tar.zst
yuzu-d2f9412cf1717f884855af22793f3a1e5815c967.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/hidbus/ringcon.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/core/hle/service/hid/hidbus/ringcon.h b/src/core/hle/service/hid/hidbus/ringcon.h
index e8b3d8254..2dbc6150e 100644
--- a/src/core/hle/service/hid/hidbus/ringcon.h
+++ b/src/core/hle/service/hid/hidbus/ringcon.h
@@ -10,7 +10,7 @@
#include "core/hle/service/hid/hidbus/hidbus_base.h"
namespace Core::HID {
-class EmulatedController;
+class EmulatedDevices;
} // namespace Core::HID
namespace Service::HID {
@@ -43,6 +43,7 @@ private:
static constexpr s16 idle_deadzone = 120;
static constexpr s16 range = 2500;
+ // Most missing command names are leftovers from other firmware versions
enum class RingConCommands : u32 {
GetFirmwareVersion = 0x00020000,
ReadId = 0x00020100,
@@ -60,10 +61,10 @@ private:
ReadUserCal = 0x00021A04,
ReadRepCount = 0x00023104,
ReadTotalPushCount = 0x00023204,
- Unknown9 = 0x04013104,
- Unknown10 = 0x04011104,
- Unknown11 = 0x04011204,
- Unknown12 = 0x04011304,
+ ResetRepCount = 0x04013104,
+ Unknown8 = 0x04011104,
+ Unknown9 = 0x04011204,
+ Unknown10 = 0x04011304,
SaveCalData = 0x10011A04,
Error = 0xFFFFFFFF,
};
@@ -180,9 +181,6 @@ private:
};
static_assert(sizeof(RingConData) == 0x8, "RingConData is an invalid size");
- // Executes the command requested
- bool ExcecuteCommand(RingConCommands cmd, const std::vector<u8>& data);
-
// Returns RingConData struct with pressure sensor values
RingConData GetSensorValue() const;
@@ -204,12 +202,15 @@ private:
// Returns 20 byte reply with user calibration values
std::vector<u8> GetReadUserCalReply() const;
- // (STUBBED) Returns 8 byte reply
+ // Returns 8 byte reply
std::vector<u8> GetReadRepCountReply() const;
- // (STUBBED) Returns 8 byte reply
+ // Returns 8 byte reply
std::vector<u8> GetReadTotalPushCountReply() const;
+ // Returns 8 byte reply
+ std::vector<u8> GetResetRepCountReply() const;
+
// Returns 4 byte save data reply
std::vector<u8> GetSaveDataReply() const;
@@ -225,6 +226,12 @@ private:
RingConCommands command{RingConCommands::Error};
+ // These counters are used in multitasking mode while the switch is sleeping
+ // Total steps taken
+ u8 total_rep_count = 0;
+ // Total times the ring was pushed
+ u8 total_push_count = 0;
+
const u8 device_id = 0x20;
const FirmwareVersion version = {
.sub = 0x0,
@@ -242,6 +249,6 @@ private:
.zero = {.value = idle_value, .crc = 225},
};
- Core::HID::EmulatedController* input;
+ Core::HID::EmulatedDevices* input;
};
} // namespace Service::HID