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
This commit is contained in:
luigi2us 2009-06-29 16:19:06 +00:00
parent 86339310a5
commit e39658df7c
2 changed files with 5 additions and 4 deletions

View File

@ -29,6 +29,7 @@ public:
~CMailHandler(); ~CMailHandler();
void PushMail(u32 _Mail); void PushMail(u32 _Mail);
void PushMail(u32 _Mail, bool _TriggerIRQ);
void Clear(); void Clear();
void Halt(bool _Halt); void Halt(bool _Halt);
bool IsEmpty(); bool IsEmpty();
@ -37,6 +38,8 @@ public:
u16 ReadDSPMailboxLow(); u16 ReadDSPMailboxLow();
void Update(); void Update();
u32 GetNextMail() { return m_Mails.front(); }
private: private:
// mail handler // mail handler
std::queue<u32> m_Mails; std::queue<u32> m_Mails;

View File

@ -317,8 +317,7 @@ void CUCode_Zelda::UpdatePB(ZPB& _rPB, int *templbuffer, int *temprbuffer, u32 _
void CUCode_Zelda::Update(int cycles) void CUCode_Zelda::Update(int cycles)
{ {
// check if we have to sent something if (m_rMailHandler.GetNextMail() == DSP_FRAME_END)
if (!m_rMailHandler.IsEmpty())
g_dspInitialize.pGenerateDSPInterrupt(); g_dspInitialize.pGenerateDSPInterrupt();
} }
@ -378,14 +377,13 @@ void CUCode_Zelda::HandleMail(u32 _uMail)
if (m_CurBuffer == m_NumBuffers) if (m_CurBuffer == m_NumBuffers)
{ {
m_rMailHandler.PushMail(DSP_FRAME_END); m_rMailHandler.PushMail(DSP_FRAME_END);
g_dspInitialize.pGenerateDSPInterrupt(); //g_dspInitialize.pGenerateDSPInterrupt();
soundStream->GetMixer()->SetHLEReady(true); soundStream->GetMixer()->SetHLEReady(true);
DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync"); DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync");
soundStream->Update(); //do it in this thread to avoid sync problems soundStream->Update(); //do it in this thread to avoid sync problems
m_bSyncCmdPending = false; m_bSyncCmdPending = false;
} }
} }
} }