diff --git a/source/emunand.c b/source/emunand.c index 3ff5486..93aff58 100644 --- a/source/emunand.c +++ b/source/emunand.c @@ -34,11 +34,10 @@ void locateEmuNand(u32 *emuHeader, FirmwareSource *emuNand) for (u32 i = 0; i < 3 && !found; i++) { u32 nandOffset; - switch(i) { case 1: - nandOffset = nandSize + 1; //"Default" layout + nandOffset = ROUND_TO_4MB(nandSize + 1); //"Default" layout break; case 2: nandOffset = isN3DS ? 0x26E000 : 0x1D8000; //"Minsize" layout diff --git a/source/emunand.h b/source/emunand.h index 9226179..81f8603 100644 --- a/source/emunand.h +++ b/source/emunand.h @@ -24,7 +24,8 @@ #include "types.h" -#define NCSD_MAGIC 0x4453434E +#define NCSD_MAGIC 0x4453434E +#define ROUND_TO_4MB(x) (((x) + 0x2000 - 1) & (~(0x2000 - 1))) extern u32 emuOffset; extern bool isN3DS;