diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 6d4f668eb0..60b46928c7 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -510,7 +510,8 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam wxMenuItem* pJit = pDebugDialogs->Append(IDM_JITWINDOW, _T("&Jit"), wxEmptyString, wxITEM_CHECK); pJit->Check(bJitWindow); - wxMenuItem* pSound = pDebugDialogs->Append(IDM_SOUNDWINDOW, _T("&Sound"), wxEmptyString); + wxMenuItem* pSound = pDebugDialogs->Append(IDM_SOUNDWINDOW, _T("&Sound"), wxEmptyString, wxITEM_CHECK); + pSound->Check(bSoundWindow); wxMenuItem* pVideo = pDebugDialogs->Append(IDM_VIDEOWINDOW, _T("&Video"), wxEmptyString, wxITEM_CHECK); pVideo->Check(bVideoWindow); diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp index 838cc5f636..aef6b78614 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp @@ -279,6 +279,9 @@ DSPOPCTemplate opcodes[] = // FIXME: nakee guessing (check masks and params!) {"TSTA?", 0xa100, 0xf7ff, DSPInterpreter::tsta, nop, 1 | P_EXT, 1, {{P_REG18, 1, 0, 11, 0x1000}}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi}, + + // unknown opcode for disassemble + {"CW", 0x0000, 0x0000, nop, nop, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, NULL, NULL,}, }; DSPOPCTemplate opcodes_ext[] = diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.cpp index 3ada940956..0d6d0eaead 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.cpp @@ -62,7 +62,8 @@ void DSPDebuggerLLE::CreateGUIControls() m_Toolbar->AddTool(ID_STEPTOOL, wxT("Step"), wxNullBitmap, wxT("Step Code "), wxITEM_NORMAL); m_Toolbar->AddTool(ID_SHOWPCTOOL, wxT("Show Pc"), wxNullBitmap, wxT("Reset To PC counter"), wxITEM_NORMAL); m_Toolbar->AddTool(ID_JUMPTOTOOL, wxT("Jump"), wxNullBitmap, wxT("Jump to a specific Address"), wxITEM_NORMAL); - m_Toolbar->AddCheckTool(ID_DUMPCODETOOL, wxT("Dump"), wxNullBitmap, wxNullBitmap, wxT("Dump UCode to File")); + m_Toolbar->AddSeparator(); + m_Toolbar->AddCheckTool(ID_DUMPCODETOOL, wxT("Dump"), wxNullBitmap, wxNullBitmap, wxT("Dump UCode to file and disasm")); m_Toolbar->AddSeparator(); m_Toolbar->AddCheckTool(ID_CHECK_ASSERTINT, wxT("AssertInt"), wxNullBitmap, wxNullBitmap, wxEmptyString); m_Toolbar->AddCheckTool(ID_CHECK_HALT, wxT("Halt"), wxNullBitmap, wxNullBitmap, wxEmptyString); diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.h index ae7d278bfd..940aaa33be 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Debugger/Debugger.h @@ -67,6 +67,7 @@ private: ID_SHOWPCTOOL, ID_JUMPTOTOOL, ID_DUMPCODETOOL, + ID_DISASMDUMPTOOL, ID_CHECK_ASSERTINT, ID_CHECK_HALT, ID_CHECK_INIT, diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp index 770ed12f6c..59ebf76f17 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp @@ -21,6 +21,8 @@ #include "Common.h" #include "Globals.h" +#include "Tools.h" +#include "disassemble.h" #include "gdsp_interpreter.h" bool DumpDSPCode(u32 _Address, u32 _Length, u32 crc) @@ -33,16 +35,39 @@ bool DumpDSPCode(u32 _Address, u32 _Length, u32 crc) { fwrite(g_dspInitialize.pGetMemoryPointer(_Address), _Length, 1, pFile); fclose(pFile); - return(true); } else { PanicAlert("Cant open file (%s) to dump UCode!!", szFilename); + return false; } - return(false); + if (!DisasmUCodeDump(crc)) + { + PanicAlert("Failed to disasm UCode!!", szFilename); + return false; + } + + return true; } +bool DisasmUCodeDump(u32 crc) +{ + char binFile[MAX_PATH]; + char txtFile[MAX_PATH]; + sprintf(binFile, "%sDSP_UC_%08X.bin", FULL_DUMP_DIR, crc); + sprintf(txtFile, "%sDSP_UC_%08X.txt", FULL_DUMP_DIR, crc); + FILE* t = fopen(txtFile, "wb"); + if (t != NULL) + { + gd_globals_t gdg; + gd_dis_file(&gdg, binFile, t); + fclose(t); + return true; + } + else + return false; +} u32 GenerateCRC(const unsigned char* _pBuffer, int _pLength) { diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.h b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.h index 2c9e242c5e..0520ef4bbe 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.h +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.h @@ -44,7 +44,7 @@ union UDSPControl : Hex(_Hex) {} }; - bool DumpDSPCode(u32 _Address, u32 _Length, u32 crc); +bool DisasmUCodeDump(u32 crc); u32 GenerateCRC(const unsigned char* _pBuffer, int _pLength); bool DumpCWCode(u32 _Address, u32 _Length); diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/gdsp_interface.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/gdsp_interface.cpp index fd32292fb1..2aa7a94c30 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/gdsp_interface.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/gdsp_interface.cpp @@ -257,7 +257,7 @@ void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) DEBUG_LOG(DSPHLE, "*** Copy new UCode from 0x%08x to 0x%04x (crc: %8x)\n", addr, dsp_addr, g_dsp.iram_crc); if (g_dsp.dump_imem) - DumpDSPCode(addr, size, g_dsp.iram_crc ); + DumpDSPCode(addr, size, g_dsp.iram_crc); }