diff options
| author | 2024-02-06 10:24:30 -0500 | |
|---|---|---|
| committer | 2024-02-06 10:24:30 -0500 | |
| commit | d5fb9fd12cfd06503c61326e03359b43b73aefc2 (patch) | |
| tree | 6c9b474100c03c9dcb82cdfab12d4f4ffc5fb855 /src/hid_core | |
| parent | Merge pull request #12934 from german77/hid_debug_interface (diff) | |
| parent | service: irs: Migrate service to new interface (diff) | |
| download | yuzu-d5fb9fd12cfd06503c61326e03359b43b73aefc2.tar.gz yuzu-d5fb9fd12cfd06503c61326e03359b43b73aefc2.tar.xz yuzu-d5fb9fd12cfd06503c61326e03359b43b73aefc2.zip | |
Merge pull request #12933 from german77/irs-interface
service: irs: Migrate service to new interface
Diffstat (limited to 'src/hid_core')
| -rw-r--r-- | src/hid_core/irsensor/image_transfer_processor.cpp | 5 | ||||
| -rw-r--r-- | src/hid_core/irsensor/image_transfer_processor.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/hid_core/irsensor/image_transfer_processor.cpp b/src/hid_core/irsensor/image_transfer_processor.cpp index d6573f8dc..2b5a50ef6 100644 --- a/src/hid_core/irsensor/image_transfer_processor.cpp +++ b/src/hid_core/irsensor/image_transfer_processor.cpp | |||
| @@ -145,9 +145,8 @@ void ImageTransferProcessor::SetTransferMemoryAddress(Common::ProcessAddress t_m | |||
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | Core::IrSensor::ImageTransferProcessorState ImageTransferProcessor::GetState( | 147 | Core::IrSensor::ImageTransferProcessorState ImageTransferProcessor::GetState( |
| 148 | std::vector<u8>& data) const { | 148 | std::span<u8> data) const { |
| 149 | const auto size = GetDataSize(current_config.trimming_format); | 149 | const auto size = std::min(GetDataSize(current_config.trimming_format), data.size()); |
| 150 | data.resize(size); | ||
| 151 | system.ApplicationMemory().ReadBlock(transfer_memory, data.data(), size); | 150 | system.ApplicationMemory().ReadBlock(transfer_memory, data.data(), size); |
| 152 | return processor_state; | 151 | return processor_state; |
| 153 | } | 152 | } |
diff --git a/src/hid_core/irsensor/image_transfer_processor.h b/src/hid_core/irsensor/image_transfer_processor.h index 4e0117084..df1c9d920 100644 --- a/src/hid_core/irsensor/image_transfer_processor.h +++ b/src/hid_core/irsensor/image_transfer_processor.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <span> | ||
| 7 | |||
| 6 | #include "common/typed_address.h" | 8 | #include "common/typed_address.h" |
| 7 | #include "hid_core/irsensor/irs_types.h" | 9 | #include "hid_core/irsensor/irs_types.h" |
| 8 | #include "hid_core/irsensor/processor_base.h" | 10 | #include "hid_core/irsensor/processor_base.h" |
| @@ -39,7 +41,7 @@ public: | |||
| 39 | // Transfer memory where the image data will be stored | 41 | // Transfer memory where the image data will be stored |
| 40 | void SetTransferMemoryAddress(Common::ProcessAddress t_mem); | 42 | void SetTransferMemoryAddress(Common::ProcessAddress t_mem); |
| 41 | 43 | ||
| 42 | Core::IrSensor::ImageTransferProcessorState GetState(std::vector<u8>& data) const; | 44 | Core::IrSensor::ImageTransferProcessorState GetState(std::span<u8> data) const; |
| 43 | 45 | ||
| 44 | private: | 46 | private: |
| 45 | // This is nn::irsensor::ImageTransferProcessorConfig | 47 | // This is nn::irsensor::ImageTransferProcessorConfig |