mirror of
https://github.com/yuzu-emu/yuzu-mainline.git
synced 2024-12-12 16:34:28 +01:00
Merge pull request #2877 from ogniK5377/framecount-rev7
Added frame_count for REV5 audio renderer
This commit is contained in:
commit
b7725812ac
@ -107,6 +107,11 @@ Stream::State AudioRenderer::GetStreamState() const {
|
|||||||
return stream->GetState();
|
return stream->GetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr u32 VersionFromRevision(u32_le rev) {
|
||||||
|
// "REV7" -> 7
|
||||||
|
return ((rev >> 24) & 0xff) - 0x30;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<u8> AudioRenderer::UpdateAudioRenderer(const std::vector<u8>& input_params) {
|
std::vector<u8> AudioRenderer::UpdateAudioRenderer(const std::vector<u8>& input_params) {
|
||||||
// Copy UpdateDataHeader struct
|
// Copy UpdateDataHeader struct
|
||||||
UpdateDataHeader config{};
|
UpdateDataHeader config{};
|
||||||
@ -166,6 +171,11 @@ std::vector<u8> AudioRenderer::UpdateAudioRenderer(const std::vector<u8>& input_
|
|||||||
// Copy output header
|
// Copy output header
|
||||||
UpdateDataHeader response_data{worker_params};
|
UpdateDataHeader response_data{worker_params};
|
||||||
std::vector<u8> output_params(response_data.total_size);
|
std::vector<u8> output_params(response_data.total_size);
|
||||||
|
const auto audren_revision = VersionFromRevision(config.revision);
|
||||||
|
if (audren_revision >= 5) {
|
||||||
|
response_data.frame_count = 0x10;
|
||||||
|
response_data.total_size += 0x10;
|
||||||
|
}
|
||||||
std::memcpy(output_params.data(), &response_data, sizeof(UpdateDataHeader));
|
std::memcpy(output_params.data(), &response_data, sizeof(UpdateDataHeader));
|
||||||
|
|
||||||
// Copy output memory pool entries
|
// Copy output memory pool entries
|
||||||
|
@ -194,21 +194,24 @@ struct UpdateDataHeader {
|
|||||||
mixes_size = 0x0;
|
mixes_size = 0x0;
|
||||||
sinks_size = config.sink_count * 0x20;
|
sinks_size = config.sink_count * 0x20;
|
||||||
performance_manager_size = 0x10;
|
performance_manager_size = 0x10;
|
||||||
|
frame_count = 0;
|
||||||
total_size = sizeof(UpdateDataHeader) + behavior_size + memory_pools_size + voices_size +
|
total_size = sizeof(UpdateDataHeader) + behavior_size + memory_pools_size + voices_size +
|
||||||
effects_size + sinks_size + performance_manager_size;
|
effects_size + sinks_size + performance_manager_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32_le revision;
|
u32_le revision{};
|
||||||
u32_le behavior_size;
|
u32_le behavior_size{};
|
||||||
u32_le memory_pools_size;
|
u32_le memory_pools_size{};
|
||||||
u32_le voices_size;
|
u32_le voices_size{};
|
||||||
u32_le voice_resource_size;
|
u32_le voice_resource_size{};
|
||||||
u32_le effects_size;
|
u32_le effects_size{};
|
||||||
u32_le mixes_size;
|
u32_le mixes_size{};
|
||||||
u32_le sinks_size;
|
u32_le sinks_size{};
|
||||||
u32_le performance_manager_size;
|
u32_le performance_manager_size{};
|
||||||
INSERT_PADDING_WORDS(6);
|
INSERT_PADDING_WORDS(1);
|
||||||
u32_le total_size;
|
u32_le frame_count{};
|
||||||
|
INSERT_PADDING_WORDS(4);
|
||||||
|
u32_le total_size{};
|
||||||
};
|
};
|
||||||
static_assert(sizeof(UpdateDataHeader) == 0x40, "UpdateDataHeader has wrong size");
|
static_assert(sizeof(UpdateDataHeader) == 0x40, "UpdateDataHeader has wrong size");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user