This commit is contained in:
wheremyfoodat 2024-04-27 00:37:45 +03:00
parent 26c07717aa
commit e9e041813f
2 changed files with 19 additions and 18 deletions

View file

@ -99,6 +99,7 @@ namespace Audio {
using Source = Audio::DSPSource;
using SampleBuffer = Source::SampleBuffer;
private:
enum class DSPState : u32 {
Off,

View file

@ -145,10 +145,7 @@ namespace Audio {
dspService.triggerPipeEvent(DSPPipeType::Audio);
break;
case StateChange::Shutdown:
dspState = DSPState::Off;
break;
case StateChange::Shutdown: dspState = DSPState::Off; break;
default: Helpers::panic("Unimplemented DSP audio pipe state change %d", state);
}
}
@ -216,6 +213,7 @@ namespace Audio {
// Generate audio
if (source.enabled && !source.buffers.empty()) {
static int aaaa = 0;
const auto& buffer = source.buffers.top();
const u8* data = getPointerPhys<u8>(buffer.paddr);
@ -223,6 +221,7 @@ namespace Audio {
// TODO
}
}
}
// Update write region of shared memory
auto& status = write.sourceStatuses.status[i];
@ -341,7 +340,8 @@ namespace Audio {
HLE_DSP::SampleBuffer HLE_DSP::decodeADPCM(const u8* data, usize sampleCount, Source& source) {
static constexpr uint samplesPerBlock = 14;
// An ADPCM block is comprised of a single header which contains the scale and predictor value for the block, and then 14 4bpp samples (hence the / 2)
// An ADPCM block is comprised of a single header which contains the scale and predictor value for the block, and then 14 4bpp samples (hence
// the / 2)
static constexpr usize blockSize = sizeof(u8) + samplesPerBlock / 2;
// How many ADPCM blocks we'll be consuming. It's sampleCount / samplesPerBlock, rounded up.