mirror of
https://github.com/joel16/3DSident.git
synced 2024-11-23 03:29:45 +00:00
cf84991672
- Cleaned up a bunch of functions - Now builds with the latest toolchain. - GUI uses Citro2D.
32 lines
842 B
C
32 lines
842 B
C
#include "storage.h"
|
|
|
|
u64 Storage_GetFreeStorage(FS_SystemMediaType mediaType)
|
|
{
|
|
FS_ArchiveResource resource = {0};
|
|
|
|
if (R_SUCCEEDED(FSUSER_GetArchiveResource(&resource, mediaType)))
|
|
return (((u64) resource.freeClusters * (u64) resource.clusterSize));
|
|
|
|
return 0;
|
|
}
|
|
|
|
u64 Storage_GetTotalStorage(FS_SystemMediaType mediaType)
|
|
{
|
|
FS_ArchiveResource resource = {0};
|
|
|
|
if (R_SUCCEEDED(FSUSER_GetArchiveResource(&resource, mediaType)))
|
|
return (((u64) resource.totalClusters * (u64) resource.clusterSize));
|
|
|
|
return 0;
|
|
}
|
|
|
|
u64 Storage_GetUsedStorage(FS_SystemMediaType mediaType)
|
|
{
|
|
FS_ArchiveResource resource = {0};
|
|
|
|
if (R_SUCCEEDED(FSUSER_GetArchiveResource(&resource, mediaType)))
|
|
return ((((u64) resource.totalClusters * (u64) resource.clusterSize)) - (((u64) resource.freeClusters * (u64) resource.clusterSize)));
|
|
|
|
return 0;
|
|
}
|