mirror of
https://github.com/rvtr/TDT.git
synced 2025-10-31 13:51:07 -04:00
Show how much space is free on NAND itself
This commit is contained in:
parent
0c0dcc3e5e
commit
8f203aa5c5
@ -512,15 +512,6 @@ unsigned long long getDsiSize()
|
|||||||
return 1024 * BYTES_PER_BLOCK;
|
return 1024 * BYTES_PER_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long long getDsiRealFree()
|
|
||||||
{
|
|
||||||
struct statvfs st;
|
|
||||||
if (statvfs(sdnandMode ? "sd:/" : "nand:/", &st) == 0)
|
|
||||||
return st.f_bsize * st.f_bavail;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long long getDsiFree()
|
unsigned long long getDsiFree()
|
||||||
{
|
{
|
||||||
u32 blockSize = getDsiClusterSize();
|
u32 blockSize = getDsiClusterSize();
|
||||||
@ -544,6 +535,24 @@ unsigned long long getDsiFree()
|
|||||||
return (realFree < size) ? realFree : size;
|
return (realFree < size) ? realFree : size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long long getDsiRealSize()
|
||||||
|
{
|
||||||
|
struct statvfs st;
|
||||||
|
if (statvfs(sdnandMode ? "sd:/" : "nand:/", &st) == 0)
|
||||||
|
return st.f_bsize * st.f_blocks;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long long getDsiRealFree()
|
||||||
|
{
|
||||||
|
struct statvfs st;
|
||||||
|
if (statvfs(sdnandMode ? "sd:/" : "nand:/", &st) == 0)
|
||||||
|
return st.f_bsize * st.f_bavail;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
u32 getDsiClusterSize()
|
u32 getDsiClusterSize()
|
||||||
{
|
{
|
||||||
struct statvfs st;
|
struct statvfs st;
|
||||||
|
|||||||
@ -41,8 +41,9 @@ unsigned long long getSDCardFree();
|
|||||||
|
|
||||||
//internal storage
|
//internal storage
|
||||||
unsigned long long getDsiSize();
|
unsigned long long getDsiSize();
|
||||||
unsigned long long getDsiRealFree();
|
|
||||||
unsigned long long getDsiFree();
|
unsigned long long getDsiFree();
|
||||||
|
unsigned long long getDsiRealSize();
|
||||||
|
unsigned long long getDsiRealFree();
|
||||||
u32 getDsiClusterSize();
|
u32 getDsiClusterSize();
|
||||||
#define getDsiUsed() (getDSIStorageSize() - getDSIStorageFree())
|
#define getDsiUsed() (getDSIStorageSize() - getDSIStorageFree())
|
||||||
|
|
||||||
|
|||||||
@ -17,53 +17,58 @@ void testMenu()
|
|||||||
//home menu slots
|
//home menu slots
|
||||||
{
|
{
|
||||||
iprintf("Free Home Menu Slots:\n");
|
iprintf("Free Home Menu Slots:\n");
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
free = getMenuSlotsFree();
|
free = getMenuSlotsFree();
|
||||||
iprintf("\t%d / ", free);
|
iprintf("\t%d / ", free);
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
size = getMenuSlots();
|
size = getMenuSlots();
|
||||||
iprintf("%d\n", size);
|
iprintf("%d\n", size);
|
||||||
swiWaitForVBlank();
|
}
|
||||||
|
|
||||||
|
//dsi menu
|
||||||
|
{
|
||||||
|
iprintf("\nFree DSi Menu Space:\n\t");
|
||||||
|
|
||||||
|
free = getDsiFree();
|
||||||
|
printBytes(free);
|
||||||
|
iprintf(" / ");
|
||||||
|
|
||||||
|
size = getDsiSize();
|
||||||
|
printBytes(size);
|
||||||
|
iprintf("\n");
|
||||||
|
|
||||||
|
iprintf("\t%d / %d blocks\n", free / BYTES_PER_BLOCK, size / BYTES_PER_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
//nand
|
||||||
|
if (!sdnandMode)
|
||||||
|
{
|
||||||
|
iprintf("\nFree NAND Space:\n\t");
|
||||||
|
|
||||||
|
free = getDsiRealFree();
|
||||||
|
printBytes(free);
|
||||||
|
iprintf(" / ");
|
||||||
|
|
||||||
|
size = getDsiRealSize();
|
||||||
|
printBytes(size);
|
||||||
|
iprintf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//SD Card
|
//SD Card
|
||||||
{
|
{
|
||||||
iprintf("\nFree SD Space:\n\t");
|
iprintf("\nFree SD Space:\n\t");
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
unsigned long long sdfree = getSDCardFree();
|
unsigned long long sdfree = getSDCardFree();
|
||||||
printBytes(sdfree);
|
printBytes(sdfree);
|
||||||
iprintf(" / ");
|
iprintf(" / ");
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
unsigned long long sdsize = getSDCardSize();
|
unsigned long long sdsize = getSDCardSize();
|
||||||
printBytes(sdsize);
|
printBytes(sdsize);
|
||||||
iprintf("\n");
|
iprintf("\n");
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
printf("\t%d / %d blocks\n", (unsigned int)(sdfree / BYTES_PER_BLOCK), (unsigned int)(sdsize / BYTES_PER_BLOCK));
|
printf("\t%d / %d blocks\n", (unsigned int)(sdfree / BYTES_PER_BLOCK), (unsigned int)(sdsize / BYTES_PER_BLOCK));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Emunand
|
|
||||||
{
|
|
||||||
iprintf("\nFree DSi Space:\n\t");
|
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
free = getDsiFree();
|
|
||||||
printBytes(free);
|
|
||||||
iprintf(" / ");
|
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
size = getDsiSize();
|
|
||||||
printBytes(size);
|
|
||||||
iprintf("\n");
|
|
||||||
swiWaitForVBlank();
|
|
||||||
|
|
||||||
iprintf("\t%d / %d blocks\n", free / BYTES_PER_BLOCK, size / BYTES_PER_BLOCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
//end
|
//end
|
||||||
iprintf("\nBack - [B]\n");
|
iprintf("\nBack - [B]\n");
|
||||||
keyWait(KEY_B);
|
keyWait(KEY_B);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user