mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
Core/DSPHLE: Construct accelerator in AX and AXWii constructors.
This fixes an issue introduced by 3b0444be6bf38ca5c20f5b9b8916c54fd8f6fa36 where the m_accelerator would not be initialized when loading a savestate if the current UCode mismatched the UCode in the savestate, leading to a crash.
This commit is contained in:
parent
aa66842172
commit
f0d363eea7
@ -27,9 +27,15 @@
|
|||||||
|
|
||||||
namespace DSP::HLE
|
namespace DSP::HLE
|
||||||
{
|
{
|
||||||
AXUCode::AXUCode(DSPHLE* dsphle, u32 crc) : UCodeInterface(dsphle, crc)
|
AXUCode::AXUCode(DSPHLE* dsphle, u32 crc, bool dummy) : UCodeInterface(dsphle, crc)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
AXUCode::AXUCode(DSPHLE* dsphle, u32 crc) : AXUCode(dsphle, crc, false)
|
||||||
{
|
{
|
||||||
INFO_LOG_FMT(DSPHLE, "Instantiating AXUCode: crc={:08x}", crc);
|
INFO_LOG_FMT(DSPHLE, "Instantiating AXUCode: crc={:08x}", crc);
|
||||||
|
|
||||||
|
m_accelerator = std::make_unique<HLEAccelerator>(dsphle->GetSystem().GetDSP());
|
||||||
}
|
}
|
||||||
|
|
||||||
AXUCode::~AXUCode() = default;
|
AXUCode::~AXUCode() = default;
|
||||||
@ -37,8 +43,6 @@ AXUCode::~AXUCode() = default;
|
|||||||
void AXUCode::Initialize()
|
void AXUCode::Initialize()
|
||||||
{
|
{
|
||||||
InitializeShared();
|
InitializeShared();
|
||||||
|
|
||||||
m_accelerator = std::make_unique<HLEAccelerator>(m_dsphle->GetSystem().GetDSP());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AXUCode::InitializeShared()
|
void AXUCode::InitializeShared()
|
||||||
|
@ -110,6 +110,9 @@ protected:
|
|||||||
|
|
||||||
std::unique_ptr<Accelerator> m_accelerator;
|
std::unique_ptr<Accelerator> m_accelerator;
|
||||||
|
|
||||||
|
// Constructs without any GC-specific state, so it can be used by the deriving AXWii.
|
||||||
|
AXUCode(DSPHLE* dsphle, u32 crc, bool dummy);
|
||||||
|
|
||||||
void InitializeShared();
|
void InitializeShared();
|
||||||
|
|
||||||
bool LoadResamplingCoefficients(bool require_same_checksum, u32 desired_checksum);
|
bool LoadResamplingCoefficients(bool require_same_checksum, u32 desired_checksum);
|
||||||
|
@ -20,21 +20,22 @@
|
|||||||
|
|
||||||
namespace DSP::HLE
|
namespace DSP::HLE
|
||||||
{
|
{
|
||||||
AXWiiUCode::AXWiiUCode(DSPHLE* dsphle, u32 crc) : AXUCode(dsphle, crc), m_last_main_volume(0x8000)
|
AXWiiUCode::AXWiiUCode(DSPHLE* dsphle, u32 crc)
|
||||||
|
: AXUCode(dsphle, crc, false), m_last_main_volume(0x8000)
|
||||||
{
|
{
|
||||||
|
INFO_LOG_FMT(DSPHLE, "Instantiating AXWiiUCode: crc={:08x}", crc);
|
||||||
|
|
||||||
for (u16& volume : m_last_aux_volumes)
|
for (u16& volume : m_last_aux_volumes)
|
||||||
volume = 0x8000;
|
volume = 0x8000;
|
||||||
|
|
||||||
INFO_LOG_FMT(DSPHLE, "Instantiating AXWiiUCode");
|
|
||||||
|
|
||||||
m_old_axwii = (crc == 0xfa450138) || (crc == 0x7699af32);
|
m_old_axwii = (crc == 0xfa450138) || (crc == 0x7699af32);
|
||||||
|
|
||||||
|
m_accelerator = std::make_unique<HLEAccelerator>(dsphle->GetSystem().GetDSP());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AXWiiUCode::Initialize()
|
void AXWiiUCode::Initialize()
|
||||||
{
|
{
|
||||||
InitializeShared();
|
InitializeShared();
|
||||||
|
|
||||||
m_accelerator = std::make_unique<HLEAccelerator>(m_dsphle->GetSystem().GetDSP());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AXWiiUCode::HandleCommandList()
|
void AXWiiUCode::HandleCommandList()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user