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
This commit is contained in:
Shawn Hoffman
2009-04-03 19:29:15 +00:00
parent 2a5b8f4366
commit e1c3d1bfd4
7 changed files with 37 additions and 6 deletions

View File

@ -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)
{