citra/src/audio_core/lle/lle.cpp

34 lines
832 B
C++
Raw Normal View History

// Copyright 2018 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "audio_core/lle/lle.h"
#include "teakra/teakra.h"
namespace AudioCore {
struct DspLle::Impl final {
Teakra::Teakra teakra;
2018-12-06 12:22:31 +00:00
static constexpr unsigned TeakraSlice = 20000;
void RunTeakraSlice() {
teakra.Run(TeakraSlice);
}
};
2018-12-06 12:22:31 +00:00
u16 DspLle::RecvData(u32 register_number) {
while (!impl->teakra.RecvDataIsReady(register_number)) {
impl->RunTeakraSlice();
}
return impl->teakra.RecvData(static_cast<u8>(register_number));
}
bool DspLle::RecvDataIsReady(u32 register_number) const {
return impl->teakra.RecvDataIsReady(register_number);
}
DspLle::DspLle() : impl(std::make_unique<Impl>()) {}
DspLle::~DspLle() = default;
} // namespace AudioCore