Skip to content
Permalink
Browse files
Merge pull request #9608 from Bonta0/swapucode
DSPHLE: Don't restore the last UCode when the crc doesn't match
  • Loading branch information
leoetlino committed Mar 27, 2021
2 parents f29c8b8 + b7f62b7 commit cd6ee13
Showing 1 changed file with 6 additions and 5 deletions.
@@ -79,15 +79,16 @@ void DSPHLE::SwapUCode(u32 crc)
{
m_mail_handler.Clear();

if (m_last_ucode == nullptr)
if (m_last_ucode && UCodeInterface::GetCRC(m_last_ucode.get()) == crc)
{
m_last_ucode = std::move(m_ucode);
m_ucode = UCodeFactory(crc, this, m_wii);
m_ucode->Initialize();
m_ucode = std::move(m_last_ucode);
}
else
{
m_ucode = std::move(m_last_ucode);
if (!m_last_ucode)
m_last_ucode = std::move(m_ucode);
m_ucode = UCodeFactory(crc, this, m_wii);
m_ucode->Initialize();
}
}

0 comments on commit cd6ee13

Please sign in to comment.