GodMode9/source/fs/fsdrive.h

59 lines
1.9 KiB
C
Raw Normal View History

2016-12-10 15:32:03 +01:00
#pragma once
#include "common.h"
#include "fsdir.h"
#define NORM_FS 10
#define IMGN_FS 3 // image normal filesystems
2017-01-13 14:20:42 +01:00
#define VIRT_FS 10
2016-12-10 15:32:03 +01:00
// primary drive types
#define DRV_UNKNOWN (0<<0)
#define DRV_FAT (1<<0)
#define DRV_VIRTUAL (1<<1)
// secondary drive types
#define DRV_SDCARD (1<<2)
#define DRV_SYSNAND (1<<3)
#define DRV_EMUNAND (1<<4)
#define DRV_IMAGE (1<<5)
#define DRV_XORPAD (1<<6)
#define DRV_RAMDRIVE (1<<7)
#define DRV_MEMORY (1<<8)
#define DRV_GAME (1<<9)
2017-01-13 14:20:42 +01:00
#define DRV_CART (1<<10)
#define DRV_ALIAS (1<<11)
#define DRV_SEARCH (1<<12)
#define DRV_STDFAT (1<<13) // standard FAT drive without limitations
2016-12-10 15:32:03 +01:00
#define FS_DRVNAME \
"SDCARD", \
2017-02-10 15:04:31 +01:00
"SYSNAND CTRNAND", "SYSNAND TWLN", "SYSNAND TWLP", "SYSNAND SD", "SYSNAND VIRTUAL", \
"EMUNAND CTRNAND", "EMUNAND TWLN", "EMUNAND TWLP", "EMUNAND SD", "EMUNAND VIRTUAL", \
"IMGNAND CTRNAND", "IMGNAND TWLN", "IMGNAND TWLP", "IMGNAND VIRTUAL", \
2017-01-13 14:20:42 +01:00
"GAMECART", \
2017-02-10 15:04:31 +01:00
"GAME IMAGE", \
2016-12-10 15:32:03 +01:00
"MEMORY VIRTUAL", \
2017-02-10 15:04:31 +01:00
"NAND XORPADS", \
2016-12-10 15:32:03 +01:00
"LAST SEARCH" \
#define FS_DRVNUM \
2017-02-10 15:04:31 +01:00
"0:", "1:", "2:", "3:", "A:", "S:", "4:", "5:", "6:", "B:", "E:", "7:", "8:", "9:", "I:", "C:", "G:", "M:", "X:", "Z:"
2016-12-10 15:32:03 +01:00
/** Function to identify the type of a drive **/
int DriveType(const char* path);
/** Set search pattern / path for special Z: drive **/
void SetFSSearch(const char* pattern, const char* path);
/** Get directory content under a given path **/
void GetDirContents(DirStruct* contents, const char* path);
/** Gets remaining space in filesystem in bytes */
uint64_t GetFreeSpace(const char* path);
/** Gets total spacein filesystem in bytes */
uint64_t GetTotalSpace(const char* path);
/** Return the offset - in sectors - of the FAT partition on the drive **/
uint64_t GetPartitionOffsetSector(const char* path);