From 3a4b13e71fb78537b78b2a81fe12b9c3e140921b Mon Sep 17 00:00:00 2001 From: Marko Pusljar Date: Mon, 5 Apr 2010 10:46:43 +0000 Subject: [PATCH] DSPHLE - some games are even changing/sending again the same ucode while ingame... This fixes/improves NFS Carbon, FF Crystal Chronicles, Beyblade (and probably some other GC AX games that were stuck on loading screens) under dsphle git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5282 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp | 56 ++++++++++++------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index 637784a826..8265a792d1 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -23,6 +23,7 @@ #include "../Globals.h" #include "Mixer.h" #include "../MailHandler.h" +#include "../DSPHandler.h" #include "UCodes.h" #include "UCode_AXStructs.h" @@ -215,26 +216,43 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize) // Handle incoming mail void CUCode_AX::HandleMail(u32 _uMail) { - if ((_uMail & 0xFFFF0000) == MAIL_AX_ALIST) - { - // We are expected to get a new CmdBlock - DEBUG_LOG(DSPHLE, "GetNextCmdBlock (%ibytes)", (u16)_uMail); + static s8 newucodemails = -1; + + if (newucodemails > -1) { + newucodemails++; + if (newucodemails == 10) { + newucodemails = -1; + m_rMailHandler.PushMail(DSP_RESUME); + } } - else if (_uMail == 0xCDD10000) // Action 0 - restart - { - m_rMailHandler.PushMail(DSP_RESUME); - } - else if (_uMail == 0xCDD10001) // Action 1 - new ucode upload - { - NOTICE_LOG(DSPHLE,"Game wanted to upload new ucode!"); - } - else if ((_uMail & 0xFFFF0000) == 0xCDD10000) // Action 2/3 - { - } - else - { - DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : AXTask Mail (%08x)", _uMail); - AXTask(_uMail); + else { + if ((_uMail & 0xFFFF0000) == MAIL_AX_ALIST) + { + // We are expected to get a new CmdBlock + DEBUG_LOG(DSPHLE, "GetNextCmdBlock (%ibytes)", (u16)_uMail); + } + else if (_uMail == 0xCDD10000) // Action 0 - AX_ResumeTask(); + { + m_rMailHandler.PushMail(DSP_RESUME); + } + else if (_uMail == 0xCDD10001) // Action 1 - new ucode upload ( GC: BayBlade S.T.B,...) + { + NOTICE_LOG(DSPHLE,"DSP IROM - New Ucode!"); + newucodemails = 0; + } + else if (_uMail == 0xCDD10002) // Action 2 - IROM_Reset(); ( GC: NFS Carbon, FF Crystal Chronicles,...) + { + NOTICE_LOG(DSPHLE,"DSP IROM - Reset!"); + CDSPHandler::GetInstance().SetUCode(UCODE_ROM); + } + else if (_uMail == 0xCDD10003) // Action 3 - AX_GetNextCmdBlock(); + { + } + else + { + DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : AXTask Mail (%08x)", _uMail); + AXTask(_uMail); + } } }