/* Written by Wolfvak, specially sublicensed under the GPLv2 Read LICENSE for more details */ #include "common.h" #include "fsinit.h" #include "fsutil.h" #include "ui.h" #include /* Code will be dumped from PC-PC_DUMPRAD to PC+PC_DUMPRAD */ #define PC_DUMPRAD (0x20) #define XRQ_DUMPDATAFUNC(type, size) \ int XRQ_DumpData_##type(char *b, u32 s, u32 e) \ { \ char *c = b; \ while(s= 0x20000000 && sp <= st) { wstr += sprintf(wstr, "\nStack dump:\n\n"); wstr += XRQ_DumpData_u8(wstr, sp, st); } pc = regs[15]; wstr += sprintf(wstr, "\nCode dump:\n\n"); if (regs[16] & SR_THUMB) { wstr += XRQ_DumpData_u16(wstr, pc-PC_DUMPRAD, pc+PC_DUMPRAD); } else { wstr += XRQ_DumpData_u32(wstr, pc-PC_DUMPRAD, pc+PC_DUMPRAD); } DrawStringF(MAIN_SCREEN, 10, y, COLOR_WHITE, COLOR_BLACK, "Dumping state to SD..."); y+=FONT_HEIGHT_EXT; FileSetData(OUTPUT_PATH"/dump.txt", dumpstr, wstr - dumpstr, 0, true); DrawStringF(MAIN_SCREEN, 10, y, COLOR_WHITE, COLOR_BLACK, "Done"); return; }