libctru  v2.4.1
Typedefs | Functions
fspxi.h File Reference

Service interface for PxiFS services. More...

#include <3ds/services/fs.h>
#include <3ds/types.h>

Go to the source code of this file.

Typedefs

typedef u64 FSPXI_Archive
 
typedef u64 FSPXI_File
 
typedef u64 FSPXI_Directory
 

Functions

Result FSPXI_OpenFile (Handle serviceHandle, FSPXI_File *out, FSPXI_Archive archive, FS_Path path, u32 flags, u32 attributes)
 Opens a file. More...
 
Result FSPXI_DeleteFile (Handle serviceHandle, FSPXI_Archive archive, FS_Path path)
 Deletes a file. More...
 
Result FSPXI_RenameFile (Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath)
 Renames a file. More...
 
Result FSPXI_DeleteDirectory (Handle serviceHandle, FSPXI_Archive archive, FS_Path path)
 Deletes a directory. More...
 
Result FSPXI_CreateFile (Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes, u64 fileSize)
 Creates a file. More...
 
Result FSPXI_CreateDirectory (Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes)
 Creates a directory. More...
 
Result FSPXI_RenameDirectory (Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath)
 Renames a directory. More...
 
Result FSPXI_OpenDirectory (Handle serviceHandle, FSPXI_Directory *out, FSPXI_Archive archive, FS_Path path)
 Opens a directory. More...
 
Result FSPXI_ReadFile (Handle serviceHandle, FSPXI_File file, u32 *bytesRead, u64 offset, void *buffer, u32 size)
 Reads from a file. More...
 
Result FSPXI_CalculateFileHashSHA256 (Handle serviceHandle, FSPXI_File file, void *buffer, u32 size)
 Calculate SHA256 of a file. More...
 
Result FSPXI_WriteFile (Handle serviceHandle, FSPXI_File file, u32 *bytesWritten, u64 offset, const void *buffer, u32 size, u32 flags)
 Writes to a file. More...
 
Result FSPXI_CalcSavegameMAC (Handle serviceHandle, FSPXI_File file, const void *inBuffer, u32 inSize, void *outBuffer, u32 outSize)
 Calculates the MAC used in a DISA/DIFF header? More...
 
Result FSPXI_GetFileSize (Handle serviceHandle, FSPXI_File file, u64 *size)
 Get size of a file. More...
 
Result FSPXI_SetFileSize (Handle serviceHandle, FSPXI_File file, u64 size)
 Set size of a file. More...
 
Result FSPXI_CloseFile (Handle serviceHandle, FSPXI_File file)
 Close a file. More...
 
Result FSPXI_ReadDirectory (Handle serviceHandle, FSPXI_Directory directory, u32 *entriesRead, u32 entryCount, FS_DirectoryEntry *entries)
 Reads one or more directory entries. More...
 
Result FSPXI_CloseDirectory (Handle serviceHandle, FSPXI_Directory directory)
 Close a directory. More...
 
Result FSPXI_OpenArchive (Handle serviceHandle, FSPXI_Archive *archive, FS_ArchiveID archiveID, FS_Path path)
 Opens an archive. More...
 
Result FSPXI_HasFile (Handle serviceHandle, FSPXI_Archive archive, bool *out, FS_Path path)
 Checks if the archive contains a file at path. More...
 
Result FSPXI_HasDirectory (Handle serviceHandle, FSPXI_Archive archive, bool *out, FS_Path path)
 Checks if the archive contains a directory at path. More...
 
Result FSPXI_CommitSaveData (Handle serviceHandle, FSPXI_Archive archive, u32 id)
 Commits an archive's save data. More...
 
Result FSPXI_CloseArchive (Handle serviceHandle, FSPXI_Archive archive)
 Close an archive. More...
 
Result FSPXI_Unknown0x17 (Handle serviceHandle, FSPXI_Archive archive, bool *out)
 Unknown 0x17. More...
 
Result FSPXI_GetCardType (Handle serviceHandle, FS_CardType *out)
 Gets the inserted card type. More...
 
Result FSPXI_GetSdmcArchiveResource (Handle serviceHandle, FS_ArchiveResource *out)
 Gets the SDMC archive resource information. More...
 
Result FSPXI_GetNandArchiveResource (Handle serviceHandle, FS_ArchiveResource *out)
 Gets the NAND archive resource information. More...
 
Result FSPXI_GetSdmcFatFsError (Handle serviceHandle, u32 *out)
 Gets the error code from the SDMC FatFS driver. More...
 
Result FSPXI_IsSdmcDetected (Handle serviceHandle, bool *out)
 Gets whether PXIFS0 detects the SD. More...
 
Result FSPXI_IsSdmcWritable (Handle serviceHandle, bool *out)
 Gets whether PXIFS0 can write to the SD. More...
 
Result FSPXI_GetSdmcCid (Handle serviceHandle, void *out, u32 size)
 Gets the SDMC CID. More...
 
Result FSPXI_GetNandCid (Handle serviceHandle, void *out, u32 size)
 Gets the NAND CID. More...
 
Result FSPXI_GetSdmcSpeedInfo (Handle serviceHandle, FS_SdMmcSpeedInfo *out)
 Gets the SDMC speed info. More...
 
Result FSPXI_GetNandSpeedInfo (Handle serviceHandle, FS_SdMmcSpeedInfo *out)
 Gets the NAND speed info. More...
 
Result FSPXI_GetSdmcLog (Handle serviceHandle, void *out, u32 size)
 Gets the SDMC log. More...
 
Result FSPXI_GetNandLog (Handle serviceHandle, void *out, u32 size)
 Gets the NAND log. More...
 
Result FSPXI_ClearSdmcLog (Handle serviceHandle)
 Clears the SDMC log.
 
Result FSPXI_ClearNandLog (Handle serviceHandle)
 Clears the NAND log.
 
Result FSPXI_CardSlotIsInserted (Handle serviceHandle, bool *inserted)
 Gets whether a card is inserted. More...
 
Result FSPXI_CardSlotPowerOn (Handle serviceHandle, bool *status)
 Powers on the card slot. More...
 
Result FSPXI_CardSlotPowerOff (Handle serviceHandle, bool *status)
 Powers off the card slot. More...
 
Result FSPXI_CardSlotGetCardIFPowerStatus (Handle serviceHandle, bool *status)
 Gets the card's power status. More...
 
Result FSPXI_CardNorDirectCommand (Handle serviceHandle, u8 commandId)
 Executes a CARDNOR direct command. More...
 
Result FSPXI_CardNorDirectCommandWithAddress (Handle serviceHandle, u8 commandId, u32 address)
 Executes a CARDNOR direct command with an address. More...
 
Result FSPXI_CardNorDirectRead (Handle serviceHandle, u8 commandId, u32 size, void *output)
 Executes a CARDNOR direct read. More...
 
Result FSPXI_CardNorDirectReadWithAddress (Handle serviceHandle, u8 commandId, u32 address, u32 size, void *output)
 Executes a CARDNOR direct read with an address. More...
 
Result FSPXI_CardNorDirectWrite (Handle serviceHandle, u8 commandId, u32 size, const void *input)
 Executes a CARDNOR direct write. More...
 
Result FSPXI_CardNorDirectWriteWithAddress (Handle serviceHandle, u8 commandId, u32 address, u32 size, const void *input)
 Executes a CARDNOR direct write with an address. More...
 
Result FSPXI_CardNorDirectRead_4xIO (Handle serviceHandle, u8 commandId, u32 address, u32 size, void *output)
 Executes a CARDNOR 4xIO direct read. More...
 
Result FSPXI_CardNorDirectCpuWriteWithoutVerify (Handle serviceHandle, u32 address, u32 size, const void *input)
 Executes a CARDNOR direct CPU write without verify. More...
 
Result FSPXI_CardNorDirectSectorEraseWithoutVerify (Handle serviceHandle, u32 address)
 Executes a CARDNOR direct sector erase without verify. More...
 
Result FSPXI_GetProductInfo (Handle serviceHandle, FS_ProductInfo *info, FSPXI_Archive archive)
 Gets an NCCH's product info. More...
 
Result FSPXI_SetCardSpiBaudrate (Handle serviceHandle, FS_CardSpiBaudRate baudRate)
 Sets the CARDSPI baud rate. More...
 
Result FSPXI_SetCardSpiBusMode (Handle serviceHandle, FS_CardSpiBusMode busMode)
 Sets the CARDSPI bus mode. More...
 
Result FSPXI_SendInitializeInfoTo9 (Handle serviceHandle, u8 unk)
 Sends initialization info to ARM9. More...
 
Result FSPXI_CreateExtSaveData (Handle serviceHandle, FS_ExtSaveDataInfo info)
 Creates ext save data. More...
 
Result FSPXI_DeleteExtSaveData (Handle serviceHandle, FS_ExtSaveDataInfo info)
 Deletes ext save data. More...
 
Result FSPXI_EnumerateExtSaveData (Handle serviceHandle, u32 *idsWritten, u32 idsSize, FS_MediaType mediaType, u32 idSize, bool shared, u8 *ids)
 Enumerates ext save data. More...
 
Result FSPXI_GetSpecialContentIndex (Handle serviceHandle, u16 *index, FS_MediaType mediaType, u64 programId, FS_SpecialContentType type)
 Gets a special content's index. More...
 
Result FSPXI_GetLegacyRomHeader (Handle serviceHandle, FS_MediaType mediaType, u64 programId, void *header)
 Gets the legacy ROM header of a program. More...
 
Result FSPXI_GetLegacyBannerData (Handle serviceHandle, FS_MediaType mediaType, u64 programId, void *banner, u8 unk)
 Gets the legacy banner data of a program. More...
 
Result FSPXI_FormatCardNorDevice (Handle serviceHandle, u32 unk)
 Formats the CARDNOR device. More...
 
Result FSPXI_DeleteSdmcRoot (Handle serviceHandle)
 Deletes the 3DS SDMC root.
 
Result FSPXI_DeleteAllExtSaveDataOnNand (Handle serviceHandle)
 Deletes all ext save data on the NAND.
 
Result FSPXI_InitializeCtrFilesystem (Handle serviceHandle)
 Initializes the CTR file system.
 
Result FSPXI_CreateSeed (Handle serviceHandle)
 Creates the FS seed.
 
Result FSPXI_GetSdmcCtrRootPath (Handle serviceHandle, u16 *out, u32 length)
 Gets the CTR SDMC root path. More...
 
Result FSPXI_GetArchiveResource (Handle serviceHandle, FS_ArchiveResource *archiveResource, FS_SystemMediaType mediaType)
 Gets an archive's resource information. More...
 
Result FSPXI_ExportIntegrityVerificationSeed (Handle serviceHandle, FS_IntegrityVerificationSeed *seed)
 Exports the integrity verification seed. More...
 
Result FSPXI_ImportIntegrityVerificationSeed (Handle serviceHandle, const FS_IntegrityVerificationSeed *seed)
 Imports an integrity verification seed. More...
 
Result FSPXI_GetLegacySubBannerData (Handle serviceHandle, u32 bannerSize, FS_MediaType mediaType, u64 programId, void *banner)
 Gets the legacy sub banner data of a program. More...
 
Result FSPXI_GenerateRandomBytes (Handle serviceHandle, void *buffer, u32 size)
 Generates random bytes. More...
 
Result FSPXI_GetFileLastModified (Handle serviceHandle, FSPXI_Archive archive, u64 *out, const u16 *path, u32 size)
 Gets the last modified time of a file in an archive. More...
 
Result FSPXI_ReadSpecialFile (Handle serviceHandle, u32 *bytesRead, u64 fileOffset, u32 size, void *data)
 Reads from a special file. More...
 
Result FSPXI_GetSpecialFileSize (Handle serviceHandle, u64 *fileSize)
 Gets the size of a special file. More...
 
Result FSPXI_StartDeviceMoveAsSource (Handle serviceHandle, FS_DeviceMoveContext *context)
 Initiates a device move as the source device. More...
 
Result FSPXI_StartDeviceMoveAsDestination (Handle serviceHandle, FS_DeviceMoveContext context, bool clear)
 Initiates a device move as the destination device. More...
 
Result FSPXI_ReadFileSHA256 (Handle serviceHandle, FSPXI_File file, u32 *bytesRead, u64 offset, void *readBuffer, u32 readBufferSize, void *hashtable, u32 hashtableSize, u32 unk)
 Reads data and stores SHA256 hashes of blocks. More...
 
Result FSPXI_WriteFileSHA256 (Handle serviceHandle, FSPXI_File file, u32 *bytesWritten, u64 offset, const void *writeBuffer, u32 writeBufferSize, void *hashtable, u32 hashtableSize, u32 unk1, u32 unk2)
 Assumedly writes data and stores SHA256 hashes of blocks. More...
 
Result FSPXI_SetCtrCardLatencyParameter (Handle serviceHandle, u64 latency)
 Configures CTRCARD latency emulation. More...
 
Result FSPXI_SetPriority (Handle serviceHandle, u32 priority)
 Sets the file system priority. More...
 
Result FSPXI_SwitchCleanupInvalidSaveData (Handle serviceHandle, bool enable)
 Toggles cleaning up invalid save data. More...
 
Result FSPXI_EnumerateSystemSaveData (Handle serviceHandle, u32 *idsWritten, u32 idsSize, u32 *ids)
 Enumerates system save data. More...
 
Result FSPXI_ReadNandReport (Handle serviceHandle, void *buffer, u32 size, u32 unk)
 Reads the NAND report. More...
 
Result FSPXI_Unknown0x56 (Handle serviceHandle, u32 out[4], FS_Archive archive, FS_Path path)
 Unknown command 0x56. More...
 

Detailed Description

Service interface for PxiFS services.

This is normally not accessible to userland apps. https://3dbrew.org/wiki/Filesystem_services_PXI

Function Documentation

◆ FSPXI_CalcSavegameMAC()

Result FSPXI_CalcSavegameMAC ( Handle  serviceHandle,
FSPXI_File  file,
const void *  inBuffer,
u32  inSize,
void *  outBuffer,
u32  outSize 
)

Calculates the MAC used in a DISA/DIFF header?

Parameters
fileUnsure
inBuffer0x100-byte DISA/DIFF input buffer.
inSizeSize of inBuffer.
outBufferBuffer to write MAC to.
outSizeSize of outBuffer.

◆ FSPXI_CalculateFileHashSHA256()

Result FSPXI_CalculateFileHashSHA256 ( Handle  serviceHandle,
FSPXI_File  file,
void *  buffer,
u32  size 
)

Calculate SHA256 of a file.

Parameters
fileFile to calculate the hash of.
bufferBuffer to output the hash to.
sizeSize of the buffer.

◆ FSPXI_CardNorDirectCommand()

Result FSPXI_CardNorDirectCommand ( Handle  serviceHandle,
u8  commandId 
)

Executes a CARDNOR direct command.

Parameters
commandIdID of the command.

◆ FSPXI_CardNorDirectCommandWithAddress()

Result FSPXI_CardNorDirectCommandWithAddress ( Handle  serviceHandle,
u8  commandId,
u32  address 
)

Executes a CARDNOR direct command with an address.

Parameters
commandIdID of the command.
addressAddress to provide.

◆ FSPXI_CardNorDirectCpuWriteWithoutVerify()

Result FSPXI_CardNorDirectCpuWriteWithoutVerify ( Handle  serviceHandle,
u32  address,
u32  size,
const void *  input 
)

Executes a CARDNOR direct CPU write without verify.

Parameters
addressAddress to provide.
sizeSize of the input buffer.
outputInput buffer.

◆ FSPXI_CardNorDirectRead()

Result FSPXI_CardNorDirectRead ( Handle  serviceHandle,
u8  commandId,
u32  size,
void *  output 
)

Executes a CARDNOR direct read.

Parameters
commandIdID of the command.
sizeSize of the output buffer.
outputOutput buffer.

◆ FSPXI_CardNorDirectRead_4xIO()

Result FSPXI_CardNorDirectRead_4xIO ( Handle  serviceHandle,
u8  commandId,
u32  address,
u32  size,
void *  output 
)

Executes a CARDNOR 4xIO direct read.

Parameters
commandIdID of the command.
addressAddress to provide.
sizeSize of the output buffer.
outputOutput buffer.

◆ FSPXI_CardNorDirectReadWithAddress()

Result FSPXI_CardNorDirectReadWithAddress ( Handle  serviceHandle,
u8  commandId,
u32  address,
u32  size,
void *  output 
)

Executes a CARDNOR direct read with an address.

Parameters
commandIdID of the command.
addressAddress to provide.
sizeSize of the output buffer.
outputOutput buffer.

◆ FSPXI_CardNorDirectSectorEraseWithoutVerify()

Result FSPXI_CardNorDirectSectorEraseWithoutVerify ( Handle  serviceHandle,
u32  address 
)

Executes a CARDNOR direct sector erase without verify.

Parameters
addressAddress to provide.

◆ FSPXI_CardNorDirectWrite()

Result FSPXI_CardNorDirectWrite ( Handle  serviceHandle,
u8  commandId,
u32  size,
const void *  input 
)

Executes a CARDNOR direct write.

Parameters
commandIdID of the command.
sizeSize of the input buffer.
outputInput buffer.
Remarks
Stubbed in latest firmware, since ?.?.?

◆ FSPXI_CardNorDirectWriteWithAddress()

Result FSPXI_CardNorDirectWriteWithAddress ( Handle  serviceHandle,
u8  commandId,
u32  address,
u32  size,
const void *  input 
)

Executes a CARDNOR direct write with an address.

Parameters
commandIdID of the command.
addressAddress to provide.
sizeSize of the input buffer.
inputInput buffer.

◆ FSPXI_CardSlotGetCardIFPowerStatus()

Result FSPXI_CardSlotGetCardIFPowerStatus ( Handle  serviceHandle,
bool *  status 
)

Gets the card's power status.

Parameters
statusPointer to output the power status to.

◆ FSPXI_CardSlotIsInserted()

Result FSPXI_CardSlotIsInserted ( Handle  serviceHandle,
bool *  inserted 
)

Gets whether a card is inserted.

Parameters
insertedPointer to output the insertion status to.

◆ FSPXI_CardSlotPowerOff()

Result FSPXI_CardSlotPowerOff ( Handle  serviceHandle,
bool *  status 
)

Powers off the card slot.

Parameters
statusPointer to output the power status to.

◆ FSPXI_CardSlotPowerOn()

Result FSPXI_CardSlotPowerOn ( Handle  serviceHandle,
bool *  status 
)

Powers on the card slot.

Parameters
statusPointer to output the power status to.

◆ FSPXI_CloseArchive()

Result FSPXI_CloseArchive ( Handle  serviceHandle,
FSPXI_Archive  archive 
)

Close an archive.

Parameters
archiveArchive to close.

◆ FSPXI_CloseDirectory()

Result FSPXI_CloseDirectory ( Handle  serviceHandle,
FSPXI_Directory  directory 
)

Close a directory.

Parameters
directoryDirectory to close.

◆ FSPXI_CloseFile()

Result FSPXI_CloseFile ( Handle  serviceHandle,
FSPXI_File  file 
)

Close a file.

Parameters
fileFile to close

◆ FSPXI_CommitSaveData()

Result FSPXI_CommitSaveData ( Handle  serviceHandle,
FSPXI_Archive  archive,
u32  id 
)

Commits an archive's save data.

Parameters
archiveArchive to commit.
idArchive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D
Remarks
Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command.

◆ FSPXI_CreateDirectory()

Result FSPXI_CreateDirectory ( Handle  serviceHandle,
FSPXI_Archive  archive,
FS_Path  path,
u32  attributes 
)

Creates a directory.

Parameters
archiveArchive to create the directory in.
pathPath of the directory.
attributesAttributes of the directory.

◆ FSPXI_CreateExtSaveData()

Result FSPXI_CreateExtSaveData ( Handle  serviceHandle,
FS_ExtSaveDataInfo  info 
)

Creates ext save data.

Parameters
infoInfo of the save data.

◆ FSPXI_CreateFile()

Result FSPXI_CreateFile ( Handle  serviceHandle,
FSPXI_Archive  archive,
FS_Path  path,
u32  attributes,
u64  fileSize 
)

Creates a file.

Parameters
archiveArchive to create the file in.
pathPath of the file.
attributesAttributes of the file.
sizeSize of the file.

◆ FSPXI_DeleteDirectory()

Result FSPXI_DeleteDirectory ( Handle  serviceHandle,
FSPXI_Archive  archive,
FS_Path  path 
)

Deletes a directory.

Parameters
archiveArchive containing the directory.
pathPath of the directory.

◆ FSPXI_DeleteExtSaveData()

Result FSPXI_DeleteExtSaveData ( Handle  serviceHandle,
FS_ExtSaveDataInfo  info 
)

Deletes ext save data.

Parameters
infoInfo of the save data.

◆ FSPXI_DeleteFile()

Result FSPXI_DeleteFile ( Handle  serviceHandle,
FSPXI_Archive  archive,
FS_Path  path 
)

Deletes a file.

Parameters
archiveArchive containing the file.
pathPath of the file.

◆ FSPXI_EnumerateExtSaveData()

Result FSPXI_EnumerateExtSaveData ( Handle  serviceHandle,
u32 idsWritten,
u32  idsSize,
FS_MediaType  mediaType,
u32  idSize,
bool  shared,
u8 ids 
)

Enumerates ext save data.

Parameters
idsWrittenPointer to output the number of IDs written to.
idsSizeSize of the IDs buffer.
mediaTypeMedia type to enumerate over.
idSizeSize of each ID element.
sharedWhether to enumerate shared ext save data.
idsPointer to output IDs to.

◆ FSPXI_EnumerateSystemSaveData()

Result FSPXI_EnumerateSystemSaveData ( Handle  serviceHandle,
u32 idsWritten,
u32  idsSize,
u32 ids 
)

Enumerates system save data.

Parameters
idsWrittenPointer to output the number of IDs written to.
idsSizeSize of the IDs buffer.
idsPointer to output IDs to.

◆ FSPXI_ExportIntegrityVerificationSeed()

Result FSPXI_ExportIntegrityVerificationSeed ( Handle  serviceHandle,
FS_IntegrityVerificationSeed seed 
)

Exports the integrity verification seed.

Parameters
seedPointer to output the seed to.

◆ FSPXI_FormatCardNorDevice()

Result FSPXI_FormatCardNorDevice ( Handle  serviceHandle,
u32  unk 
)

Formats the CARDNOR device.

Parameters
unkUnknown. Transaction?

◆ FSPXI_GenerateRandomBytes()

Result FSPXI_GenerateRandomBytes ( Handle  serviceHandle,
void *  buffer,
u32  size 
)

Generates random bytes.

Uses same code as PSPXI_GenerateRandomBytes

Parameters
bufBuffer to output random bytes to.
sizeSize of buffer.

◆ FSPXI_GetArchiveResource()

Result FSPXI_GetArchiveResource ( Handle  serviceHandle,
FS_ArchiveResource archiveResource,
FS_SystemMediaType  mediaType 
)

Gets an archive's resource information.

Parameters
archiveResourcePointer to output the archive resource information to.
mediaTypeSystem media type to check.

◆ FSPXI_GetCardType()

Result FSPXI_GetCardType ( Handle  serviceHandle,
FS_CardType out 
)

Gets the inserted card type.

Parameters
outPointer to output the card type to.

◆ FSPXI_GetFileLastModified()

Result FSPXI_GetFileLastModified ( Handle  serviceHandle,
FSPXI_Archive  archive,
u64 out,
const u16 path,
u32  size 
)

Gets the last modified time of a file in an archive.

Parameters
archiveThe archive that contains the file.
outThe pointer to write the timestamp to.
pathThe UTF-16 path of the file.
sizeThe size of the path.

◆ FSPXI_GetFileSize()

Result FSPXI_GetFileSize ( Handle  serviceHandle,
FSPXI_File  file,
u64 size 
)

Get size of a file.

Parameters
fileFile to get the size of.
sizePointer to output size to.

◆ FSPXI_GetLegacyBannerData()

Result FSPXI_GetLegacyBannerData ( Handle  serviceHandle,
FS_MediaType  mediaType,
u64  programId,
void *  banner,
u8  unk 
)

Gets the legacy banner data of a program.

Parameters
mediaTypeMedia type of the program.
programIdID of the program.
bannerPointer to output the legacy banner data to. (size = 0x23C0)
unkUnknown. Always 1?

◆ FSPXI_GetLegacyRomHeader()

Result FSPXI_GetLegacyRomHeader ( Handle  serviceHandle,
FS_MediaType  mediaType,
u64  programId,
void *  header 
)

Gets the legacy ROM header of a program.

Parameters
mediaTypeMedia type of the program.
programIdID of the program.
headerPointer to output the legacy ROM header to. (size = 0x3B4)

◆ FSPXI_GetLegacySubBannerData()

Result FSPXI_GetLegacySubBannerData ( Handle  serviceHandle,
u32  bannerSize,
FS_MediaType  mediaType,
u64  programId,
void *  banner 
)

Gets the legacy sub banner data of a program.

Parameters
bannerSizeSize of the banner.
mediaTypeMedia type of the program.
programIdID of the program.
headerPointer to output the legacy sub banner data to.

◆ FSPXI_GetNandArchiveResource()

Result FSPXI_GetNandArchiveResource ( Handle  serviceHandle,
FS_ArchiveResource out 
)

Gets the NAND archive resource information.

Parameters
outPointer to output the archive resource information to.

◆ FSPXI_GetNandCid()

Result FSPXI_GetNandCid ( Handle  serviceHandle,
void *  out,
u32  size 
)

Gets the NAND CID.

Parameters
outBuffer to output the CID to.
sizeSize of buffer.

◆ FSPXI_GetNandLog()

Result FSPXI_GetNandLog ( Handle  serviceHandle,
void *  out,
u32  size 
)

Gets the NAND log.

Parameters
outBuffer to output the log to.
sizeSize of buffer.

◆ FSPXI_GetNandSpeedInfo()

Result FSPXI_GetNandSpeedInfo ( Handle  serviceHandle,
FS_SdMmcSpeedInfo out 
)

Gets the NAND speed info.

Parameters
outBuffer to output the speed info to.

◆ FSPXI_GetProductInfo()

Result FSPXI_GetProductInfo ( Handle  serviceHandle,
FS_ProductInfo info,
FSPXI_Archive  archive 
)

Gets an NCCH's product info.

Parameters
infoPointer to output the product info to.
archiveOpen NCCH content archive

◆ FSPXI_GetSdmcArchiveResource()

Result FSPXI_GetSdmcArchiveResource ( Handle  serviceHandle,
FS_ArchiveResource out 
)

Gets the SDMC archive resource information.

Parameters
outPointer to output the archive resource information to.

◆ FSPXI_GetSdmcCid()

Result FSPXI_GetSdmcCid ( Handle  serviceHandle,
void *  out,
u32  size 
)

Gets the SDMC CID.

Parameters
outBuffer to output the CID to.
sizeSize of buffer.

◆ FSPXI_GetSdmcCtrRootPath()

Result FSPXI_GetSdmcCtrRootPath ( Handle  serviceHandle,
u16 out,
u32  length 
)

Gets the CTR SDMC root path.

Parameters
outPointer to output the root path to.
lengthLength of the output buffer in bytes.

◆ FSPXI_GetSdmcFatFsError()

Result FSPXI_GetSdmcFatFsError ( Handle  serviceHandle,
u32 out 
)

Gets the error code from the SDMC FatFS driver.

Parameters
outPointer to output the error code to

◆ FSPXI_GetSdmcLog()

Result FSPXI_GetSdmcLog ( Handle  serviceHandle,
void *  out,
u32  size 
)

Gets the SDMC log.

Parameters
outBuffer to output the log to.
sizeSize of buffer.

◆ FSPXI_GetSdmcSpeedInfo()

Result FSPXI_GetSdmcSpeedInfo ( Handle  serviceHandle,
FS_SdMmcSpeedInfo out 
)

Gets the SDMC speed info.

Parameters
outBuffer to output the speed info to.

◆ FSPXI_GetSpecialContentIndex()

Result FSPXI_GetSpecialContentIndex ( Handle  serviceHandle,
u16 index,
FS_MediaType  mediaType,
u64  programId,
FS_SpecialContentType  type 
)

Gets a special content's index.

Parameters
indexPointer to output the index to.
mediaTypeMedia type of the special content.
programIdProgram ID owning the special content.
typeType of special content.

◆ FSPXI_GetSpecialFileSize()

Result FSPXI_GetSpecialFileSize ( Handle  serviceHandle,
u64 fileSize 
)

Gets the size of a special file.

Parameters
fileSizePointer to output the size to.

◆ FSPXI_HasDirectory()

Result FSPXI_HasDirectory ( Handle  serviceHandle,
FSPXI_Archive  archive,
bool *  out,
FS_Path  path 
)

Checks if the archive contains a directory at path.

Parameters
archiveArchive to check.
outPointer to output existence to.
pathPath to check for directory

◆ FSPXI_HasFile()

Result FSPXI_HasFile ( Handle  serviceHandle,
FSPXI_Archive  archive,
bool *  out,
FS_Path  path 
)

Checks if the archive contains a file at path.

Parameters
archiveArchive to check.
outPointer to output existence to.
pathPath to check for file

◆ FSPXI_ImportIntegrityVerificationSeed()

Result FSPXI_ImportIntegrityVerificationSeed ( Handle  serviceHandle,
const FS_IntegrityVerificationSeed seed 
)

Imports an integrity verification seed.

Parameters
seedSeed to import.

◆ FSPXI_IsSdmcDetected()

Result FSPXI_IsSdmcDetected ( Handle  serviceHandle,
bool *  out 
)

Gets whether PXIFS0 detects the SD.

Parameters
outPointer to output the detection status to

◆ FSPXI_IsSdmcWritable()

Result FSPXI_IsSdmcWritable ( Handle  serviceHandle,
bool *  out 
)

Gets whether PXIFS0 can write to the SD.

Parameters
outPointer to output the writable status to

◆ FSPXI_OpenArchive()

Result FSPXI_OpenArchive ( Handle  serviceHandle,
FSPXI_Archive *  archive,
FS_ArchiveID  archiveID,
FS_Path  path 
)

Opens an archive.

Parameters
archivePointer to output the opened archive to.
idID of the archive.
pathPath of the archive.

◆ FSPXI_OpenDirectory()

Result FSPXI_OpenDirectory ( Handle  serviceHandle,
FSPXI_Directory *  out,
FSPXI_Archive  archive,
FS_Path  path 
)

Opens a directory.

Parameters
outPointer to output the directory handle to.
archiveArchive containing the directory.
pathPath of the directory.

◆ FSPXI_OpenFile()

Result FSPXI_OpenFile ( Handle  serviceHandle,
FSPXI_File *  out,
FSPXI_Archive  archive,
FS_Path  path,
u32  flags,
u32  attributes 
)

Opens a file.

Parameters
outPointer to output the file handle to.
archiveArchive containing the file.
pathPath of the file.
flagsFlags to open the file with.
attributesAttributes of the file.

◆ FSPXI_ReadDirectory()

Result FSPXI_ReadDirectory ( Handle  serviceHandle,
FSPXI_Directory  directory,
u32 entriesRead,
u32  entryCount,
FS_DirectoryEntry entries 
)

Reads one or more directory entries.

Parameters
directoryDirectory to read from.
entriesReadPointer to output the number of entries read to.
entryCountNumber of entries to read.
entryOutPointer to output directory entries to.

◆ FSPXI_ReadFile()

Result FSPXI_ReadFile ( Handle  serviceHandle,
FSPXI_File  file,
u32 bytesRead,
u64  offset,
void *  buffer,
u32  size 
)

Reads from a file.

Parameters
fileFile to read from.
bytesReadPointer to output the number of read bytes to.
offsetOffset to read from.
bufferBuffer to read to.
sizeSize of the buffer.

◆ FSPXI_ReadFileSHA256()

Result FSPXI_ReadFileSHA256 ( Handle  serviceHandle,
FSPXI_File  file,
u32 bytesRead,
u64  offset,
void *  readBuffer,
u32  readBufferSize,
void *  hashtable,
u32  hashtableSize,
u32  unk 
)

Reads data and stores SHA256 hashes of blocks.

Parameters
fileFile to read from.
bytesReadPointer to output the number of read bytes to.
offsetOffset to read from.
readBufferPointer to store read data in.
readBufferSizeSize of readBuffer.
hashtablePointer to store SHA256 hashes in.
hashtableSizeSize of hashtable.
unkUnknown. Always 0x00001000? Possibly block size?

◆ FSPXI_ReadNandReport()

Result FSPXI_ReadNandReport ( Handle  serviceHandle,
void *  buffer,
u32  size,
u32  unk 
)

Reads the NAND report.

Parameters
unkUnknown
bufferBuffer to write the report to.
sizeSize of buffer

◆ FSPXI_ReadSpecialFile()

Result FSPXI_ReadSpecialFile ( Handle  serviceHandle,
u32 bytesRead,
u64  fileOffset,
u32  size,
void *  data 
)

Reads from a special file.

Parameters
bytesReadPointer to output the number of bytes read to.
fileOffsetOffset of the file.
sizeSize of the buffer.
dataBuffer to read to.

◆ FSPXI_RenameDirectory()

Result FSPXI_RenameDirectory ( Handle  serviceHandle,
FSPXI_Archive  srcArchive,
FS_Path  srcPath,
FSPXI_Archive  dstArchive,
FS_Path  dstPath 
)

Renames a directory.

Parameters
srcArchiveArchive containing the source directory.
srcPathPath of the source directory.
dstArchiveArchive containing the destination directory.
dstPathPath of the destination directory.

◆ FSPXI_RenameFile()

Result FSPXI_RenameFile ( Handle  serviceHandle,
FSPXI_Archive  srcArchive,
FS_Path  srcPath,
FSPXI_Archive  dstArchive,
FS_Path  dstPath 
)

Renames a file.

Parameters
srcArchiveArchive containing the source file.
srcPathPath of the source file.
dstArchiveArchive containing the destination file.
dstPathPath of the destination file.

◆ FSPXI_SendInitializeInfoTo9()

Result FSPXI_SendInitializeInfoTo9 ( Handle  serviceHandle,
u8  unk 
)

Sends initialization info to ARM9.

Parameters
unkFS sends *(0x1FF81086)

◆ FSPXI_SetCardSpiBaudrate()

Result FSPXI_SetCardSpiBaudrate ( Handle  serviceHandle,
FS_CardSpiBaudRate  baudRate 
)

Sets the CARDSPI baud rate.

Parameters
baudRateBaud rate to set.

◆ FSPXI_SetCardSpiBusMode()

Result FSPXI_SetCardSpiBusMode ( Handle  serviceHandle,
FS_CardSpiBusMode  busMode 
)

Sets the CARDSPI bus mode.

Parameters
busModeBus mode to set.

◆ FSPXI_SetCtrCardLatencyParameter()

Result FSPXI_SetCtrCardLatencyParameter ( Handle  serviceHandle,
u64  latency 
)

Configures CTRCARD latency emulation.

Parameters
latencyLatency to apply.

◆ FSPXI_SetFileSize()

Result FSPXI_SetFileSize ( Handle  serviceHandle,
FSPXI_File  file,
u64  size 
)

Set size of a file.

Parameters
fileFile to set the size of
sizeSize to set the file to

◆ FSPXI_SetPriority()

Result FSPXI_SetPriority ( Handle  serviceHandle,
u32  priority 
)

Sets the file system priority.

Parameters
priorityPriority to set.

◆ FSPXI_StartDeviceMoveAsDestination()

Result FSPXI_StartDeviceMoveAsDestination ( Handle  serviceHandle,
FS_DeviceMoveContext  context,
bool  clear 
)

Initiates a device move as the destination device.

Parameters
contextContext to use.
clearWhether to clear the device's data first.

◆ FSPXI_StartDeviceMoveAsSource()

Result FSPXI_StartDeviceMoveAsSource ( Handle  serviceHandle,
FS_DeviceMoveContext context 
)

Initiates a device move as the source device.

Parameters
contextPointer to output the context to.

◆ FSPXI_SwitchCleanupInvalidSaveData()

Result FSPXI_SwitchCleanupInvalidSaveData ( Handle  serviceHandle,
bool  enable 
)

Toggles cleaning up invalid save data.

Parameters
enableWhether to enable cleaning up invalid save data.

◆ FSPXI_Unknown0x17()

Result FSPXI_Unknown0x17 ( Handle  serviceHandle,
FSPXI_Archive  archive,
bool *  out 
)

Unknown 0x17.

Appears to be an "is archive handle valid" command?

Parameters
archiveArchive handle to check validity of.
outPointer to output validity to.

◆ FSPXI_Unknown0x56()

Result FSPXI_Unknown0x56 ( Handle  serviceHandle,
u32  out[4],
FS_Archive  archive,
FS_Path  path 
)

Unknown command 0x56.

Remarks
Called by FSUSER_ControlArchive with ArchiveAction 0x789D

◆ FSPXI_WriteFile()

Result FSPXI_WriteFile ( Handle  serviceHandle,
FSPXI_File  file,
u32 bytesWritten,
u64  offset,
const void *  buffer,
u32  size,
u32  flags 
)

Writes to a file.

Parameters
fileFile to write to.
bytesWrittenPointer to output the number of bytes written to.
offsetOffset to write to.
bufferBuffer to write from.
sizeSize of the buffer.
flagsFlags to use when writing.

◆ FSPXI_WriteFileSHA256()

Result FSPXI_WriteFileSHA256 ( Handle  serviceHandle,
FSPXI_File  file,
u32 bytesWritten,
u64  offset,
const void *  writeBuffer,
u32  writeBufferSize,
void *  hashtable,
u32  hashtableSize,
u32  unk1,
u32  unk2 
)

Assumedly writes data and stores SHA256 hashes of blocks.

Parameters
fileFile to write to.
bytesWrittenPointer to output the number of written bytes to.
offsetOffset to write to.
writeBufferBuffer to write from.
writeBufferSizeSize of writeBuffer.
hashtablePointer to store SHA256 hashes in.
hashtableSizeSize of hashtable
unk1Unknown. Might match with ReadFileSHA256's unknown?
unk2Unknown. Might match with ReadFileSHA256's unknown?