diff --git a/source/arm9/debug.c b/source/arm9/debug.c index 75ecef4..ac33cbd 100644 --- a/source/arm9/debug.c +++ b/source/arm9/debug.c @@ -3,7 +3,7 @@ #include "types.h" #include "mem_map.h" #include "arm9/console.h" - +#include "arm9/fatfs/ff.h" static u32 debugHash = 0; @@ -97,3 +97,16 @@ while(1); } + +void dumpMem(u8 *mem, u32 size, char *filepath) +{ + FIL file; + UINT bytesWritten; + + if(f_open(&file, filepath, FA_CREATE_ALWAYS | FA_WRITE) != FR_OK) + return; + + f_write(&file, mem, size, &bytesWritten); + + f_close(&file); +} diff --git a/source/arm9/sdmmc.c b/source/arm9/sdmmc.c index d1c4ae4..6755ee3 100644 --- a/source/arm9/sdmmc.c +++ b/source/arm9/sdmmc.c @@ -305,7 +305,6 @@ handleNAND.rData = out; handleNAND.size = numsectors << 9; sdmmc_send_command(&handleNAND,0x33C12,sector_no); - set_target(&handleSD); return get_error(&handleNAND); } @@ -322,7 +321,6 @@ handleNAND.tData = in; handleNAND.size = numsectors << 9; sdmmc_send_command(&handleNAND,0x52C19,sector_no); - set_target(&handleSD); return get_error(&handleNAND); } @@ -409,8 +407,6 @@ *(volatile uint16_t*)0x10006002 &= 0xFFFCu; ////SDPORTSEL *(volatile uint16_t*)0x10006026 = 512; //SDBLKLEN *(volatile uint16_t*)0x10006008 = 0; //SDSTOP - - set_target(&handleSD); } int Nand_Init() @@ -461,8 +457,6 @@ handleNAND.clk |= 0x200; - set_target(&handleSD); - return 0; }