Core/DSPHLE: Store reference to DSPManager in HLEAccelerator (AX/AXWii).

This commit is contained in:
Admiral H. Curtiss 2024-01-08 10:27:39 +01:00
parent 3a9160100d
commit 1f0fe5a99a
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
3 changed files with 15 additions and 10 deletions

View File

@ -38,7 +38,7 @@ void AXUCode::Initialize()
{
InitializeShared();
m_accelerator = std::make_unique<HLEAccelerator>();
m_accelerator = std::make_unique<HLEAccelerator>(m_dsphle->GetSystem().GetDSP());
}
void AXUCode::InitializeShared()

View File

@ -150,6 +150,13 @@ void WritePB(Memory::MemoryManager& memory, u32 addr, const PB_TYPE& pb, u32 crc
class HLEAccelerator final : public Accelerator
{
public:
explicit HLEAccelerator(DSP::DSPManager& dsp) : m_dsp(dsp) {}
HLEAccelerator(const HLEAccelerator&) = delete;
HLEAccelerator(HLEAccelerator&&) = delete;
HLEAccelerator& operator=(const HLEAccelerator&) = delete;
HLEAccelerator& operator=(HLEAccelerator&&) = delete;
~HLEAccelerator() = default;
PB_TYPE* acc_pb = nullptr;
protected:
@ -182,14 +189,12 @@ protected:
}
}
u8 ReadMemory(u32 address) override
{
return Core::System::GetInstance().GetDSP().ReadARAM(address);
}
void WriteMemory(u32 address, u8 value) override
{
Core::System::GetInstance().GetDSP().WriteARAM(value, address);
}
u8 ReadMemory(u32 address) override { return m_dsp.ReadARAM(address); }
void WriteMemory(u32 address, u8 value) override { m_dsp.WriteARAM(value, address); }
private:
DSP::DSPManager& m_dsp;
};
// Sets up the simulated accelerator.

View File

@ -34,7 +34,7 @@ void AXWiiUCode::Initialize()
{
InitializeShared();
m_accelerator = std::make_unique<HLEAccelerator>();
m_accelerator = std::make_unique<HLEAccelerator>(m_dsphle->GetSystem().GetDSP());
}
void AXWiiUCode::HandleCommandList()