2018-12-06 12:14:54 +00:00
|
|
|
// 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:14:54 +00:00
|
|
|
};
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2018-12-06 12:30:10 +00:00
|
|
|
bool DspLle::RecvDataIsReady(u32 register_number) const {
|
|
|
|
return impl->teakra.RecvDataIsReady(register_number);
|
|
|
|
}
|
|
|
|
|
2018-12-06 12:35:07 +00:00
|
|
|
void DspLle::SetSemaphore(u16 semaphore_value) {
|
|
|
|
impl->teakra.SetSemaphore(semaphore_value);
|
|
|
|
}
|
|
|
|
|
2018-12-06 12:14:54 +00:00
|
|
|
DspLle::DspLle() : impl(std::make_unique<Impl>()) {}
|
|
|
|
DspLle::~DspLle() = default;
|
|
|
|
|
|
|
|
} // namespace AudioCore
|