Enumerations | |
enum | GBFS_INIT_MODES { GBFS_COMPATIBLE_MODE, GBFS_DEFAULT_MODE } |
Functions | |
int | ulInitLibFat () |
int | ulInitGBFS (int compatMode) |
Variables | |
int | VF_MEMORY |
int | VF_FILE |
int | VF_GBFS |
enum GBFS_INIT_MODES |
int ulInitLibFat | ( | ) |
Initializes LibFAT - crashes if no device supporting libfat is present...
You have to call this routine before you can work with files. libFat support will be added to your code, eating something like 75 kB.
int ulInitGBFS | ( | int | compatMode | ) |
Initializes GBFS - returns 0 in case of success or -1 if it failed.
You have to call this routine before you can open any GBFS file. GBFS support will be added to your application, it's quite small (less than 2 kB IIRC).
int VF_MEMORY |
Read and write from memory. Automatically registered when initializing µLibrary.
int VF_FILE |
Use libFat as a virtual file source. Needs to call ulInitLibFat to use it. However, it will crash if no device supporting libFat is present, so be careful.
If you want to create several versions, I suggest you to keep a global variable that identifies the virtual file source you're using. In one version, it could have the value of VF_GBFS, in another VF_FILE. At startup you would just have to do:
int myID; [...] #if defined(USE_GBFS) myID = ulInitGBFS(GBFS_COMPATIBLE_MODE); #elif defined(USE_LIBFAT) myID = ulInitLibFat(); #endif [...] VIRTUAL_FILE *f = VirtualFileOpen("/test.txt", 0, myID, VF_O_READ); [...]
It could even be a choice proposed to the user at startup.
int VF_GBFS |
Use GBFS (Game Boy File System). Needs to call ulInitGBFS to use that source.