summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-10-09 23:46:45 +0200
committerGitHub <noreply@github.com>2022-10-09 23:46:45 +0200
commitc3cae9d99263afd46a1d3205b29cfa62bebd18b3 (patch)
treeec1f256daf46822a808a5abbab415bb6137ecd75 /src
parentMerge pull request #8766 from Kelebek1/regs (diff)
parentinput_common: have an unique vector in callback status (diff)
downloadyuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.tar
yuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.tar.gz
yuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.tar.bz2
yuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.tar.lz
yuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.tar.xz
yuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.tar.zst
yuzu-c3cae9d99263afd46a1d3205b29cfa62bebd18b3.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/input.h5
-rw-r--r--src/core/hid/input_converter.cpp10
-rw-r--r--src/input_common/input_poller.cpp10
3 files changed, 19 insertions, 6 deletions
diff --git a/src/common/input.h b/src/common/input.h
index bfa0639f5..b533f3844 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -277,8 +277,9 @@ struct CallbackStatus {
BodyColorStatus color_status{};
BatteryStatus battery_status{};
VibrationStatus vibration_status{};
- CameraStatus camera_status{};
- NfcStatus nfc_status{};
+ CameraFormat camera_status{CameraFormat::None};
+ NfcState nfc_status{NfcState::Unknown};
+ std::vector<u8> raw_data{};
};
// Triggered once every input change
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp
index fe9915abe..5d8b75b50 100644
--- a/src/core/hid/input_converter.cpp
+++ b/src/core/hid/input_converter.cpp
@@ -277,7 +277,10 @@ Common::Input::CameraStatus TransformToCamera(const Common::Input::CallbackStatu
Common::Input::CameraStatus camera{};
switch (callback.type) {
case Common::Input::InputType::IrSensor:
- camera = callback.camera_status;
+ camera = {
+ .format = callback.camera_status,
+ .data = callback.raw_data,
+ };
break;
default:
LOG_ERROR(Input, "Conversion from type {} to camera not implemented", callback.type);
@@ -291,7 +294,10 @@ Common::Input::NfcStatus TransformToNfc(const Common::Input::CallbackStatus& cal
Common::Input::NfcStatus nfc{};
switch (callback.type) {
case Common::Input::InputType::Nfc:
- return callback.nfc_status;
+ nfc = {
+ .state = callback.nfc_status,
+ .data = callback.raw_data,
+ };
break;
default:
LOG_ERROR(Input, "Conversion from type {} to NFC not implemented", callback.type);
diff --git a/src/input_common/input_poller.cpp b/src/input_common/input_poller.cpp
index 75705b67e..ca33fb4eb 100644
--- a/src/input_common/input_poller.cpp
+++ b/src/input_common/input_poller.cpp
@@ -691,9 +691,12 @@ public:
}
void OnChange() {
+ const auto camera_status = GetStatus();
+
const Common::Input::CallbackStatus status{
.type = Common::Input::InputType::IrSensor,
- .camera_status = GetStatus(),
+ .camera_status = camera_status.format,
+ .raw_data = camera_status.data,
};
TriggerOnChange(status);
@@ -732,9 +735,12 @@ public:
}
void OnChange() {
+ const auto nfc_status = GetStatus();
+
const Common::Input::CallbackStatus status{
.type = Common::Input::InputType::Nfc,
- .nfc_status = GetStatus(),
+ .nfc_status = nfc_status.state,
+ .raw_data = nfc_status.data,
};
TriggerOnChange(status);