nn::fs::MountRom FunctionResult MountRom( const char * archiveName, size_t maxFile, size_t maxDirectory, void * workingMemory, size_t workingMemorySize, bool useCache = true );
| Name | Description | |
|---|---|---|
| in | archiveName | Specifies the name of the archive. (In the overloaded version of this function in which this argument is omitted, "rom:" is specified implicitly.) |
| in | maxFile | The maximum number of files that can be opened simultaneously. |
| in | maxDirectory | The maximum number of directories that can be opened simultaneously. |
| in | workingMemory | The starting address of the memory region used for ROM archive operations. |
| in | workingMemorySize | The size of the memory region used for ROM archive operations. |
| in | useCache | Set to true to enable caching of metadata to memory, or false to disable metadata caching. |
| Value | Description |
|---|---|
| Success. | Process was successful. The return value's IsSuccess function returns true in this state. |
ResultNotFound |
There is no ROMFS. Confirm that the content of the RSF file is correct. You must not allow this error to occur in retail products. |
ResultNotEnoughSpace |
An insufficient memory size was specified to workingMemory. You must not allow this error to occur in retail products. |
| A value other than the above. | An unexpected or fatal error occurred. |
Mounts a ROM archive.
This function mounts a ROM archive that accesses a ROMFS generated at build time. The numbers of files and directories you can simultaneously open from the ROM archive are specified by maxFile and maxDirectory, respectively.
The region passed into workingMemory must be no smaller than the size calculated by the GetRomRequiredMemorySize function. You can cache ROMFS metadata to memory by setting the useCache argument to true. This reduces the time taken to open files and scan directories. However, it also increases the amount of memory required.
The following page has hints on how to handle mount errors. Please use this as a reference.
CONFIDENTIAL