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
This commit is contained in:
Marko Pusljar 2010-04-05 10:46:43 +00:00
parent 131bb78897
commit 3a4b13e71f
1 changed files with 37 additions and 19 deletions

View File

@ -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);
}
}
}