mirror of
https://github.com/azahar-emu/azahar
synced 2026-04-23 09:23:56 +00:00
audio_core: Update teakra for new memory ownership
This commit is contained in:
parent
2edc8b4b73
commit
7a2f3fdda9
2
externals/teakra
vendored
2
externals/teakra
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 01db7cdd00aabcce559a8dddce8798dabb71949b
|
||||
Subproject commit 3d697a18df504f4677b65129d9ab14c7c597e3eb
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ private:
|
|||
|
||||
DspHle::Impl::Impl(DspHle& parent_, Memory::MemorySystem& memory, Core::Timing& timing)
|
||||
: parent(parent_), core_timing(timing) {
|
||||
dsp_memory = reinterpret_cast<HLE::DspMemory*>(memory.GetDspMemory().data());
|
||||
dsp_memory = reinterpret_cast<HLE::DspMemory*>(memory.GetDspMemory(0));
|
||||
dsp_memory->raw_memory.fill(0);
|
||||
|
||||
for (auto& source : sources) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
|
@ -121,7 +121,9 @@ static u8 PipeIndexToSlotIndex(u8 pipe_index, PipeDirection direction) {
|
|||
}
|
||||
|
||||
struct DspLle::Impl final {
|
||||
Impl(Core::Timing& timing, bool multithread) : core_timing(timing), multithread(multithread) {
|
||||
Impl(Core::Timing& timing, Memory::MemorySystem& memory, bool multithread)
|
||||
: teakra(Teakra::UserConfig{.dsp_memory = memory.GetDspMemory(0)}), core_timing(timing),
|
||||
multithread(multithread) {
|
||||
teakra_slice_event = core_timing.RegisterEvent(
|
||||
"DSP slice", [this](u64, int late) { TeakraSliceEvent(static_cast<u64>(late)); });
|
||||
}
|
||||
|
|
@ -189,12 +191,12 @@ struct DspLle::Impl final {
|
|||
}
|
||||
|
||||
u8* GetDspDataPointer(u32 baddr) {
|
||||
auto& memory = teakra.GetDspMemory();
|
||||
uint8_t* memory = teakra.GetDspMemory();
|
||||
return &memory[DspDataOffset + baddr];
|
||||
}
|
||||
|
||||
const u8* GetDspDataPointer(u32 baddr) const {
|
||||
auto& memory = teakra.GetDspMemory();
|
||||
const uint8_t* memory = teakra.GetDspMemory();
|
||||
return &memory[DspDataOffset + baddr];
|
||||
}
|
||||
|
||||
|
|
@ -312,9 +314,9 @@ struct DspLle::Impl final {
|
|||
teakra.Reset();
|
||||
|
||||
Dsp1 dsp(buffer);
|
||||
auto& dsp_memory = teakra.GetDspMemory();
|
||||
u8* program = dsp_memory.data();
|
||||
u8* data = dsp_memory.data() + DspDataOffset;
|
||||
auto dsp_memory = teakra.GetDspMemory();
|
||||
u8* program = dsp_memory;
|
||||
u8* data = dsp_memory + DspDataOffset;
|
||||
for (const auto& segment : dsp.segments) {
|
||||
if (segment.memory_type == SegmentType::ProgramA ||
|
||||
segment.memory_type == SegmentType::ProgramB) {
|
||||
|
|
@ -465,7 +467,7 @@ DspLle::DspLle(Core::System& system, bool multithread)
|
|||
|
||||
DspLle::DspLle(Core::System& system, Memory::MemorySystem& memory, Core::Timing& timing,
|
||||
bool multithread)
|
||||
: DspInterface(system), impl(std::make_unique<Impl>(timing, multithread)) {
|
||||
: DspInterface(system), impl(std::make_unique<Impl>(timing, memory, multithread)) {
|
||||
Teakra::AHBMCallback ahbm;
|
||||
ahbm.read8 = [&memory](u32 address) -> u8 {
|
||||
return *memory.GetFCRAMPointer(address - Memory::FCRAM_PADDR);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2018 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
|
|
|||
|
|
@ -989,8 +989,9 @@ MemoryRef MemorySystem::GetFCRAMRef(std::size_t offset) const {
|
|||
return MemoryRef(impl->fcram_mem, offset);
|
||||
}
|
||||
|
||||
std::span<u8, DSP_RAM_SIZE> MemorySystem::GetDspMemory() const {
|
||||
return std::span<u8, DSP_RAM_SIZE>{impl->dsp_ram.get(), DSP_RAM_SIZE};
|
||||
u8* MemorySystem::GetDspMemory(std::size_t offset) const {
|
||||
ASSERT(offset <= Memory::DSP_RAM_SIZE);
|
||||
return impl->dsp_ram.get() + offset;
|
||||
}
|
||||
|
||||
} // namespace Memory
|
||||
|
|
|
|||
|
|
@ -641,7 +641,8 @@ public:
|
|||
/// Unregisters page table for rasterizer cache marking
|
||||
void UnregisterPageTable(std::shared_ptr<PageTable> page_table);
|
||||
|
||||
std::span<u8, DSP_RAM_SIZE> GetDspMemory() const;
|
||||
/// Gets pointer to DSP shared memory with given offset
|
||||
u8* GetDspMemory(std::size_t offset) const;
|
||||
|
||||
void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "audio_core/hle/hle.h"
|
||||
#include "audio_core/lle/lle.h"
|
||||
#include "common/settings.h"
|
||||
|
|
@ -85,8 +89,7 @@ Result ServiceFixture::DSP_ReadPipeIfPossible(u32 channel, u32 /*peer*/, void* o
|
|||
Result ServiceFixture::ServiceFixture::DSP_ConvertProcessAddressFromDspDram(u32 dsp_address,
|
||||
u16** host_address) {
|
||||
*host_address = reinterpret_cast<u16*>(
|
||||
(dsp_address << 1) +
|
||||
(reinterpret_cast<uintptr_t>(memory.GetDspMemory().data()) + 0x40000u));
|
||||
(dsp_address << 1) + (reinterpret_cast<uintptr_t>(memory.GetDspMemory(0)) + 0x40000u));
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue