|
N64FlashcartMenu
|
Utilities for working with Controller Pak file systems. More...
Go to the source code of this file.
Data Structures | |
| struct | cpakfs_path_strings_t |
| Structure holding parsed components of a Controller Pak file path. More... | |
Macros | |
| #define | FS_BLOCK_DIVIDER (8 * 32) |
| Divider constant for file system block calculations. | |
| #define | MAX_NUM_NOTES 16 |
| Maximum number of notes (files) supported on a Controller Pak. | |
Functions | |
| int | get_block_size_from_fs_path (const char *filename_cpak) |
| Get the block size from a Controller Pak file system path. | |
| void | unmount_all_cpakfs (void) |
| Unmount all Controller Pak file systems. | |
| int | mount_cpakfs (int controller) |
| Mount the Controller Pak file system for a given controller. | |
| bool | has_cpak (int controller) |
| Check if a Controller Pak is present in the given controller. | |
| int | get_file_size_from_fs_path (const char *filename_cpak) |
| Get the file size from a Controller Pak file system path. | |
| int | extract_title_from_absolute_path (const char *path, char *outbuf, size_t outbuf_size) |
| Extract the title from an absolute file path. | |
| int | parse_cpakfs_fullname (const char *fullname, cpakfs_path_strings_t *out) |
| Parse a Controller Pak full filename into its components. | |
| int | file_exists_full (const char *full_mounted_path) |
| Check if a file exists at the given full mounted path. | |
| int | inc_index_note (int current_index) |
| Increment a note index, wrapping around MAX_NUM_NOTES. | |
| int | dec_index_note (int current_index) |
| Decrement a note index, wrapping around MAX_NUM_NOTES. | |
| int | pick_unique_fullname_with_mount (const char *mount_prefix, const char *desired_name, char *out_fullpath, size_t outsz, int(*exists_fullpath)(const char *fullpath)) |
| Pick a unique full filename with mount prefix, avoiding collisions. | |
Variables | |
| const char *const | CPAK_MOUNT_ARRAY [4] |
| Array of Controller Pak mount point strings (e.g., "cpak1:/"). | |
Utilities for working with Controller Pak file systems.
| struct cpakfs_path_strings_t |
Structure holding parsed components of a Controller Pak file path.
This struct contains the game code, publisher code, filename, and extension parsed from a Controller Pak file path.
| int get_block_size_from_fs_path | ( | const char * | filename_cpak | ) |
Get the block size from a Controller Pak file system path.
| filename_cpak | The Controller Pak file path. |
| int mount_cpakfs | ( | int | controller | ) |
Mount the Controller Pak file system for a given controller.
| controller | The controller index (0-3). |
| bool has_cpak | ( | int | controller | ) |
Check if a Controller Pak is present in the given controller.
| controller | The controller index (0-3). |
| int get_file_size_from_fs_path | ( | const char * | filename_cpak | ) |
Get the file size from a Controller Pak file system path.
| filename_cpak | The Controller Pak file path. |
| int extract_title_from_absolute_path | ( | const char * | path, |
| char * | outbuf, | ||
| size_t | outbuf_size ) |
Extract the title from an absolute file path.
| path | The absolute file path. |
| outbuf | Output buffer for the title. |
| outbuf_size | Size of the output buffer. |
The title is the filename up to the first underscore or dot, or the whole filename if neither is present.
| path | The absolute file path. |
| outbuf | Output buffer for the title. |
| outbuf_size | Size of the output buffer. |
| int parse_cpakfs_fullname | ( | const char * | fullname, |
| cpakfs_path_strings_t * | out ) |
Parse a Controller Pak full filename into its components.
| fullname | The full filename string. |
| out | Output struct for parsed components. |
| int file_exists_full | ( | const char * | full_mounted_path | ) |
Check if a file exists at the given full mounted path.
| full_mounted_path | The full mounted file path. |
| int inc_index_note | ( | int | current_index | ) |
Increment a note index, wrapping around MAX_NUM_NOTES.
| current_index | The current note index. |
| int dec_index_note | ( | int | current_index | ) |
Decrement a note index, wrapping around MAX_NUM_NOTES.
| current_index | The current note index. |
| int pick_unique_fullname_with_mount | ( | const char * | mount_prefix, |
| const char * | desired_name, | ||
| char * | out_fullpath, | ||
| size_t | outsz, | ||
| int(* | exists_fullpath )(const char *fullpath) ) |
Pick a unique full filename with mount prefix, avoiding collisions.
Attempts to find a unique filename by incrementing the extension in base36 if needed.
| mount_prefix | The mount prefix (e.g., "cpak1:/"). |
| desired_name | The desired base filename. |
| out_fullpath | Output buffer for the unique full path. |
| outsz | Size of the output buffer. |
| exists_fullpath | Function pointer to check if a full path exists. |
This function attempts to find a unique filename by incrementing the extension in base36 if needed.
| mount_prefix | The mount prefix (e.g., "cpak1:/"). |
| desired_name | The desired base filename. |
| out_fullpath | Output buffer for the unique full path. |
| outsz | Size of the output buffer. |
| exists_fullpath | Function pointer to check if a full path exists. |
|
extern |
Array of Controller Pak mount point strings (e.g., "cpak1:/").
Array of Controller Pak mount point strings (e.g., "cpak1:/").