Skip to content

Commit

Permalink
Merge pull request #530 from workhorsy/master
Browse files Browse the repository at this point in the history
Fixed issue with DSP Dump not closing files.
  • Loading branch information
lioncash committed Jun 23, 2014
2 parents ffacb26 + ad5d28a commit 4138702
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/DSPSpy/main_spy.cpp
Expand Up @@ -224,19 +224,23 @@ void DumpDSP_ROMs(const u16* rom, const u16* coef)
FILE *fROM = fopen(filename, "wb");
sprintf(filename, "sd:/dsp_coef.bin");
FILE *fCOEF = fopen(filename, "wb");

if (fROM && fCOEF)
{
fwrite(MEM_PHYSICAL_TO_K0(rom), 0x2000, 1, fROM);
fclose(fROM);
fwrite(MEM_PHYSICAL_TO_K0(coef), 0x1000, 1, fCOEF);

fwrite(MEM_PHYSICAL_TO_K0(coef), 0x1000, 1, fCOEF);
fclose(fCOEF);
UpdateLastMessage("DSP ROMs dumped to SD");
}
else
{
UpdateLastMessage("SD Write Error");
}

if (fROM)
fclose(fROM);
if (fCOEF)
fclose(fCOEF);
#else
// Allow to connect to gdb (dump ram... :s)
_break();
Expand Down

0 comments on commit 4138702

Please sign in to comment.