// Copyright 2014 Citra Emulator Project // Licensed under GPLv2 // Refer to the license.txt file included. #include "common/common.h" #include "core/hle/service/fs.h" #include "core/hle/kernel/archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace FS_User namespace FS_User { // Command to access archive file enum class LowPathType : u32 { Invalid = 0, Empty = 1, Binary = 2, Char = 3, Wchar = 4 }; std::string GetStringFromCmdBuff(const u32 pointer, const u32 size) { auto data = reinterpret_cast(Memory::GetPointer(pointer)); return std::string(data, size - 1); } // We currently return 0 for success and -1 for failure in cmd_buff[1]. -1 was chosen because it // puts all the sections of the http://3dbrew.org/wiki/Error_codes to something non-zero, to make // sure we don't mislead the application into thinking something worked. void Dummy1(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void Control(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void Initialize(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); // TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per // http://3dbrew.org/wiki/FS:Initialize#Request cmd_buff[1] = 0; DEBUG_LOG(KERNEL, "called"); } void OpenFile(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); u32 transaction = cmd_buff[1]; // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to // 3dmoo's or ctrulib's implementations. Triple check if it's really the case. Handle archive_handle = static_cast(cmd_buff[3]); LowPathType type = static_cast(cmd_buff[4]); u32 size = cmd_buff[5]; FileSys::Mode mode; mode.hex = cmd_buff[6]; u32 attributes = cmd_buff[7]; // TODO(Link Mauve): do something with those attributes. u32 pointer = cmd_buff[9]; if (type != LowPathType::Char) { ERROR_LOG(KERNEL, "file LowPath type other than char is currently unsupported"); cmd_buff[1] = -1; return; } std::string file_name = GetStringFromCmdBuff(pointer, size); DEBUG_LOG(KERNEL, "type=%d size=%d mode=%d attrs=%d data=%s", type, size, mode, attributes, file_name.c_str()); Handle handle = Kernel::OpenFileFromArchive(archive_handle, file_name, mode); if (handle) { cmd_buff[1] = 0; cmd_buff[3] = handle; } else { ERROR_LOG(KERNEL, "failed to get a handle for file %s", file_name.c_str()); // TODO(Link Mauve): check for the actual error values, this one was just chosen arbitrarily. cmd_buff[1] = -1; } DEBUG_LOG(KERNEL, "called"); } void OpenFileDirectly(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); u32 transaction = cmd_buff[1]; auto archive_id = static_cast(cmd_buff[2]); LowPathType archive_type = static_cast(cmd_buff[3]); u32 archive_size = cmd_buff[4]; LowPathType type = static_cast(cmd_buff[5]); u32 size = cmd_buff[6]; FileSys::Mode mode; mode.hex = cmd_buff[7]; u32 attributes = cmd_buff[8]; // TODO(Link Mauve): do something with those attributes. u32 archive_pointer = cmd_buff[10]; u32 pointer = cmd_buff[12]; if (archive_type != LowPathType::Empty) { ERROR_LOG(KERNEL, "archive LowPath type other than empty is currently unsupported"); cmd_buff[1] = -1; return; } if (type != LowPathType::Char) { ERROR_LOG(KERNEL, "file LowPath type other than char is currently unsupported"); cmd_buff[1] = -1; return; } std::string archive_name = GetStringFromCmdBuff(archive_pointer, archive_size); std::string file_name = GetStringFromCmdBuff(pointer, size); DEBUG_LOG(KERNEL, "archive_type=%d archive_size=%d archive_data=%s" "file_type=%d file_size=%d file_mode=%d file_attrs=%d file_data=%s", archive_type, archive_size, archive_name.c_str(), type, size, mode, attributes, file_name.c_str()); // TODO(Link Mauve): check if we should even get a handle for the archive, and don't leak it. Handle archive_handle = Kernel::OpenArchive(archive_id); if (archive_handle) { cmd_buff[1] = 0; // cmd_buff[2] isn't used according to 3dmoo's implementation. cmd_buff[3] = archive_handle; } else { ERROR_LOG(KERNEL, "failed to get a handle for archive %s", archive_name.c_str()); // TODO(Link Mauve): check for the actual error values, this one was just chosen arbitrarily. cmd_buff[1] = -1; return; } Handle handle = Kernel::OpenFileFromArchive(archive_handle, file_name, mode); if (handle) { cmd_buff[1] = 0; cmd_buff[3] = handle; } else { ERROR_LOG(KERNEL, "failed to get a handle for file %s", file_name.c_str()); // TODO(Link Mauve): check for the actual error values, this one was just chosen arbitrarily. cmd_buff[1] = -1; } DEBUG_LOG(KERNEL, "called"); } void DeleteFile(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void RenameFile(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteDirectory(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteDirectoryRecursively(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CreateFile(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CreateDirectory(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void RenameDirectory(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void OpenDirectory(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to // 3dmoo's or ctrulib's implementations. Triple check if it's really the case. Handle archive_handle = static_cast(cmd_buff[2]); LowPathType type = static_cast(cmd_buff[3]); u32 size = cmd_buff[4]; u32 pointer = cmd_buff[6]; if (type != LowPathType::Char) { ERROR_LOG(KERNEL, "directory LowPath type other than char is currently unsupported"); cmd_buff[1] = -1; return; } std::string dir_name = GetStringFromCmdBuff(pointer, size); DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", type, size, dir_name.c_str()); Handle handle = Kernel::OpenDirectoryFromArchive(archive_handle, dir_name); if (handle) { cmd_buff[1] = 0; cmd_buff[3] = handle; } else { ERROR_LOG(KERNEL, "failed to get a handle for directory %s", dir_name.c_str()); // TODO(Link Mauve): check for the actual error values, this one was just chosen arbitrarily. cmd_buff[1] = -1; } DEBUG_LOG(KERNEL, "called"); } void OpenArchive(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); auto arch_id = static_cast(cmd_buff[1]); LowPathType type = static_cast(cmd_buff[2]); u32 size = cmd_buff[3]; u32 pointer = cmd_buff[5]; if (type != LowPathType::Empty) { ERROR_LOG(KERNEL, "archive LowPath type other than empty is currently unsupported"); cmd_buff[1] = -1; return; } std::string archive_name = GetStringFromCmdBuff(pointer, size); DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", type, size, archive_name.c_str()); Handle handle = Kernel::OpenArchive(arch_id); if (handle) { cmd_buff[1] = 0; // cmd_buff[2] isn't used according to 3dmoo's implementation. cmd_buff[3] = handle; } else { ERROR_LOG(KERNEL, "failed to get a handle for archive %s", archive_name.c_str()); // TODO(Link Mauve): check for the actual error values, this one was just chosen arbitrarily. cmd_buff[1] = -1; } DEBUG_LOG(KERNEL, "called"); } void ControlArchive(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CloseArchive(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void FormatThisUserSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CreateSystemSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteSystemSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetFreeBytes(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetCardType(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSdmcArchiveResource(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetNandArchiveResource(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSdmcFatfsErro(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void IsSdmcDetected(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void IsSdmcWritable(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSdmcCid(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetNandCid(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSdmcSpeedInfo(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetNandSpeedInfo(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSdmcLog(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetNandLog(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void ClearSdmcLog(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void ClearNandLog(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardSlotIsInserted(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardSlotPowerOn(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardSlotPowerOff(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardSlotGetCardIFPowerStatus(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectCommand(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectCommandWithAddress(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectRead(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectReadWithAddress(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectWrite(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectWriteWithAddress(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectRead_4xIO(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectCpuWriteWithoutVerify(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CardNorDirectSectorEraseWithoutVerify(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetProductInfo(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetProgramLaunchInfo(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CreateExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CreateSharedExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void ReadExtSaveDataIcon(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void EnumerateExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void EnumerateSharedExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteSharedExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void SetCardSpiBaudRate(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void SetCardSpiBusMode(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void SendInitializeInfoTo9(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSpecialContentIndex(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetLegacyRomHeader(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetLegacyBannerData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CheckAuthorityToAccessExtSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void QueryTotalQuotaSize(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetExtDataBlockSize(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void AbnegateAccessRight(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteSdmcRoot(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void DeleteAllExtSaveDataOnNand(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void InitializeCtrFileSystem(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void CreateSeed(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetFormatInfo(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetLegacyRomHeader2(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void FormatCtrCardUserSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSdmcCtrRootPath(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetArchiveResource(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void ExportIntegrityVerificationSeed(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void ImportIntegrityVerificationSeed(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void FormatSaveData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetLegacySubBannerData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void UpdateSha256Context(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void ReadSpecialFile(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetSpecialFileSize(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetMovableSedHashedKeyYRandomData(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void InitializeWithSdkVersion(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void SetPriority(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } void GetPriority(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); ERROR_LOG(KERNEL, "Unimplemented function"); cmd_buff[1] = 0; // No error } const Interface::FunctionInfo FunctionTable[] = { {0x000100C6, Dummy1, "Dummy1"}, {0x040100C4, Control, "Control"}, {0x08010002, Initialize, "Initialize"}, {0x080201C2, OpenFile, "OpenFile"}, {0x08030204, OpenFileDirectly, "OpenFileDirectly"}, {0x08040142, DeleteFile, "DeleteFile"}, {0x08050244, RenameFile, "RenameFile"}, {0x08060142, DeleteDirectory, "DeleteDirectory"}, {0x08070142, DeleteDirectoryRecursively, "DeleteDirectoryRecursively"}, {0x08080202, CreateFile, "CreateFile"}, {0x08090182, CreateDirectory, "CreateDirectory"}, {0x080A0244, RenameDirectory, "RenameDirectory"}, {0x080B0102, OpenDirectory, "OpenDirectory"}, {0x080C00C2, OpenArchive, "OpenArchive"}, {0x080D0144, ControlArchive, "ControlArchive"}, {0x080E0080, CloseArchive, "CloseArchive"}, {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"}, {0x08100200, CreateSystemSaveData, "CreateSystemSaveData"}, {0x08110040, DeleteSystemSaveData, "DeleteSystemSaveData"}, {0x08120080, GetFreeBytes, "GetFreeBytes"}, {0x08130000, GetCardType, "GetCardType"}, {0x08140000, GetSdmcArchiveResource, "GetSdmcArchiveResource"}, {0x08150000, GetNandArchiveResource, "GetNandArchiveResource"}, {0x08160000, GetSdmcFatfsErro, "GetSdmcFatfsErro"}, {0x08170000, IsSdmcDetected, "IsSdmcDetected"}, {0x08180000, IsSdmcWritable, "IsSdmcWritable"}, {0x08190042, GetSdmcCid, "GetSdmcCid"}, {0x081A0042, GetNandCid, "GetNandCid"}, {0x081B0000, GetSdmcSpeedInfo, "GetSdmcSpeedInfo"}, {0x081C0000, GetNandSpeedInfo, "GetNandSpeedInfo"}, {0x081D0042, GetSdmcLog, "GetSdmcLog"}, {0x081E0042, GetNandLog, "GetNandLog"}, {0x081F0000, ClearSdmcLog, "ClearSdmcLog"}, {0x08200000, ClearNandLog, "ClearNandLog"}, {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"}, {0x08220000, CardSlotPowerOn, "CardSlotPowerOn"}, {0x08230000, CardSlotPowerOff, "CardSlotPowerOff"}, {0x08240000, CardSlotGetCardIFPowerStatus, "CardSlotGetCardIFPowerStatus"}, {0x08250040, CardNorDirectCommand, "CardNorDirectCommand"}, {0x08260080, CardNorDirectCommandWithAddress, "CardNorDirectCommandWithAddress"}, {0x08270082, CardNorDirectRead, "CardNorDirectRead"}, {0x082800C2, CardNorDirectReadWithAddress, "CardNorDirectReadWithAddress"}, {0x08290082, CardNorDirectWrite, "CardNorDirectWrite"}, {0x082A00C2, CardNorDirectWriteWithAddress, "CardNorDirectWriteWithAddress"}, {0x082B00C2, CardNorDirectRead_4xIO, "CardNorDirectRead_4xIO"}, {0x082C0082, CardNorDirectCpuWriteWithoutVerify, "CardNorDirectCpuWriteWithoutVerify"}, {0x082D0040, CardNorDirectSectorEraseWithoutVerify, "CardNorDirectSectorEraseWithoutVerify"}, {0x082E0040, GetProductInfo, "GetProductInfo"}, {0x082F0040, GetProgramLaunchInfo, "GetProgramLaunchInfo"}, {0x08300182, CreateExtSaveData, "CreateExtSaveData"}, {0x08310180, CreateSharedExtSaveData, "CreateSharedExtSaveData"}, {0x08320102, ReadExtSaveDataIcon, "ReadExtSaveDataIcon"}, {0x08330082, EnumerateExtSaveData, "EnumerateExtSaveData"}, {0x08340082, EnumerateSharedExtSaveData, "EnumerateSharedExtSaveData"}, {0x08350080, DeleteExtSaveData, "DeleteExtSaveData"}, {0x08360080, DeleteSharedExtSaveData, "DeleteSharedExtSaveData"}, {0x08370040, SetCardSpiBaudRate, "SetCardSpiBaudRate"}, {0x08380040, SetCardSpiBusMode, "SetCardSpiBusMode"}, {0x08390000, SendInitializeInfoTo9, "SendInitializeInfoTo9"}, {0x083A0100, GetSpecialContentIndex, "GetSpecialContentIndex"}, {0x083B00C2, GetLegacyRomHeader, "GetLegacyRomHeader"}, {0x083C00C2, GetLegacyBannerData, "GetLegacyBannerData"}, {0x083D0100, CheckAuthorityToAccessExtSaveData, "CheckAuthorityToAccessExtSaveData"}, {0x083E00C2, QueryTotalQuotaSize, "QueryTotalQuotaSize"}, {0x083F00C0, GetExtDataBlockSize, "GetExtDataBlockSize"}, {0x08400040, AbnegateAccessRight, "AbnegateAccessRight"}, {0x08410000, DeleteSdmcRoot, "DeleteSdmcRoot"}, {0x08420040, DeleteAllExtSaveDataOnNand, "DeleteAllExtSaveDataOnNand"}, {0x08430000, InitializeCtrFileSystem, "InitializeCtrFileSystem"}, {0x08440000, CreateSeed, "CreateSeed"}, {0x084500C2, GetFormatInfo, "GetFormatInfo"}, {0x08460102, GetLegacyRomHeader2, "GetLegacyRomHeader2"}, {0x08470180, FormatCtrCardUserSaveData, "FormatCtrCardUserSaveData"}, {0x08480042, GetSdmcCtrRootPath, "GetSdmcCtrRootPath"}, {0x08490040, GetArchiveResource, "GetArchiveResource"}, {0x084A0002, ExportIntegrityVerificationSeed, "ExportIntegrityVerificationSeed"}, {0x084B0002, ImportIntegrityVerificationSeed, "ImportIntegrityVerificationSeed"}, {0x084C0242, FormatSaveData, "FormatSaveData"}, {0x084D0102, GetLegacySubBannerData, "GetLegacySubBannerData"}, {0x084E0342, UpdateSha256Context, "UpdateSha256Context"}, {0x084F0102, ReadSpecialFile, "ReadSpecialFile"}, {0x08500040, GetSpecialFileSize, "GetSpecialFileSize"}, {0x08580000, GetMovableSedHashedKeyYRandomData, "GetMovableSedHashedKeyYRandomData"}, {0x08610042, InitializeWithSdkVersion, "InitializeWithSdkVersion"}, {0x08620040, SetPriority, "SetPriority"}, {0x08630000, GetPriority, "GetPriority"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class Interface::Interface() { Register(FunctionTable, ARRAY_SIZE(FunctionTable)); } Interface::~Interface() { } } // namespace