diff options
| author | 2022-10-02 14:28:43 -0700 | |
|---|---|---|
| committer | 2022-10-02 14:28:43 -0700 | |
| commit | 61399de5dbc64ada1c9e5ec3d84be76c215fdc0c (patch) | |
| tree | 72313f1b749d0771e38dbfcf539121a02d4b9ae0 /src/common/input.h | |
| parent | Merge pull request #8992 from Morph1984/vi-vsync-event (diff) | |
| parent | service: mii: Copy only valid name bytes (diff) | |
| download | yuzu-61399de5dbc64ada1c9e5ec3d84be76c215fdc0c.tar.gz yuzu-61399de5dbc64ada1c9e5ec3d84be76c215fdc0c.tar.xz yuzu-61399de5dbc64ada1c9e5ec3d84be76c215fdc0c.zip | |
Merge pull request #8955 from german77/amiibo-rewrite
core: nfp: Rewrite implementation to remove direct access from the frontend
Diffstat (limited to '')
| -rw-r--r-- | src/common/input.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/common/input.h b/src/common/input.h index 825b0d650..bfa0639f5 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -76,6 +76,19 @@ enum class PollingError { | |||
| 76 | Unknown, | 76 | Unknown, |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | // Nfc reply from the controller | ||
| 80 | enum class NfcState { | ||
| 81 | Success, | ||
| 82 | NewAmiibo, | ||
| 83 | WaitingForAmiibo, | ||
| 84 | AmiiboRemoved, | ||
| 85 | NotAnAmiibo, | ||
| 86 | NotSupported, | ||
| 87 | WrongDeviceState, | ||
| 88 | WriteFailed, | ||
| 89 | Unknown, | ||
| 90 | }; | ||
| 91 | |||
| 79 | // Ir camera reply from the controller | 92 | // Ir camera reply from the controller |
| 80 | enum class CameraError { | 93 | enum class CameraError { |
| 81 | None, | 94 | None, |
| @@ -202,6 +215,11 @@ struct CameraStatus { | |||
| 202 | std::vector<u8> data{}; | 215 | std::vector<u8> data{}; |
| 203 | }; | 216 | }; |
| 204 | 217 | ||
| 218 | struct NfcStatus { | ||
| 219 | NfcState state{}; | ||
| 220 | std::vector<u8> data{}; | ||
| 221 | }; | ||
| 222 | |||
| 205 | // List of buttons to be passed to Qt that can be translated | 223 | // List of buttons to be passed to Qt that can be translated |
| 206 | enum class ButtonNames { | 224 | enum class ButtonNames { |
| 207 | Undefined, | 225 | Undefined, |
| @@ -260,6 +278,7 @@ struct CallbackStatus { | |||
| 260 | BatteryStatus battery_status{}; | 278 | BatteryStatus battery_status{}; |
| 261 | VibrationStatus vibration_status{}; | 279 | VibrationStatus vibration_status{}; |
| 262 | CameraStatus camera_status{}; | 280 | CameraStatus camera_status{}; |
| 281 | NfcStatus nfc_status{}; | ||
| 263 | }; | 282 | }; |
| 264 | 283 | ||
| 265 | // Triggered once every input change | 284 | // Triggered once every input change |
| @@ -312,6 +331,14 @@ public: | |||
| 312 | virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { | 331 | virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { |
| 313 | return CameraError::NotSupported; | 332 | return CameraError::NotSupported; |
| 314 | } | 333 | } |
| 334 | |||
| 335 | virtual NfcState SupportsNfc() const { | ||
| 336 | return NfcState::NotSupported; | ||
| 337 | } | ||
| 338 | |||
| 339 | virtual NfcState WriteNfcData([[maybe_unused]] const std::vector<u8>& data) { | ||
| 340 | return NfcState::NotSupported; | ||
| 341 | } | ||
| 315 | }; | 342 | }; |
| 316 | 343 | ||
| 317 | /// An abstract class template for a factory that can create input devices. | 344 | /// An abstract class template for a factory that can create input devices. |