DSPHLE: Add a config parameter to dump UCode to disk

This commit is contained in:
Pierre Bourdon 2014-04-01 21:55:19 +02:00
parent c306095684
commit a92727e862
4 changed files with 24 additions and 18 deletions

View File

@ -284,6 +284,7 @@ void SConfig::SaveDSPSettings(IniFile& ini)
dsp->Set("EnableJIT", m_DSPEnableJIT);
dsp->Set("DumpAudio", m_DumpAudio);
dsp->Set("DumpUCode", m_DumpUCode);
dsp->Set("Backend", sBackend);
dsp->Set("Volume", m_Volume);
dsp->Set("CaptureLog", m_DSPCaptureLog);
@ -543,6 +544,7 @@ void SConfig::LoadDSPSettings(IniFile& ini)
dsp->Get("EnableJIT", &m_DSPEnableJIT, true);
dsp->Get("DumpAudio", &m_DumpAudio, false);
dsp->Get("DumpUCode", &m_DumpUCode, false);
#if defined __linux__ && HAVE_ALSA
dsp->Get("Backend", &sBackend, BACKEND_ALSA);
#elif defined __APPLE__

View File

@ -255,6 +255,7 @@ struct SConfig : NonCopyable
bool m_DSPCaptureLog;
bool m_DumpAudio;
bool m_IsMuted;
bool m_DumpUCode;
int m_Volume;
std::string sBackend;

View File

@ -92,7 +92,8 @@ void ROMUCode::BootUCode()
(u8*)HLEMemory_Get_Pointer(m_current_ucode.m_ram_address),
m_current_ucode.m_length);
#if defined(_DEBUG) || defined(DEBUGFAST)
if (SConfig::GetInstance().m_DumpUCode)
{
std::string ucode_dump_path = StringFromFormat(
"%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX).c_str(), ector_crc);
@ -102,7 +103,7 @@ void ROMUCode::BootUCode()
fp.WriteArray((u8*)HLEMemory_Get_Pointer(m_current_ucode.m_ram_address),
m_current_ucode.m_length);
}
#endif
}
DEBUG_LOG(DSPHLE, "CurrentUCode SOURCE Addr: 0x%08x", m_current_ucode.m_ram_address);
DEBUG_LOG(DSPHLE, "CurrentUCode Length: 0x%08x", m_current_ucode.m_length);

View File

@ -9,6 +9,7 @@
#include "Common/Hash.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/HW/DSPHLE/UCodes/AX.h"
#include "Core/HW/DSPHLE/UCodes/AXWii.h"
#include "Core/HW/DSPHLE/UCodes/CARD.h"
@ -142,7 +143,8 @@ void UCodeInterface::PrepareBootUCode(u32 mail)
(u8*)HLEMemory_Get_Pointer(m_next_ucode.iram_mram_addr),
m_next_ucode.iram_size);
#if defined(_DEBUG) || defined(DEBUGFAST)
if (SConfig::GetInstance().m_DumpUCode)
{
std::string ucode_dump_path = StringFromFormat(
"%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX).c_str(), ector_crc);
@ -152,7 +154,7 @@ void UCodeInterface::PrepareBootUCode(u32 mail)
fp.WriteArray((u8*)Memory::GetPointer(m_next_ucode.iram_mram_addr),
m_next_ucode.iram_size);
}
#endif
}
DEBUG_LOG(DSPHLE, "PrepareBootUCode 0x%08x", ector_crc);
DEBUG_LOG(DSPHLE, "DRAM -> MRAM: src %04x dst %08x size %04x",