From e39658df7c4f5de092a4d878bef4434906c78806 Mon Sep 17 00:00:00 2001 From: luigi2us Date: Mon, 29 Jun 2009 16:19:06 +0000 Subject: [PATCH] This should fix SMG random freeze. Not sure though. Please check. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3596 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h | 3 +++ Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h b/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h index ba00aa9f4e..fe77045fc2 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h @@ -29,6 +29,7 @@ public: ~CMailHandler(); void PushMail(u32 _Mail); + void PushMail(u32 _Mail, bool _TriggerIRQ); void Clear(); void Halt(bool _Halt); bool IsEmpty(); @@ -37,6 +38,8 @@ public: u16 ReadDSPMailboxLow(); void Update(); + u32 GetNextMail() { return m_Mails.front(); } + private: // mail handler std::queue m_Mails; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp index fb251fac5b..c4f7ac4a8b 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp @@ -317,8 +317,7 @@ void CUCode_Zelda::UpdatePB(ZPB& _rPB, int *templbuffer, int *temprbuffer, u32 _ void CUCode_Zelda::Update(int cycles) { - // check if we have to sent something - if (!m_rMailHandler.IsEmpty()) + if (m_rMailHandler.GetNextMail() == DSP_FRAME_END) g_dspInitialize.pGenerateDSPInterrupt(); } @@ -378,14 +377,13 @@ void CUCode_Zelda::HandleMail(u32 _uMail) if (m_CurBuffer == m_NumBuffers) { m_rMailHandler.PushMail(DSP_FRAME_END); - g_dspInitialize.pGenerateDSPInterrupt(); + //g_dspInitialize.pGenerateDSPInterrupt(); soundStream->GetMixer()->SetHLEReady(true); DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync"); soundStream->Update(); //do it in this thread to avoid sync problems m_bSyncCmdPending = false; - } } }