early-access version 2832

This commit is contained in:
pineappleEA 2022-07-14 00:15:38 +02:00
parent 18b71d75ce
commit 23cb074b8a
3 changed files with 15 additions and 5 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 2830.
This is the source code for early-access 2832.
## Legal Notice

View file

@ -24,7 +24,16 @@ void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) {
constexpr s32 max = std::numeric_limits<s16>::max();
auto stream{processor.GetOutputSinkStream()};
const auto num_channels{stream->GetDeviceChannels()};
const auto num_out_channels{stream->GetDeviceChannels()};
auto system_channels{6U};
for (u32 i = 0; i < inputs.size(); i++) {
if (inputs[i] == 0) {
system_channels = i;
break;
}
}
const auto num_in_channels{std::min(system_channels, stream->GetDeviceChannels())};
Sink::SinkBuffer out_buffer{
.frames{TargetSampleCount},
@ -33,13 +42,13 @@ void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) {
.consumed{false},
};
std::vector<s16> samples(out_buffer.frames * num_channels);
std::vector<s16> samples(out_buffer.frames * num_out_channels, 0);
for (u32 channel = 0; channel < num_channels; channel++) {
for (u32 channel = 0; channel < num_in_channels; channel++) {
const auto offset{inputs[channel] * out_buffer.frames};
for (u32 index = 0; index < out_buffer.frames; index++) {
samples[index * num_channels + channel] =
samples[index * num_out_channels + channel] =
static_cast<s16>(std::clamp(sample_buffer[offset + index], min, max));
}
}

View file

@ -499,6 +499,7 @@ CubebSink::CubebSink(std::string_view target_device_name) {
}
}
// TODO: Implement upmixing, not all games will provide 6 channel audio.
cubeb_get_max_channel_count(ctx, &device_channels);
device_channels = std::clamp(device_channels, 2U, 6U);
}