TDT/arm9/src/storage.h
Pk11 c4e202b366 Fix free space calculation
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
2022-01-12 23:57:34 -06:00

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