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 |
|---|---|
Result::IsSuccess |
Process was successful. |
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. |
ResultAlreadyExists |
The specified archive name is already mounted. 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.
| Series | SDK version | Return Value Specification |
|---|---|---|
| CTR-SDK 1.X | 1.1 and earlier | One of the results above is returned when an error occurs. |
| 1.2 or later | An error will cause a transition to the error display screen. (Only success is returned.) | |
| CTR-SDK 2.X | 2.0 and earlier | One of the results above is returned when an error occurs. |
| 2.1 or later | An error will cause a transition to the error display screen. (Only success is returned.) |
CONFIDENTIAL