mirror of
https://github.com/rvtr/TDT.git
synced 2025-10-31 13:51:07 -04:00
I switched it to calculating for the drive, but we actually want just the 1024 blocks given to the 00030004 folder anyways, so this just reverts to the old behaviour, but with a couple fixes
47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
#ifndef STORAGE_H
|
|
#define STORAGE_H
|
|
|
|
#include <nds/ndstypes.h>
|
|
#include <stdio.h>
|
|
|
|
#define BACKUP_PATH "sd:/titlebackup"
|
|
#define BYTES_PER_BLOCK (1024*128)
|
|
|
|
//printing
|
|
void printBytes(unsigned long long bytes);
|
|
|
|
//progress bar
|
|
void printProgressBar(float percent);
|
|
void clearProgressBar();
|
|
|
|
//Files
|
|
bool fileExists(char const* path);
|
|
int copyFile(char const* src, char const* dst);
|
|
int copyFilePart(char const* src, u32 offset, u32 size, char const* dst);
|
|
unsigned long long getFileSize(FILE* f);
|
|
unsigned long long getFileSizePath(char const* path);
|
|
bool padFile(char const* path, int size);
|
|
|
|
//Directories
|
|
bool dirExists(char const* path);
|
|
bool copyDir(char const* src, char const* dst);
|
|
bool deleteDir(char const* path);
|
|
unsigned long long getDirSize(char const* path, u32 blockSize);
|
|
|
|
//home menu
|
|
int getMenuSlots();
|
|
int getMenuSlotsFree();
|
|
#define getMenuSlotsUsed() (getMenuSlots() - getMenuSlotsFree())
|
|
|
|
//SD card
|
|
bool sdIsInserted();
|
|
unsigned long long getSDCardSize();
|
|
unsigned long long getSDCardFree();
|
|
#define getSDCardUsedSpace() (getSDCardSize() - getSDCardFree())
|
|
|
|
//internal storage
|
|
unsigned long long getDsiSize();
|
|
unsigned long long getDsiFree();
|
|
#define getDsiUsed() (getDSIStorageSize() - getDSIStorageFree())
|
|
|
|
#endif |