dsp stuff - the same ucode hash under lle and hle now (had to rename couple of dissasms), ucode dumping under hle (debug only), small dsp:read32 change (needed for some homebrew)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6059 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marko Pusljar
2010-08-05 17:00:32 +00:00
parent ca9c174450
commit 8dc01b685f
9 changed files with 60 additions and 42 deletions

View File

@ -62,23 +62,23 @@ void CUCode_Rom::HandleMail(u32 _uMail)
break;
case 0x80F3A002:
m_CurrentUCode.m_Length = _uMail;
m_CurrentUCode.m_Length = _uMail & 0xffff;
break;
case 0x80F3C002:
m_CurrentUCode.m_IMEMAddress = _uMail;
m_CurrentUCode.m_IMEMAddress = _uMail & 0xffff;
break;
case 0x80F3B002:
m_CurrentUCode.m_DMEMLength = _uMail;
if (_uMail) {
NOTICE_LOG(DSPHLE,"Game wanted to DMA sth to DSP DRAM.");
m_CurrentUCode.m_DMEMLength = _uMail & 0xffff;
if (m_CurrentUCode.m_DMEMLength) {
NOTICE_LOG(DSPHLE,"m_CurrentUCode.m_DMEMLength = 0x%04x.", m_CurrentUCode.m_DMEMLength);
}
break;
case 0x80F3D001:
{
m_CurrentUCode.m_StartPC = _uMail;
m_CurrentUCode.m_StartPC = _uMail & 0xffff;
BootUCode();
return; // Important! BootUCode indirectly does "delete this;". Must exit immediately.
}
@ -99,6 +99,18 @@ void CUCode_Rom::BootUCode()
(u8*)Memory_Get_Pointer(m_CurrentUCode.m_RAMAddress),
m_CurrentUCode.m_Length);
#if defined(_DEBUG) || defined(DEBUGFAST)
char binFile[MAX_PATH];
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX), ector_crc);
FILE* pFile = fopen(binFile, "wb");
if (pFile)
{
fwrite((u8*)Memory_Get_Pointer(m_CurrentUCode.m_RAMAddress), m_CurrentUCode.m_Length, 1, pFile);
fclose(pFile);
}
#endif
DEBUG_LOG(DSPHLE, "CurrentUCode SOURCE Addr: 0x%08x", m_CurrentUCode.m_RAMAddress);
DEBUG_LOG(DSPHLE, "CurrentUCode Length: 0x%08x", m_CurrentUCode.m_Length);
DEBUG_LOG(DSPHLE, "CurrentUCode DEST Addr: 0x%08x", m_CurrentUCode.m_IMEMAddress);