Luma3DS/source/emunand.c

21 lines
463 B
C
Raw Normal View History

2015-08-04 21:57:37 -04:00
/*
* emunand.c
* by Reisyukaku
2015-08-14 22:28:26 -04:00
* Copyright (c) 2015 All Rights Reserved
2015-08-04 21:57:37 -04:00
*/
#include "emunand.h"
#include "fatfs/ff.h"
#include "fatfs/sdmmc/sdmmc.h"
static u8 *temp = (u8*)0x24300000;
2015-08-04 21:57:37 -04:00
void getEmunand(u32 *off, u32 *head){
u32 nandSize = getMMCDevice(0)->total_size;
if (sdmmc_sdcard_readsectors(nandSize, 1, temp) == 0) {
if (*(u32*)(temp + 0x100) == NCSD_MAGIC) {
*off = 0;
*head = nandSize;
2015-08-04 21:57:37 -04:00
}
}
}