diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2009-04-03 19:29:15 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2009-04-03 19:29:15 +0000 |
| commit | e1c3d1bfd4fa246d32125ed3e05290fbd08d3178 (patch) | |
| tree | 73c873a40531ffa6d5cecd22749d38fdbec3d9d6 /Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp | |
| parent | 2a5b8f43660d00dbc6ed004bfbe61f643945e9f7 (diff) | |
dsp llet debugger: disasm the ucode when it's dumped
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2857 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_DSP_LLE-testing/Src/Tools.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
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) { |
