|
|
|
@ -345,6 +345,25 @@ std::vector<u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::span<const u8> HLERequestContext::ReadBufferSpan(std::size_t buffer_index) const {
|
|
|
|
|
LOG_CRITICAL(Debug, "called");
|
|
|
|
|
const bool is_buffer_a{BufferDescriptorA().size() > buffer_index &&
|
|
|
|
|
BufferDescriptorA()[buffer_index].Size()};
|
|
|
|
|
if (is_buffer_a) {
|
|
|
|
|
ASSERT_OR_EXECUTE_MSG(
|
|
|
|
|
BufferDescriptorA().size() > buffer_index, { return {}; },
|
|
|
|
|
"BufferDescriptorA invalid buffer_index {}", buffer_index);
|
|
|
|
|
const u8* const mem_ptr = memory.GetPointer(BufferDescriptorA()[buffer_index].Address());
|
|
|
|
|
return std::span<const u8>(mem_ptr, BufferDescriptorA()[buffer_index].Size());
|
|
|
|
|
} else {
|
|
|
|
|
ASSERT_OR_EXECUTE_MSG(
|
|
|
|
|
BufferDescriptorX().size() > buffer_index, { return {}; },
|
|
|
|
|
"BufferDescriptorX invalid buffer_index {}", buffer_index);
|
|
|
|
|
const u8* const mem_ptr = memory.GetPointer(BufferDescriptorX()[buffer_index].Address());
|
|
|
|
|
return std::span<const u8>(mem_ptr, BufferDescriptorX()[buffer_index].Size());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size,
|
|
|
|
|
std::size_t buffer_index) const {
|
|
|
|
|
if (size == 0) {
|
|
|
|
|