62 lines
2.1 KiB
C
Raw Permalink 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-04-18 17:27:44 +02:00
#define VIRT_FS 12
2016-12-10 15:32:03 +01:00
// primary drive types
#define DRV_UNKNOWN (0<<0)
2017-02-17 15:54:37 +01:00
#define DRV_FAT (1UL<<0)
#define DRV_VIRTUAL (1UL<<1)
2016-12-10 15:32:03 +01:00
// secondary drive types
2017-02-17 15:54:37 +01:00
#define DRV_SDCARD (1UL<<2)
#define DRV_SYSNAND (1UL<<3)
#define DRV_EMUNAND (1UL<<4)
#define DRV_CTRNAND (1UL<<5)
#define DRV_TWLNAND (1UL<<6)
#define DRV_IMAGE (1UL<<7)
#define DRV_XORPAD (1UL<<8)
#define DRV_RAMDRIVE (1UL<<9)
#define DRV_MEMORY (1UL<<10)
#define DRV_GAME (1UL<<11)
#define DRV_CART (1UL<<12)
#define DRV_ALIAS (1UL<<13)
#define DRV_BONUS (1UL<<14)
#define DRV_SEARCH (1UL<<15)
#define DRV_STDFAT (1UL<<16) // 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-04-18 17:27:44 +02:00
"GAME IMAGE", "AESKEYDB IMAGE", "TICKET.DB 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-04-18 17:27:44 +02:00
"0:", "1:", "2:", "3:", "A:", "S:", "4:", "5:", "6:", "B:", "E:", "7:", "8:", "9:", "I:", "C:", "G:", "K:", "T:", "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 / mode for special Z: drive **/
void SetFSSearch(const char* pattern, const char* path, bool mode);
2016-12-10 15:32:03 +01:00
/** 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);