mirror of
https://github.com/rvtr/TDT.git
synced 2025-10-31 13:51:07 -04:00
0.7.0
This commit is contained in:
parent
464fbd6151
commit
4729646e8d
@ -148,7 +148,12 @@ static void generateList(Menu* m)
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
|
|
||||||
struct dirent* ent;
|
struct dirent* ent;
|
||||||
DIR* dir = opendir(currentDir);
|
DIR* dir = NULL;
|
||||||
|
|
||||||
|
if (currentDir[0] == '\0')
|
||||||
|
dir = opendir("/");
|
||||||
|
else
|
||||||
|
dir = opendir(currentDir);
|
||||||
|
|
||||||
if (dir)
|
if (dir)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#define VERSION "0.6.8.1"
|
#define VERSION "0.7.0"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MAIN_MENU_INSTALL,
|
MAIN_MENU_INSTALL,
|
||||||
|
|||||||
@ -504,33 +504,29 @@ unsigned long long getSDCardFree()
|
|||||||
unsigned long long getDsiSize()
|
unsigned long long getDsiSize()
|
||||||
{
|
{
|
||||||
//The DSi has 256MB of internal storage. Some is unavailable and used by other things.
|
//The DSi has 256MB of internal storage. Some is unavailable and used by other things.
|
||||||
//Find a better way to do this
|
//An empty DSi reads 1024 open blocks
|
||||||
return 240 * 1024 * 1024;
|
return 1024 * BYTES_PER_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long long getDsiFree()
|
unsigned long long getDsiFree()
|
||||||
{
|
{
|
||||||
//Get free space by subtracting file sizes in emulated nand folders
|
//Get free space by subtracting file sizes in emulated nand folders
|
||||||
//Find a better way to do this
|
unsigned long long size = getDsiSize();
|
||||||
long long size = getDsiSize();
|
unsigned long long appSize = getDirSize("/title/00030004");
|
||||||
|
|
||||||
size -= getDirSize("/sys");
|
//round up to a full block
|
||||||
size -= getDirSize("/title/0003000f");
|
if (appSize % BYTES_PER_BLOCK != 0)
|
||||||
size -= getDirSize("/title/00030004");
|
appSize = ((int)(appSize / BYTES_PER_BLOCK) * BYTES_PER_BLOCK) + BYTES_PER_BLOCK;
|
||||||
size -= getDirSize("/title/00030005");
|
|
||||||
size -= getDirSize("/title/00030017");
|
|
||||||
size -= getDirSize("/ticket");
|
|
||||||
size -= getDirSize("/shared1");
|
|
||||||
size -= getDirSize("/shared2");
|
|
||||||
size -= getDirSize("/import");
|
|
||||||
size -= getDirSize("/tmp");
|
|
||||||
size -= getDirSize("/progress");
|
|
||||||
|
|
||||||
size -= getDirSize("/photo");
|
//subtract, but don't go under 0
|
||||||
size -= getDirSize("/private");
|
if (appSize > size)
|
||||||
|
{
|
||||||
if (size < 0)
|
size = 0;
|
||||||
return 0;
|
}
|
||||||
|
else
|
||||||
return (unsigned long long)size;
|
{
|
||||||
|
size -= appSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user