From e1350de3463399ab83cd8079d2481a84b19334dc Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Mon, 28 Dec 2020 21:59:25 +0100 Subject: [PATCH] make sure sd space > emummc --- source/tegraexplorer/tools.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/tegraexplorer/tools.c b/source/tegraexplorer/tools.c index b32bbe4..e1e0eda 100644 --- a/source/tegraexplorer/tools.c +++ b/source/tegraexplorer/tools.c @@ -167,15 +167,21 @@ void FormatSD(){ emummc = !(res - 1); + SETCOLOR(COLOR_RED, COLOR_DEFAULT); + plist[0] = sd_storage.csd.capacity; if (emummc){ + if (plist[0] < 83886080){ + gfx_printf("\n\nYou seem to be running this on a 32GB or smaller SD\nNot enough free space for emummc!"); + hidWait(); + return; + } plist[0] -= 61145088; u32 allignedSectors = plist[0] - plist[0] % 2048; plist[1] = 61145088 + plist[0] % 2048; plist[0] = allignedSectors; } - SETCOLOR(COLOR_RED, COLOR_DEFAULT); gfx_printf("\n\nAre you sure you want to format your sd?\nThis will delete everything on your SD card!\nThis action is irreversible!\n\n"); WaitFor(1500);