libnds
|
NitroFS filesystem embedded in a NDS ROM. More...
Functions | |
bool | nitroFSExit (void) |
Exits NitroFS. | |
WARN_UNUSED_RESULT FILE * | nitroFSFopenById (uint16_t id, const char *mode) |
Open a NitroFS file directly by its FAT offset ID. | |
WARN_UNUSED_RESULT bool | nitroFSInit (const char *basepath) |
Initializes NitroFS. | |
int | nitroFSInitLookupCache (uint32_t max_buffer_size) |
This function initializes a NitroFS lookup cache. | |
int | nitroFSOpenById (uint16_t id) |
Open a NitroFS file descriptor directly by its FAT offset ID. | |
NitroFS filesystem embedded in a NDS ROM.
bool nitroFSExit | ( | void | ) |
Exits NitroFS.
WARN_UNUSED_RESULT FILE * nitroFSFopenById | ( | uint16_t | id, |
const char * | mode | ||
) |
Open a NitroFS file directly by its FAT offset ID.
This FAT offset ID can be sourced from functions like
In all other functions, this file behaves identically to one sourced from
id | The FAT offset ID of the file (0x0000..0xEFFF). |
mode | The file open mode. Only "r" and "rb" are supported. |
WARN_UNUSED_RESULT bool nitroFSInit | ( | const char * | basepath | ) |
Initializes NitroFS.
If basepath or argv[0] is provided, an attempt to read the file system using DLDI will be made first. If that fails, the official cartridge protocol will be used instead.
basepath | The .nds file path - NULL to auto-detect. |
int nitroFSInitLookupCache | ( | uint32_t | max_buffer_size | ) |
This function initializes a NitroFS lookup cache.
This lookup cache allows avoiding expensive SD card lookups for large and/or backwards seeks, at the expensive of RAM usage.
This function will return 0 on non-DLDI/SD NitroFS accesses, as lookup caches are unnecessary in these situations.
max_buffer_size | The maximum buffer size, in bytes. |
int nitroFSOpenById | ( | uint16_t | id | ) |
Open a NitroFS file descriptor directly by its FAT offset ID.
This FAT offset ID can be sourced from functions like
In all other functions, this file descriptor behaves identically to one sourced from
id | The FAT offset ID of the file (0x0000..0xEFFF). |