fspxi.h
Go to the documentation of this file.
/**
* @file fspxi.h
* @brief Service interface for PxiFS services. This is normally not accessible to userland apps. https://3dbrew.org/wiki/Filesystem_services_PXI
*/
#pragma once
#include <3ds/services/fs.h>
#include <3ds/types.h>
typedef u64 FSPXI_Archive;
typedef u64 FSPXI_File;
typedef u64 FSPXI_Directory;
/**
* @brief Opens a file.
* @param out Pointer to output the file handle to.
* @param archive Archive containing the file.
* @param path Path of the file.
* @param flags Flags to open the file with.
* @param attributes Attributes of the file.
*/
Result FSPXI_OpenFile(Handle serviceHandle, FSPXI_File* out, FSPXI_Archive archive, FS_Path path, u32 flags, u32 attributes);
/**
* @brief Deletes a file.
* @param archive Archive containing the file.
* @param path Path of the file.
*/
Result FSPXI_DeleteFile(Handle serviceHandle, FSPXI_Archive archive, FS_Path path);
/**
* @brief Renames a file.
* @param srcArchive Archive containing the source file.
* @param srcPath Path of the source file.
* @param dstArchive Archive containing the destination file.
* @param dstPath Path of the destination file.
*/
Result FSPXI_RenameFile(Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath);
/**
* @brief Deletes a directory.
* @param archive Archive containing the directory.
* @param path Path of the directory.
*/
Result FSPXI_DeleteDirectory(Handle serviceHandle, FSPXI_Archive archive, FS_Path path);
/**
* @brief Creates a file.
* @param archive Archive to create the file in.
* @param path Path of the file.
* @param attributes Attributes of the file.
* @param size Size of the file.
*/
Result FSPXI_CreateFile(Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes, u64 fileSize);
/**
* @brief Creates a directory.
* @param archive Archive to create the directory in.
* @param path Path of the directory.
* @param attributes Attributes of the directory.
*/
Result FSPXI_CreateDirectory(Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes);
/**
* @brief Renames a directory.
* @param srcArchive Archive containing the source directory.
* @param srcPath Path of the source directory.
* @param dstArchive Archive containing the destination directory.
* @param dstPath Path of the destination directory.
*/
Result FSPXI_RenameDirectory(Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath);
/**
* @brief Opens a directory.
* @param out Pointer to output the directory handle to.
* @param archive Archive containing the directory.
* @param path Path of the directory.
*/
Result FSPXI_OpenDirectory(Handle serviceHandle, FSPXI_Directory* out, FSPXI_Archive archive, FS_Path path);
/**
* @brief Reads from a file.
* @param file File to read from.
* @param bytesRead Pointer to output the number of read bytes to.
* @param offset Offset to read from.
* @param buffer Buffer to read to.
* @param size Size of the buffer.
*/
Result FSPXI_ReadFile(Handle serviceHandle, FSPXI_File file, u32* bytesRead, u64 offset, void* buffer, u32 size);
/**
* @brief Calculate SHA256 of a file.
* @param file File to calculate the hash of.
* @param buffer Buffer to output the hash to.
* @param size Size of the buffer.
*/
Result FSPXI_CalculateFileHashSHA256(Handle serviceHandle, FSPXI_File file, void* buffer, u32 size);
/**
* @brief Writes to a file.
* @param file File to write to.
* @param bytesWritten Pointer to output the number of bytes written to.
* @param offset Offset to write to.
* @param buffer Buffer to write from.
* @param size Size of the buffer.
* @param flags Flags to use when writing.
*/
Result FSPXI_WriteFile(Handle serviceHandle, FSPXI_File file, u32* bytesWritten, u64 offset, const void* buffer, u32 size, u32 flags);
/**
* @brief Calculates the MAC used in a DISA/DIFF header?
* @param file Unsure
* @param inBuffer 0x100-byte DISA/DIFF input buffer.
* @param inSize Size of inBuffer.
* @param outBuffer Buffer to write MAC to.
* @param outSize Size of outBuffer.
*/
Result FSPXI_CalcSavegameMAC(Handle serviceHandle, FSPXI_File file, const void* inBuffer, u32 inSize, void* outBuffer, u32 outSize);
/**
* @brief Get size of a file
* @param file File to get the size of.
* @param size Pointer to output size to.
*/
Result FSPXI_GetFileSize(Handle serviceHandle, FSPXI_File file, u64* size);
/**
* @brief Set size of a file
* @param file File to set the size of
* @param size Size to set the file to
*/
Result FSPXI_SetFileSize(Handle serviceHandle, FSPXI_File file, u64 size);
/**
* @brief Close a file
* @param file File to close
*/
Result FSPXI_CloseFile(Handle serviceHandle, FSPXI_File file);
/**
* @brief Reads one or more directory entries.
* @param directory Directory to read from.
* @param entriesRead Pointer to output the number of entries read to.
* @param entryCount Number of entries to read.
* @param entryOut Pointer to output directory entries to.
*/
Result FSPXI_ReadDirectory(Handle serviceHandle, FSPXI_Directory directory, u32* entriesRead, u32 entryCount, FS_DirectoryEntry* entries);
/**
* @brief Close a directory
* @param directory Directory to close.
*/
Result FSPXI_CloseDirectory(Handle serviceHandle, FSPXI_Directory directory);
/**
* @brief Opens an archive.
* @param archive Pointer to output the opened archive to.
* @param id ID of the archive.
* @param path Path of the archive.
*/
Result FSPXI_OpenArchive(Handle serviceHandle, FSPXI_Archive* archive, FS_ArchiveID archiveID, FS_Path path);
/**
* @brief Checks if the archive contains a file at path.
* @param archive Archive to check.
* @param out Pointer to output existence to.
* @param path Path to check for file
*/
Result FSPXI_HasFile(Handle serviceHandle, FSPXI_Archive archive, bool* out, FS_Path path);
/**
* @brief Checks if the archive contains a directory at path.
* @param archive Archive to check.
* @param out Pointer to output existence to.
* @param path Path to check for directory
*/
Result FSPXI_HasDirectory(Handle serviceHandle, FSPXI_Archive archive, bool* out, FS_Path path);
/**
* @brief Commits an archive's save data.
* @param archive Archive to commit.
* @param id Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D
* @remark 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.
*/
Result FSPXI_CommitSaveData(Handle serviceHandle, FSPXI_Archive archive, u32 id);
/**
* @brief Close an archive
* @param archive Archive to close.
*/
Result FSPXI_CloseArchive(Handle serviceHandle, FSPXI_Archive archive);
/**
* @brief Unknown 0x17. Appears to be an "is archive handle valid" command?
* @param archive Archive handle to check validity of.
* @param out Pointer to output validity to.
*/
Result FSPXI_Unknown0x17(Handle serviceHandle, FSPXI_Archive archive, bool* out);
/**
* @brief Gets the inserted card type.
* @param out Pointer to output the card type to.
*/
Result FSPXI_GetCardType(Handle serviceHandle, FS_CardType* out);
/**
* @brief Gets the SDMC archive resource information.
* @param out Pointer to output the archive resource information to.
*/
Result FSPXI_GetSdmcArchiveResource(Handle serviceHandle, FS_ArchiveResource* out);
/**
* @brief Gets the NAND archive resource information.
* @param out Pointer to output the archive resource information to.
*/
Result FSPXI_GetNandArchiveResource(Handle serviceHandle, FS_ArchiveResource* out);
/**
* @brief Gets the error code from the SDMC FatFS driver
* @param out Pointer to output the error code to
*/
Result FSPXI_GetSdmcFatFsError(Handle serviceHandle, u32* out);
/**
* @brief Gets whether PXIFS0 detects the SD
* @param out Pointer to output the detection status to
*/
Result FSPXI_IsSdmcDetected(Handle serviceHandle, bool* out);
/**
* @brief Gets whether PXIFS0 can write to the SD
* @param out Pointer to output the writable status to
*/
Result FSPXI_IsSdmcWritable(Handle serviceHandle, bool* out);
/**
* @brief Gets the SDMC CID
* @param out Buffer to output the CID to.
* @param size Size of buffer.
*/
Result FSPXI_GetSdmcCid(Handle serviceHandle, void* out, u32 size);
/**
* @brief Gets the NAND CID
* @param out Buffer to output the CID to.
* @param size Size of buffer.
*/
Result FSPXI_GetNandCid(Handle serviceHandle, void* out, u32 size);
/**
* @brief Gets the SDMC speed info
* @param out Buffer to output the speed info to.
*/
Result FSPXI_GetSdmcSpeedInfo(Handle serviceHandle, FS_SdMmcSpeedInfo* out);
/**
* @brief Gets the NAND speed info
* @param out Buffer to output the speed info to.
*/
Result FSPXI_GetNandSpeedInfo(Handle serviceHandle, FS_SdMmcSpeedInfo* out);
/**
* @brief Gets the SDMC log
* @param out Buffer to output the log to.
* @param size Size of buffer.
*/
Result FSPXI_GetSdmcLog(Handle serviceHandle, void* out, u32 size);
/**
* @brief Gets the NAND log
* @param out Buffer to output the log to.
* @param size Size of buffer.
*/
Result FSPXI_GetNandLog(Handle serviceHandle, void* out, u32 size);
/// Clears the SDMC log
Result FSPXI_ClearSdmcLog(Handle serviceHandle);
/// Clears the NAND log
Result FSPXI_ClearNandLog(Handle serviceHandle);
/**
* @brief Gets whether a card is inserted.
* @param inserted Pointer to output the insertion status to.
*/
Result FSPXI_CardSlotIsInserted(Handle serviceHandle, bool* inserted);
/**
* @brief Powers on the card slot.
* @param status Pointer to output the power status to.
*/
Result FSPXI_CardSlotPowerOn(Handle serviceHandle, bool* status);
/**
* @brief Powers off the card slot.
* @param status Pointer to output the power status to.
*/
Result FSPXI_CardSlotPowerOff(Handle serviceHandle, bool* status);
/**
* @brief Gets the card's power status.
* @param status Pointer to output the power status to.
*/
Result FSPXI_CardSlotGetCardIFPowerStatus(Handle serviceHandle, bool* status);
/**
* @brief Executes a CARDNOR direct command.
* @param commandId ID of the command.
*/
Result FSPXI_CardNorDirectCommand(Handle serviceHandle, u8 commandId);
/**
* @brief Executes a CARDNOR direct command with an address.
* @param commandId ID of the command.
* @param address Address to provide.
*/
Result FSPXI_CardNorDirectCommandWithAddress(Handle serviceHandle, u8 commandId, u32 address);
/**
* @brief Executes a CARDNOR direct read.
* @param commandId ID of the command.
* @param size Size of the output buffer.
* @param output Output buffer.
*/
Result FSPXI_CardNorDirectRead(Handle serviceHandle, u8 commandId, u32 size, void* output);
/**
* @brief Executes a CARDNOR direct read with an address.
* @param commandId ID of the command.
* @param address Address to provide.
* @param size Size of the output buffer.
* @param output Output buffer.
*/
Result FSPXI_CardNorDirectReadWithAddress(Handle serviceHandle, u8 commandId, u32 address, u32 size, void* output);
/**
* @brief Executes a CARDNOR direct write.
* @param commandId ID of the command.
* @param size Size of the input buffer.
* @param output Input buffer.
* @remark Stubbed in latest firmware, since ?.?.?
*/
Result FSPXI_CardNorDirectWrite(Handle serviceHandle, u8 commandId, u32 size, const void* input);
/**
* @brief Executes a CARDNOR direct write with an address.
* @param commandId ID of the command.
* @param address Address to provide.
* @param size Size of the input buffer.
* @param input Input buffer.
*/
Result FSPXI_CardNorDirectWriteWithAddress(Handle serviceHandle, u8 commandId, u32 address, u32 size, const void* input);
/**
* @brief Executes a CARDNOR 4xIO direct read.
* @param commandId ID of the command.
* @param address Address to provide.
* @param size Size of the output buffer.
* @param output Output buffer.
*/
Result FSPXI_CardNorDirectRead_4xIO(Handle serviceHandle, u8 commandId, u32 address, u32 size, void* output);
/**
* @brief Executes a CARDNOR direct CPU write without verify.
* @param address Address to provide.
* @param size Size of the input buffer.
* @param output Input buffer.
*/
Result FSPXI_CardNorDirectCpuWriteWithoutVerify(Handle serviceHandle, u32 address, u32 size, const void* input);
/**
* @brief Executes a CARDNOR direct sector erase without verify.
* @param address Address to provide.
*/
Result FSPXI_CardNorDirectSectorEraseWithoutVerify(Handle serviceHandle, u32 address);
/**
* @brief Gets an NCCH's product info
* @param info Pointer to output the product info to.
* @param archive Open NCCH content archive
*/
Result FSPXI_GetProductInfo(Handle serviceHandle, FS_ProductInfo* info, FSPXI_Archive archive);
/**
* @brief Sets the CARDSPI baud rate.
* @param baudRate Baud rate to set.
*/
Result FSPXI_SetCardSpiBaudrate(Handle serviceHandle, FS_CardSpiBaudRate baudRate);
/**
* @brief Sets the CARDSPI bus mode.
* @param busMode Bus mode to set.
*/
Result FSPXI_SetCardSpiBusMode(Handle serviceHandle, FS_CardSpiBusMode busMode);
/**
* @brief Sends initialization info to ARM9
* @param unk FS sends *(0x1FF81086)
*/
Result FSPXI_SendInitializeInfoTo9(Handle serviceHandle, u8 unk);
/**
* @brief Creates ext save data.
* @param info Info of the save data.
*/
Result FSPXI_CreateExtSaveData(Handle serviceHandle, FS_ExtSaveDataInfo info);
/**
* @brief Deletes ext save data.
* @param info Info of the save data.
*/
Result FSPXI_DeleteExtSaveData(Handle serviceHandle, FS_ExtSaveDataInfo info);
/**
* @brief Enumerates ext save data.
* @param idsWritten Pointer to output the number of IDs written to.
* @param idsSize Size of the IDs buffer.
* @param mediaType Media type to enumerate over.
* @param idSize Size of each ID element.
* @param shared Whether to enumerate shared ext save data.
* @param ids Pointer to output IDs to.
*/
Result FSPXI_EnumerateExtSaveData(Handle serviceHandle, u32* idsWritten, u32 idsSize, FS_MediaType mediaType, u32 idSize, bool shared, u8* ids);
/**
* @brief Gets a special content's index.
* @param index Pointer to output the index to.
* @param mediaType Media type of the special content.
* @param programId Program ID owning the special content.
* @param type Type of special content.
*/
Result FSPXI_GetSpecialContentIndex(Handle serviceHandle, u16* index, FS_MediaType mediaType, u64 programId, FS_SpecialContentType type);
/**
* @brief Gets the legacy ROM header of a program.
* @param mediaType Media type of the program.
* @param programId ID of the program.
* @param header Pointer to output the legacy ROM header to. (size = 0x3B4)
*/
Result FSPXI_GetLegacyRomHeader(Handle serviceHandle, FS_MediaType mediaType, u64 programId, void* header);
/**
* @brief Gets the legacy banner data of a program.
* @param mediaType Media type of the program.
* @param programId ID of the program.
* @param banner Pointer to output the legacy banner data to. (size = 0x23C0)
* @param unk Unknown. Always 1?
*/
Result FSPXI_GetLegacyBannerData(Handle serviceHandle, FS_MediaType mediaType, u64 programId, void* banner, u8 unk);
/**
* @brief Formats the CARDNOR device.
* @param unk Unknown. Transaction?
*/
Result FSPXI_FormatCardNorDevice(Handle serviceHandle, u32 unk);
/// Deletes the 3DS SDMC root.
Result FSPXI_DeleteSdmcRoot(Handle serviceHandle);
/// Deletes all ext save data on the NAND.
Result FSPXI_DeleteAllExtSaveDataOnNand(Handle serviceHandle);
/// Initializes the CTR file system.
Result FSPXI_InitializeCtrFilesystem(Handle serviceHandle);
/// Creates the FS seed.
Result FSPXI_CreateSeed(Handle serviceHandle);
/**
* @brief Gets the CTR SDMC root path.
* @param out Pointer to output the root path to.
* @param length Length of the output buffer in bytes.
*/
Result FSPXI_GetSdmcCtrRootPath(Handle serviceHandle, u16* out, u32 length);
/**
* @brief Gets an archive's resource information.
* @param archiveResource Pointer to output the archive resource information to.
* @param mediaType System media type to check.
*/
Result FSPXI_GetArchiveResource(Handle serviceHandle, FS_ArchiveResource* archiveResource, FS_SystemMediaType mediaType);
/**
* @brief Exports the integrity verification seed.
* @param seed Pointer to output the seed to.
*/
Result FSPXI_ExportIntegrityVerificationSeed(Handle serviceHandle, FS_IntegrityVerificationSeed* seed);
/**
* @brief Imports an integrity verification seed.
* @param seed Seed to import.
*/
Result FSPXI_ImportIntegrityVerificationSeed(Handle serviceHandle, const FS_IntegrityVerificationSeed* seed);
/**
* @brief Gets the legacy sub banner data of a program.
* @param bannerSize Size of the banner.
* @param mediaType Media type of the program.
* @param programId ID of the program.
* @param header Pointer to output the legacy sub banner data to.
*/
Result FSPXI_GetLegacySubBannerData(Handle serviceHandle, u32 bannerSize, FS_MediaType mediaType, u64 programId, void* banner);
/**
* @brief Generates random bytes. Uses same code as PSPXI_GenerateRandomBytes
* @param buf Buffer to output random bytes to.
* @param size Size of buffer.
*/
Result FSPXI_GenerateRandomBytes(Handle serviceHandle, void* buffer, u32 size);
/**
* @brief Gets the last modified time of a file in an archive.
* @param archive The archive that contains the file.
* @param out The pointer to write the timestamp to.
* @param path The UTF-16 path of the file.
* @param size The size of the path.
*/
Result FSPXI_GetFileLastModified(Handle serviceHandle, FSPXI_Archive archive, u64* out, const u16* path, u32 size);
/**
* @brief Reads from a special file.
* @param bytesRead Pointer to output the number of bytes read to.
* @param fileOffset Offset of the file.
* @param size Size of the buffer.
* @param data Buffer to read to.
*/
Result FSPXI_ReadSpecialFile(Handle serviceHandle, u32* bytesRead, u64 fileOffset, u32 size, void* data);
/**
* @brief Gets the size of a special file.
* @param fileSize Pointer to output the size to.
*/
Result FSPXI_GetSpecialFileSize(Handle serviceHandle, u64* fileSize);
/**
* @brief Initiates a device move as the source device.
* @param context Pointer to output the context to.
*/
Result FSPXI_StartDeviceMoveAsSource(Handle serviceHandle, FS_DeviceMoveContext* context);
/**
* @brief Initiates a device move as the destination device.
* @param context Context to use.
* @param clear Whether to clear the device's data first.
*/
Result FSPXI_StartDeviceMoveAsDestination(Handle serviceHandle, FS_DeviceMoveContext context, bool clear);
/**
* @brief Reads data and stores SHA256 hashes of blocks
* @param file File to read from.
* @param bytesRead Pointer to output the number of read bytes to.
* @param offset Offset to read from.
* @param readBuffer Pointer to store read data in.
* @param readBufferSize Size of readBuffer.
* @param hashtable Pointer to store SHA256 hashes in.
* @param hashtableSize Size of hashtable.
* @param unk Unknown. Always 0x00001000? Possibly block size?
*/
Result FSPXI_ReadFileSHA256(Handle serviceHandle, FSPXI_File file, u32* bytesRead, u64 offset, void* readBuffer, u32 readBufferSize, void* hashtable, u32 hashtableSize, u32 unk);
/**
* @brief Assumedly writes data and stores SHA256 hashes of blocks
* @param file File to write to.
* @param bytesWritten Pointer to output the number of written bytes to.
* @param offset Offset to write to.
* @param writeBuffer Buffer to write from.
* @param writeBufferSize Size of writeBuffer.
* @param hashtable Pointer to store SHA256 hashes in.
* @param hashtableSize Size of hashtable
* @param unk1 Unknown. Might match with ReadFileSHA256's unknown?
* @param unk2 Unknown. Might match with ReadFileSHA256's unknown?
*/
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);
/**
* @brief Configures CTRCARD latency emulation.
* @param latency Latency to apply.
*/
Result FSPXI_SetCtrCardLatencyParameter(Handle serviceHandle, u64 latency);
/**
* @brief Sets the file system priority.
* @param priority Priority to set.
*/
Result FSPXI_SetPriority(Handle serviceHandle, u32 priority);
/**
* @brief Toggles cleaning up invalid save data.
* @param enable Whether to enable cleaning up invalid save data.
*/
Result FSPXI_SwitchCleanupInvalidSaveData(Handle serviceHandle, bool enable);
/**
* @brief Enumerates system save data.
* @param idsWritten Pointer to output the number of IDs written to.
* @param idsSize Size of the IDs buffer.
* @param ids Pointer to output IDs to.
*/
Result FSPXI_EnumerateSystemSaveData(Handle serviceHandle, u32* idsWritten, u32 idsSize, u32* ids);
/**
* @brief Reads the NAND report.
* @param unk Unknown
* @param buffer Buffer to write the report to.
* @param size Size of buffer
*/
Result FSPXI_ReadNandReport(Handle serviceHandle, void* buffer, u32 size, u32 unk);
/**
* @brief Unknown command 0x56
* @remark Called by FSUSER_ControlArchive with ArchiveAction 0x789D
*/
Result FSPXI_Unknown0x56(Handle serviceHandle, u32 out[4], FS_Archive archive, FS_Path path);
fs.h
Filesystem Services.
FS_ArchiveID
FS_ArchiveID
Archive IDs.
Definition: fs.h:52
FS_MediaType
FS_MediaType
Media types.
Definition: fs.h:35
FS_Archive
u64 FS_Archive
Filesystem archive handle, providing access to a filesystem's contents.
Definition: fs.h:247
FS_CardSpiBusMode
FS_CardSpiBusMode
Card SPI bus mode.
Definition: fs.h:108
FS_CardType
FS_CardType
Definition: fs.h:122
FS_SystemMediaType
FS_SystemMediaType
System media types.
Definition: fs.h:43
FS_SpecialContentType
FS_SpecialContentType
Card SPI bus mode.
Definition: fs.h:115
FS_CardSpiBaudRate
FS_CardSpiBaudRate
Card SPI baud rate.
Definition: fs.h:97
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.
FSPXI_CalculateFileHashSHA256
Result FSPXI_CalculateFileHashSHA256(Handle serviceHandle, FSPXI_File file, void *buffer, u32 size)
Calculate SHA256 of a file.
FSPXI_DeleteSdmcRoot
Result FSPXI_DeleteSdmcRoot(Handle serviceHandle)
Deletes the 3DS SDMC root.
FSPXI_InitializeCtrFilesystem
Result FSPXI_InitializeCtrFilesystem(Handle serviceHandle)
Initializes the CTR file system.
FSPXI_GetNandSpeedInfo
Result FSPXI_GetNandSpeedInfo(Handle serviceHandle, FS_SdMmcSpeedInfo *out)
Gets the NAND speed info.
FSPXI_ClearSdmcLog
Result FSPXI_ClearSdmcLog(Handle serviceHandle)
Clears the SDMC log.
FSPXI_CardNorDirectRead_4xIO
Result FSPXI_CardNorDirectRead_4xIO(Handle serviceHandle, u8 commandId, u32 address, u32 size, void *output)
Executes a CARDNOR 4xIO direct read.
FSPXI_IsSdmcWritable
Result FSPXI_IsSdmcWritable(Handle serviceHandle, bool *out)
Gets whether PXIFS0 can write to the SD.
FSPXI_DeleteFile
Result FSPXI_DeleteFile(Handle serviceHandle, FSPXI_Archive archive, FS_Path path)
Deletes a file.
FSPXI_GetSdmcCtrRootPath
Result FSPXI_GetSdmcCtrRootPath(Handle serviceHandle, u16 *out, u32 length)
Gets the CTR SDMC root path.
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.
FSPXI_OpenFile
Result FSPXI_OpenFile(Handle serviceHandle, FSPXI_File *out, FSPXI_Archive archive, FS_Path path, u32 flags, u32 attributes)
Opens a file.
FSPXI_HasDirectory
Result FSPXI_HasDirectory(Handle serviceHandle, FSPXI_Archive archive, bool *out, FS_Path path)
Checks if the archive contains a directory at path.
FSPXI_ReadSpecialFile
Result FSPXI_ReadSpecialFile(Handle serviceHandle, u32 *bytesRead, u64 fileOffset, u32 size, void *data)
Reads from a special file.
FSPXI_SendInitializeInfoTo9
Result FSPXI_SendInitializeInfoTo9(Handle serviceHandle, u8 unk)
Sends initialization info to ARM9.
FSPXI_CloseDirectory
Result FSPXI_CloseDirectory(Handle serviceHandle, FSPXI_Directory directory)
Close a directory.
FSPXI_CreateFile
Result FSPXI_CreateFile(Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes, u64 fileSize)
Creates a file.
FSPXI_EnumerateSystemSaveData
Result FSPXI_EnumerateSystemSaveData(Handle serviceHandle, u32 *idsWritten, u32 idsSize, u32 *ids)
Enumerates system save data.
FSPXI_GetSdmcSpeedInfo
Result FSPXI_GetSdmcSpeedInfo(Handle serviceHandle, FS_SdMmcSpeedInfo *out)
Gets the SDMC speed info.
FSPXI_CardSlotIsInserted
Result FSPXI_CardSlotIsInserted(Handle serviceHandle, bool *inserted)
Gets whether a card is inserted.
FSPXI_GetNandLog
Result FSPXI_GetNandLog(Handle serviceHandle, void *out, u32 size)
Gets the NAND log.
FSPXI_GetArchiveResource
Result FSPXI_GetArchiveResource(Handle serviceHandle, FS_ArchiveResource *archiveResource, FS_SystemMediaType mediaType)
Gets an archive's resource information.
FSPXI_ReadDirectory
Result FSPXI_ReadDirectory(Handle serviceHandle, FSPXI_Directory directory, u32 *entriesRead, u32 entryCount, FS_DirectoryEntry *entries)
Reads one or more directory entries.
FSPXI_GetLegacyBannerData
Result FSPXI_GetLegacyBannerData(Handle serviceHandle, FS_MediaType mediaType, u64 programId, void *banner, u8 unk)
Gets the legacy banner data of a program.
FSPXI_GetNandArchiveResource
Result FSPXI_GetNandArchiveResource(Handle serviceHandle, FS_ArchiveResource *out)
Gets the NAND archive resource information.
FSPXI_GetSpecialFileSize
Result FSPXI_GetSpecialFileSize(Handle serviceHandle, u64 *fileSize)
Gets the size of a special file.
FSPXI_CardNorDirectWriteWithAddress
Result FSPXI_CardNorDirectWriteWithAddress(Handle serviceHandle, u8 commandId, u32 address, u32 size, const void *input)
Executes a CARDNOR direct write with an address.
FSPXI_CloseArchive
Result FSPXI_CloseArchive(Handle serviceHandle, FSPXI_Archive archive)
Close an archive.
FSPXI_FormatCardNorDevice
Result FSPXI_FormatCardNorDevice(Handle serviceHandle, u32 unk)
Formats the CARDNOR device.
FSPXI_ClearNandLog
Result FSPXI_ClearNandLog(Handle serviceHandle)
Clears the NAND log.
FSPXI_DeleteDirectory
Result FSPXI_DeleteDirectory(Handle serviceHandle, FSPXI_Archive archive, FS_Path path)
Deletes a directory.
FSPXI_CardSlotPowerOff
Result FSPXI_CardSlotPowerOff(Handle serviceHandle, bool *status)
Powers off the card slot.
FSPXI_GetNandCid
Result FSPXI_GetNandCid(Handle serviceHandle, void *out, u32 size)
Gets the NAND CID.
FSPXI_SetCtrCardLatencyParameter
Result FSPXI_SetCtrCardLatencyParameter(Handle serviceHandle, u64 latency)
Configures CTRCARD latency emulation.
FSPXI_RenameDirectory
Result FSPXI_RenameDirectory(Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath)
Renames a directory.
FSPXI_CloseFile
Result FSPXI_CloseFile(Handle serviceHandle, FSPXI_File file)
Close a file.
FSPXI_DeleteExtSaveData
Result FSPXI_DeleteExtSaveData(Handle serviceHandle, FS_ExtSaveDataInfo info)
Deletes ext save data.
FSPXI_SetPriority
Result FSPXI_SetPriority(Handle serviceHandle, u32 priority)
Sets the file system priority.
FSPXI_GetCardType
Result FSPXI_GetCardType(Handle serviceHandle, FS_CardType *out)
Gets the inserted card type.
FSPXI_ExportIntegrityVerificationSeed
Result FSPXI_ExportIntegrityVerificationSeed(Handle serviceHandle, FS_IntegrityVerificationSeed *seed)
Exports the integrity verification seed.
FSPXI_CreateExtSaveData
Result FSPXI_CreateExtSaveData(Handle serviceHandle, FS_ExtSaveDataInfo info)
Creates ext save data.
FSPXI_GetSdmcFatFsError
Result FSPXI_GetSdmcFatFsError(Handle serviceHandle, u32 *out)
Gets the error code from the SDMC FatFS driver.
FSPXI_CreateSeed
Result FSPXI_CreateSeed(Handle serviceHandle)
Creates the FS seed.
FSPXI_SetFileSize
Result FSPXI_SetFileSize(Handle serviceHandle, FSPXI_File file, u64 size)
Set size of a file.
FSPXI_CreateDirectory
Result FSPXI_CreateDirectory(Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes)
Creates a directory.
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.
FSPXI_OpenDirectory
Result FSPXI_OpenDirectory(Handle serviceHandle, FSPXI_Directory *out, FSPXI_Archive archive, FS_Path path)
Opens a directory.
FSPXI_ReadFile
Result FSPXI_ReadFile(Handle serviceHandle, FSPXI_File file, u32 *bytesRead, u64 offset, void *buffer, u32 size)
Reads from a file.
FSPXI_CardNorDirectSectorEraseWithoutVerify
Result FSPXI_CardNorDirectSectorEraseWithoutVerify(Handle serviceHandle, u32 address)
Executes a CARDNOR direct sector erase without verify.
FSPXI_GetSdmcArchiveResource
Result FSPXI_GetSdmcArchiveResource(Handle serviceHandle, FS_ArchiveResource *out)
Gets the SDMC archive resource information.
FSPXI_GetSpecialContentIndex
Result FSPXI_GetSpecialContentIndex(Handle serviceHandle, u16 *index, FS_MediaType mediaType, u64 programId, FS_SpecialContentType type)
Gets a special content's index.
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?
FSPXI_CardNorDirectCommand
Result FSPXI_CardNorDirectCommand(Handle serviceHandle, u8 commandId)
Executes a CARDNOR direct command.
FSPXI_OpenArchive
Result FSPXI_OpenArchive(Handle serviceHandle, FSPXI_Archive *archive, FS_ArchiveID archiveID, FS_Path path)
Opens an archive.
FSPXI_IsSdmcDetected
Result FSPXI_IsSdmcDetected(Handle serviceHandle, bool *out)
Gets whether PXIFS0 detects the SD.
FSPXI_GetSdmcLog
Result FSPXI_GetSdmcLog(Handle serviceHandle, void *out, u32 size)
Gets the SDMC log.
FSPXI_CardNorDirectReadWithAddress
Result FSPXI_CardNorDirectReadWithAddress(Handle serviceHandle, u8 commandId, u32 address, u32 size, void *output)
Executes a CARDNOR direct read with an address.
FSPXI_StartDeviceMoveAsSource
Result FSPXI_StartDeviceMoveAsSource(Handle serviceHandle, FS_DeviceMoveContext *context)
Initiates a device move as the source device.
FSPXI_CardSlotPowerOn
Result FSPXI_CardSlotPowerOn(Handle serviceHandle, bool *status)
Powers on the card slot.
FSPXI_GetProductInfo
Result FSPXI_GetProductInfo(Handle serviceHandle, FS_ProductInfo *info, FSPXI_Archive archive)
Gets an NCCH's product info.
FSPXI_GetFileSize
Result FSPXI_GetFileSize(Handle serviceHandle, FSPXI_File file, u64 *size)
Get size of a file.
FSPXI_CommitSaveData
Result FSPXI_CommitSaveData(Handle serviceHandle, FSPXI_Archive archive, u32 id)
Commits an archive's save data.
FSPXI_ReadNandReport
Result FSPXI_ReadNandReport(Handle serviceHandle, void *buffer, u32 size, u32 unk)
Reads the NAND report.
FSPXI_Unknown0x17
Result FSPXI_Unknown0x17(Handle serviceHandle, FSPXI_Archive archive, bool *out)
Unknown 0x17.
FSPXI_CardNorDirectWrite
Result FSPXI_CardNorDirectWrite(Handle serviceHandle, u8 commandId, u32 size, const void *input)
Executes a CARDNOR direct write.
FSPXI_SetCardSpiBaudrate
Result FSPXI_SetCardSpiBaudrate(Handle serviceHandle, FS_CardSpiBaudRate baudRate)
Sets the CARDSPI baud rate.
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.
FSPXI_CardNorDirectRead
Result FSPXI_CardNorDirectRead(Handle serviceHandle, u8 commandId, u32 size, void *output)
Executes a CARDNOR direct read.
FSPXI_SetCardSpiBusMode
Result FSPXI_SetCardSpiBusMode(Handle serviceHandle, FS_CardSpiBusMode busMode)
Sets the CARDSPI bus mode.
FSPXI_RenameFile
Result FSPXI_RenameFile(Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath)
Renames a 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.
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.
FSPXI_CardSlotGetCardIFPowerStatus
Result FSPXI_CardSlotGetCardIFPowerStatus(Handle serviceHandle, bool *status)
Gets the card's power status.
FSPXI_GenerateRandomBytes
Result FSPXI_GenerateRandomBytes(Handle serviceHandle, void *buffer, u32 size)
Generates random bytes.
FSPXI_CardNorDirectCpuWriteWithoutVerify
Result FSPXI_CardNorDirectCpuWriteWithoutVerify(Handle serviceHandle, u32 address, u32 size, const void *input)
Executes a CARDNOR direct CPU write without verify.
FSPXI_CardNorDirectCommandWithAddress
Result FSPXI_CardNorDirectCommandWithAddress(Handle serviceHandle, u8 commandId, u32 address)
Executes a CARDNOR direct command with an address.
FSPXI_GetSdmcCid
Result FSPXI_GetSdmcCid(Handle serviceHandle, void *out, u32 size)
Gets the SDMC CID.
FSPXI_HasFile
Result FSPXI_HasFile(Handle serviceHandle, FSPXI_Archive archive, bool *out, FS_Path path)
Checks if the archive contains a file at path.
FSPXI_StartDeviceMoveAsDestination
Result FSPXI_StartDeviceMoveAsDestination(Handle serviceHandle, FS_DeviceMoveContext context, bool clear)
Initiates a device move as the destination device.
FSPXI_DeleteAllExtSaveDataOnNand
Result FSPXI_DeleteAllExtSaveDataOnNand(Handle serviceHandle)
Deletes all ext save data on the NAND.
FSPXI_ImportIntegrityVerificationSeed
Result FSPXI_ImportIntegrityVerificationSeed(Handle serviceHandle, const FS_IntegrityVerificationSeed *seed)
Imports an integrity verification seed.
FSPXI_Unknown0x56
Result FSPXI_Unknown0x56(Handle serviceHandle, u32 out[4], FS_Archive archive, FS_Path path)
Unknown command 0x56.
FSPXI_SwitchCleanupInvalidSaveData
Result FSPXI_SwitchCleanupInvalidSaveData(Handle serviceHandle, bool enable)
Toggles cleaning up invalid save data.
FSPXI_GetLegacyRomHeader
Result FSPXI_GetLegacyRomHeader(Handle serviceHandle, FS_MediaType mediaType, u64 programId, void *header)
Gets the legacy ROM header of a program.
FS_ArchiveResource
Archive resource information.
Definition: fs.h:174
FS_DeviceMoveContext
Device move context.
Definition: fs.h:225
FS_DirectoryEntry
Directory entry.
Definition: fs.h:162
FS_ExtSaveDataInfo
Ext save data information.
Definition: fs.h:206
FS_IntegrityVerificationSeed
Integrity verification seed.
Definition: fs.h:199
FS_Path
Filesystem path data, detailing the specific target of an operation.
Definition: fs.h:232
FS_ProductInfo
Product information.
Definition: fs.h:191
FS_SdMmcSpeedInfo
SDMC/NAND speed information.
Definition: fs.h:240
types.h
Various system types.
u64
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
u8
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
Handle
u32 Handle
Resource handle.
Definition: types.h:41
Result
s32 Result
Function result.
Definition: types.h:42
u16
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
u32
uint32_t u32
32-bit unsigned integer
Definition: types.h:23