2014-06-26 17:58:44 -04:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "common/common.h"
|
|
|
|
|
2014-11-04 03:04:25 -05:00
|
|
|
#include "common/string_util.h"
|
2014-06-27 16:18:56 -04:00
|
|
|
#include "core/hle/kernel/archive.h"
|
2014-10-22 23:20:01 -04:00
|
|
|
#include "core/hle/kernel/archive.h"
|
|
|
|
#include "core/hle/result.h"
|
|
|
|
#include "core/hle/service/fs_user.h"
|
|
|
|
#include "core/settings.h"
|
2014-06-26 17:58:44 -04:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Namespace FS_User
|
|
|
|
|
|
|
|
namespace FS_User {
|
|
|
|
|
2014-11-16 22:58:39 -05:00
|
|
|
static void Initialize(Service::Interface* self) {
|
2014-06-26 17:58:44 -04:00
|
|
|
u32* cmd_buff = Service::GetCommandBuffer();
|
2014-09-11 18:48:28 -04:00
|
|
|
|
|
|
|
// TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per
|
|
|
|
// http://3dbrew.org/wiki/FS:Initialize#Request
|
2014-10-22 23:20:01 -04:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
2014-09-11 18:48:28 -04:00
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
/**
|
|
|
|
* FS_User::OpenFile service function
|
|
|
|
* Inputs:
|
|
|
|
* 1 : Transaction
|
|
|
|
* 2 : Archive handle lower word
|
|
|
|
* 3 : Archive handle upper word
|
|
|
|
* 4 : Low path type
|
|
|
|
* 5 : Low path size
|
|
|
|
* 6 : Open flags
|
|
|
|
* 7 : Attributes
|
|
|
|
* 8 : (LowPathSize << 14) | 2
|
|
|
|
* 9 : Low path data pointer
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 3 : File handle
|
|
|
|
*/
|
2014-11-16 22:58:39 -05:00
|
|
|
static void OpenFile(Service::Interface* self) {
|
2014-09-11 18:48:28 -04:00
|
|
|
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<Handle>(cmd_buff[3]);
|
2014-11-10 17:36:32 -05:00
|
|
|
auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 filename_size = cmd_buff[5];
|
2014-09-11 18:48:28 -04:00
|
|
|
FileSys::Mode mode; mode.hex = cmd_buff[6];
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 attributes = cmd_buff[7]; // TODO(Link Mauve): do something with those attributes.
|
|
|
|
u32 filename_ptr = cmd_buff[9];
|
2014-11-10 17:36:32 -05:00
|
|
|
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
DEBUG_LOG(KERNEL, "path=%s, mode=%d attrs=%d", file_path.DebugStr().c_str(), mode, attributes);
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-10-22 23:20:01 -04:00
|
|
|
ResultVal<Handle> handle = Kernel::OpenFileFromArchive(archive_handle, file_path, mode);
|
|
|
|
cmd_buff[1] = handle.Code().raw;
|
|
|
|
if (handle.Succeeded()) {
|
|
|
|
cmd_buff[3] = *handle;
|
2014-09-11 18:48:28 -04:00
|
|
|
} else {
|
2014-11-14 00:07:02 -05:00
|
|
|
ERROR_LOG(KERNEL, "failed to get a handle for file %s", file_path.DebugStr().c_str());
|
2014-09-11 18:48:28 -04:00
|
|
|
}
|
|
|
|
|
2014-06-27 16:18:56 -04:00
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
/**
|
|
|
|
* FS_User::OpenFileDirectly service function
|
|
|
|
* Inputs:
|
|
|
|
* 1 : Transaction
|
|
|
|
* 2 : Archive ID
|
|
|
|
* 3 : Archive low path type
|
|
|
|
* 4 : Archive low path size
|
|
|
|
* 5 : File low path type
|
|
|
|
* 6 : File low path size
|
|
|
|
* 7 : Flags
|
|
|
|
* 8 : Attributes
|
|
|
|
* 9 : (ArchiveLowPathSize << 14) | 0x802
|
|
|
|
* 10 : Archive low path
|
|
|
|
* 11 : (FileLowPathSize << 14) | 2
|
|
|
|
* 12 : File low path
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 3 : File handle
|
|
|
|
*/
|
2014-11-16 22:58:39 -05:00
|
|
|
static void OpenFileDirectly(Service::Interface* self) {
|
2014-06-27 16:18:56 -04:00
|
|
|
u32* cmd_buff = Service::GetCommandBuffer();
|
|
|
|
|
2014-11-04 03:04:25 -05:00
|
|
|
auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]);
|
2014-11-10 17:36:32 -05:00
|
|
|
auto archivename_type = static_cast<FileSys::LowPathType>(cmd_buff[3]);
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 archivename_size = cmd_buff[4];
|
2014-11-10 17:36:32 -05:00
|
|
|
auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[5]);
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 filename_size = cmd_buff[6];
|
2014-09-11 18:48:28 -04:00
|
|
|
FileSys::Mode mode; mode.hex = cmd_buff[7];
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 attributes = cmd_buff[8]; // TODO(Link Mauve): do something with those attributes.
|
|
|
|
u32 archivename_ptr = cmd_buff[10];
|
|
|
|
u32 filename_ptr = cmd_buff[12];
|
2014-11-14 00:07:02 -05:00
|
|
|
FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr);
|
|
|
|
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
2014-11-04 03:04:25 -05:00
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
DEBUG_LOG(KERNEL, "archive_path=%s file_path=%s, mode=%d attributes=%d",
|
|
|
|
archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode, attributes);
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
if (archive_path.GetType() != FileSys::Empty) {
|
2014-09-11 18:48:28 -04:00
|
|
|
ERROR_LOG(KERNEL, "archive LowPath type other than empty is currently unsupported");
|
2014-10-22 23:20:01 -04:00
|
|
|
cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw;
|
2014-09-11 18:48:28 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
// TODO(Link Mauve): Check if we should even get a handle for the archive, and don't leak it
|
2014-10-22 23:20:01 -04:00
|
|
|
// TODO(yuriks): Why is there all this duplicate (and seemingly useless) code up here?
|
|
|
|
ResultVal<Handle> archive_handle = Kernel::OpenArchive(archive_id);
|
|
|
|
cmd_buff[1] = archive_handle.Code().raw;
|
|
|
|
if (archive_handle.Failed()) {
|
2014-11-04 03:04:25 -05:00
|
|
|
ERROR_LOG(KERNEL, "failed to get a handle for archive");
|
2014-09-11 18:48:28 -04:00
|
|
|
return;
|
|
|
|
}
|
2014-10-22 23:20:01 -04:00
|
|
|
// cmd_buff[2] isn't used according to 3dmoo's implementation.
|
|
|
|
cmd_buff[3] = *archive_handle;
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-10-22 23:20:01 -04:00
|
|
|
ResultVal<Handle> handle = Kernel::OpenFileFromArchive(*archive_handle, file_path, mode);
|
|
|
|
cmd_buff[1] = handle.Code().raw;
|
|
|
|
if (handle.Succeeded()) {
|
|
|
|
cmd_buff[3] = *handle;
|
2014-09-11 18:48:28 -04:00
|
|
|
} else {
|
2014-11-14 00:07:02 -05:00
|
|
|
ERROR_LOG(KERNEL, "failed to get a handle for file %s", file_path.DebugStr().c_str());
|
2014-09-11 18:48:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-11-11 13:37:26 -05:00
|
|
|
/*
|
|
|
|
* FS_User::DeleteFile service function
|
|
|
|
* Inputs:
|
|
|
|
* 2 : Archive handle lower word
|
|
|
|
* 3 : Archive handle upper word
|
|
|
|
* 4 : File path string type
|
|
|
|
* 5 : File path string size
|
|
|
|
* 7 : File path string data
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
*/
|
|
|
|
void DeleteFile(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<Handle>(cmd_buff[3]);
|
|
|
|
auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
|
|
|
|
u32 filename_size = cmd_buff[5];
|
|
|
|
u32 filename_ptr = cmd_buff[7];
|
|
|
|
|
|
|
|
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "type=%d size=%d data=%s",
|
|
|
|
filename_type, filename_size, file_path.DebugStr().c_str());
|
|
|
|
|
|
|
|
cmd_buff[1] = Kernel::DeleteFileFromArchive(archive_handle, file_path);
|
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FS_User::DeleteDirectory service function
|
|
|
|
* Inputs:
|
|
|
|
* 2 : Archive handle lower word
|
|
|
|
* 3 : Archive handle upper word
|
|
|
|
* 4 : Directory path string type
|
|
|
|
* 5 : Directory path string size
|
|
|
|
* 7 : Directory path string data
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
*/
|
|
|
|
void DeleteDirectory(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<Handle>(cmd_buff[3]);
|
|
|
|
auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
|
|
|
|
u32 dirname_size = cmd_buff[5];
|
|
|
|
u32 dirname_ptr = cmd_buff[7];
|
|
|
|
|
|
|
|
FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
|
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "type=%d size=%d data=%s",
|
|
|
|
dirname_type, dirname_size, dir_path.DebugStr().c_str());
|
|
|
|
|
|
|
|
cmd_buff[1] = Kernel::DeleteDirectoryFromArchive(archive_handle, dir_path);
|
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-10-29 01:52:56 -04:00
|
|
|
/*
|
|
|
|
* FS_User::CreateDirectory service function
|
|
|
|
* Inputs:
|
|
|
|
* 2 : Archive handle lower word
|
|
|
|
* 3 : Archive handle upper word
|
|
|
|
* 4 : Directory path string type
|
|
|
|
* 5 : Directory path string size
|
|
|
|
* 8 : Directory path string data
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
*/
|
2014-11-16 22:58:39 -05:00
|
|
|
static void CreateDirectory(Service::Interface* self) {
|
2014-10-29 01:52:56 -04:00
|
|
|
u32* cmd_buff = Service::GetCommandBuffer();
|
|
|
|
|
|
|
|
// TODO: 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<Handle>(cmd_buff[3]);
|
2014-11-10 17:36:32 -05:00
|
|
|
auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 dirname_size = cmd_buff[5];
|
|
|
|
u32 dirname_ptr = cmd_buff[8];
|
|
|
|
|
2014-11-10 17:36:32 -05:00
|
|
|
FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
|
2014-10-29 01:52:56 -04:00
|
|
|
|
2014-11-11 13:37:26 -05:00
|
|
|
DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str());
|
2014-10-29 01:52:56 -04:00
|
|
|
|
2014-11-11 19:27:35 -05:00
|
|
|
cmd_buff[1] = Kernel::CreateDirectoryFromArchive(archive_handle, dir_path);
|
2014-10-29 01:52:56 -04:00
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-11-16 22:58:39 -05:00
|
|
|
static void OpenDirectory(Service::Interface* self) {
|
2014-09-11 18:48:28 -04:00
|
|
|
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<Handle>(cmd_buff[2]);
|
2014-11-10 17:36:32 -05:00
|
|
|
auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[3]);
|
2014-11-04 03:04:25 -05:00
|
|
|
u32 dirname_size = cmd_buff[4];
|
|
|
|
u32 dirname_ptr = cmd_buff[6];
|
|
|
|
|
2014-11-10 17:36:32 -05:00
|
|
|
FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-11-11 13:37:26 -05:00
|
|
|
DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str());
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-10-22 23:20:01 -04:00
|
|
|
ResultVal<Handle> handle = Kernel::OpenDirectoryFromArchive(archive_handle, dir_path);
|
|
|
|
cmd_buff[1] = handle.Code().raw;
|
|
|
|
if (handle.Succeeded()) {
|
|
|
|
cmd_buff[3] = *handle;
|
2014-09-11 18:48:28 -04:00
|
|
|
} else {
|
2014-11-11 13:37:26 -05:00
|
|
|
ERROR_LOG(KERNEL, "failed to get a handle for directory");
|
2014-09-11 18:48:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
/**
|
|
|
|
* FS_User::OpenArchive service function
|
|
|
|
* Inputs:
|
|
|
|
* 1 : Archive ID
|
|
|
|
* 2 : Archive low path type
|
|
|
|
* 3 : Archive low path size
|
|
|
|
* 4 : (LowPathSize << 14) | 2
|
|
|
|
* 5 : Archive low path
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Archive handle lower word (unused)
|
|
|
|
* 3 : Archive handle upper word (same as file handle)
|
|
|
|
*/
|
2014-11-16 22:58:39 -05:00
|
|
|
static void OpenArchive(Service::Interface* self) {
|
2014-09-11 18:48:28 -04:00
|
|
|
u32* cmd_buff = Service::GetCommandBuffer();
|
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[1]);
|
2014-11-10 17:36:32 -05:00
|
|
|
auto archivename_type = static_cast<FileSys::LowPathType>(cmd_buff[2]);
|
2014-11-14 00:07:02 -05:00
|
|
|
u32 archivename_size = cmd_buff[3];
|
|
|
|
u32 archivename_ptr = cmd_buff[5];
|
|
|
|
FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr);
|
2014-11-04 03:04:25 -05:00
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
DEBUG_LOG(KERNEL, "archive_path=%s", archive_path.DebugStr().c_str());
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-11-14 00:07:02 -05:00
|
|
|
if (archive_path.GetType() != FileSys::Empty) {
|
2014-09-11 18:48:28 -04:00
|
|
|
ERROR_LOG(KERNEL, "archive LowPath type other than empty is currently unsupported");
|
2014-10-22 23:20:01 -04:00
|
|
|
cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw;
|
2014-09-11 18:48:28 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-10-22 23:20:01 -04:00
|
|
|
ResultVal<Handle> handle = Kernel::OpenArchive(archive_id);
|
|
|
|
cmd_buff[1] = handle.Code().raw;
|
|
|
|
if (handle.Succeeded()) {
|
2014-09-11 18:48:28 -04:00
|
|
|
// cmd_buff[2] isn't used according to 3dmoo's implementation.
|
2014-10-22 23:20:01 -04:00
|
|
|
cmd_buff[3] = *handle;
|
2014-09-11 18:48:28 -04:00
|
|
|
} else {
|
2014-11-04 03:04:25 -05:00
|
|
|
ERROR_LOG(KERNEL, "failed to get a handle for archive");
|
2014-06-27 16:18:56 -04:00
|
|
|
}
|
2014-09-11 18:48:28 -04:00
|
|
|
|
2014-06-27 16:18:56 -04:00
|
|
|
DEBUG_LOG(KERNEL, "called");
|
2014-06-26 17:58:44 -04:00
|
|
|
}
|
|
|
|
|
2014-10-29 02:41:22 -04:00
|
|
|
/*
|
|
|
|
* FS_User::IsSdmcDetected service function
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Whether the Sdmc could be detected
|
|
|
|
*/
|
2014-11-16 22:58:39 -05:00
|
|
|
static void IsSdmcDetected(Service::Interface* self) {
|
2014-10-29 02:41:22 -04:00
|
|
|
u32* cmd_buff = Service::GetCommandBuffer();
|
|
|
|
|
|
|
|
cmd_buff[1] = 0;
|
|
|
|
cmd_buff[2] = Settings::values.use_virtual_sd ? 1 : 0;
|
2014-11-19 03:49:13 -05:00
|
|
|
|
2014-10-29 02:41:22 -04:00
|
|
|
DEBUG_LOG(KERNEL, "called");
|
|
|
|
}
|
|
|
|
|
2014-06-26 17:58:44 -04:00
|
|
|
const Interface::FunctionInfo FunctionTable[] = {
|
|
|
|
{0x000100C6, nullptr, "Dummy1"},
|
|
|
|
{0x040100C4, nullptr, "Control"},
|
|
|
|
{0x08010002, Initialize, "Initialize"},
|
2014-09-11 18:48:28 -04:00
|
|
|
{0x080201C2, OpenFile, "OpenFile"},
|
2014-06-27 16:18:56 -04:00
|
|
|
{0x08030204, OpenFileDirectly, "OpenFileDirectly"},
|
2014-11-11 13:37:26 -05:00
|
|
|
{0x08040142, DeleteFile, "DeleteFile"},
|
2014-06-26 17:58:44 -04:00
|
|
|
{0x08050244, nullptr, "RenameFile"},
|
2014-11-11 13:37:26 -05:00
|
|
|
{0x08060142, DeleteDirectory, "DeleteDirectory"},
|
2014-06-26 17:58:44 -04:00
|
|
|
{0x08070142, nullptr, "DeleteDirectoryRecursively"},
|
|
|
|
{0x08080202, nullptr, "CreateFile"},
|
2014-10-29 01:52:56 -04:00
|
|
|
{0x08090182, CreateDirectory, "CreateDirectory"},
|
2014-06-26 17:58:44 -04:00
|
|
|
{0x080A0244, nullptr, "RenameDirectory"},
|
2014-09-11 18:48:28 -04:00
|
|
|
{0x080B0102, OpenDirectory, "OpenDirectory"},
|
|
|
|
{0x080C00C2, OpenArchive, "OpenArchive"},
|
2014-06-26 17:58:44 -04:00
|
|
|
{0x080D0144, nullptr, "ControlArchive"},
|
|
|
|
{0x080E0080, nullptr, "CloseArchive"},
|
|
|
|
{0x080F0180, nullptr, "FormatThisUserSaveData"},
|
|
|
|
{0x08100200, nullptr, "CreateSystemSaveData"},
|
|
|
|
{0x08110040, nullptr, "DeleteSystemSaveData"},
|
|
|
|
{0x08120080, nullptr, "GetFreeBytes"},
|
|
|
|
{0x08130000, nullptr, "GetCardType"},
|
|
|
|
{0x08140000, nullptr, "GetSdmcArchiveResource"},
|
|
|
|
{0x08150000, nullptr, "GetNandArchiveResource"},
|
|
|
|
{0x08160000, nullptr, "GetSdmcFatfsErro"},
|
2014-10-29 02:41:22 -04:00
|
|
|
{0x08170000, IsSdmcDetected, "IsSdmcDetected"},
|
2014-06-26 17:58:44 -04:00
|
|
|
{0x08180000, nullptr, "IsSdmcWritable"},
|
|
|
|
{0x08190042, nullptr, "GetSdmcCid"},
|
|
|
|
{0x081A0042, nullptr, "GetNandCid"},
|
|
|
|
{0x081B0000, nullptr, "GetSdmcSpeedInfo"},
|
|
|
|
{0x081C0000, nullptr, "GetNandSpeedInfo"},
|
|
|
|
{0x081D0042, nullptr, "GetSdmcLog"},
|
|
|
|
{0x081E0042, nullptr, "GetNandLog"},
|
|
|
|
{0x081F0000, nullptr, "ClearSdmcLog"},
|
|
|
|
{0x08200000, nullptr, "ClearNandLog"},
|
|
|
|
{0x08210000, nullptr, "CardSlotIsInserted"},
|
|
|
|
{0x08220000, nullptr, "CardSlotPowerOn"},
|
|
|
|
{0x08230000, nullptr, "CardSlotPowerOff"},
|
|
|
|
{0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"},
|
|
|
|
{0x08250040, nullptr, "CardNorDirectCommand"},
|
|
|
|
{0x08260080, nullptr, "CardNorDirectCommandWithAddress"},
|
|
|
|
{0x08270082, nullptr, "CardNorDirectRead"},
|
|
|
|
{0x082800C2, nullptr, "CardNorDirectReadWithAddress"},
|
|
|
|
{0x08290082, nullptr, "CardNorDirectWrite"},
|
|
|
|
{0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"},
|
|
|
|
{0x082B00C2, nullptr, "CardNorDirectRead_4xIO"},
|
|
|
|
{0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"},
|
|
|
|
{0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"},
|
|
|
|
{0x082E0040, nullptr, "GetProductInfo"},
|
|
|
|
{0x082F0040, nullptr, "GetProgramLaunchInfo"},
|
|
|
|
{0x08300182, nullptr, "CreateExtSaveData"},
|
|
|
|
{0x08310180, nullptr, "CreateSharedExtSaveData"},
|
|
|
|
{0x08320102, nullptr, "ReadExtSaveDataIcon"},
|
|
|
|
{0x08330082, nullptr, "EnumerateExtSaveData"},
|
|
|
|
{0x08340082, nullptr, "EnumerateSharedExtSaveData"},
|
|
|
|
{0x08350080, nullptr, "DeleteExtSaveData"},
|
|
|
|
{0x08360080, nullptr, "DeleteSharedExtSaveData"},
|
|
|
|
{0x08370040, nullptr, "SetCardSpiBaudRate"},
|
|
|
|
{0x08380040, nullptr, "SetCardSpiBusMode"},
|
|
|
|
{0x08390000, nullptr, "SendInitializeInfoTo9"},
|
|
|
|
{0x083A0100, nullptr, "GetSpecialContentIndex"},
|
|
|
|
{0x083B00C2, nullptr, "GetLegacyRomHeader"},
|
|
|
|
{0x083C00C2, nullptr, "GetLegacyBannerData"},
|
|
|
|
{0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"},
|
|
|
|
{0x083E00C2, nullptr, "QueryTotalQuotaSize"},
|
|
|
|
{0x083F00C0, nullptr, "GetExtDataBlockSize"},
|
|
|
|
{0x08400040, nullptr, "AbnegateAccessRight"},
|
|
|
|
{0x08410000, nullptr, "DeleteSdmcRoot"},
|
|
|
|
{0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"},
|
|
|
|
{0x08430000, nullptr, "InitializeCtrFileSystem"},
|
|
|
|
{0x08440000, nullptr, "CreateSeed"},
|
|
|
|
{0x084500C2, nullptr, "GetFormatInfo"},
|
|
|
|
{0x08460102, nullptr, "GetLegacyRomHeader2"},
|
|
|
|
{0x08470180, nullptr, "FormatCtrCardUserSaveData"},
|
|
|
|
{0x08480042, nullptr, "GetSdmcCtrRootPath"},
|
|
|
|
{0x08490040, nullptr, "GetArchiveResource"},
|
|
|
|
{0x084A0002, nullptr, "ExportIntegrityVerificationSeed"},
|
|
|
|
{0x084B0002, nullptr, "ImportIntegrityVerificationSeed"},
|
|
|
|
{0x084C0242, nullptr, "FormatSaveData"},
|
|
|
|
{0x084D0102, nullptr, "GetLegacySubBannerData"},
|
|
|
|
{0x084E0342, nullptr, "UpdateSha256Context"},
|
|
|
|
{0x084F0102, nullptr, "ReadSpecialFile"},
|
|
|
|
{0x08500040, nullptr, "GetSpecialFileSize"},
|
|
|
|
{0x08580000, nullptr, "GetMovableSedHashedKeyYRandomData"},
|
|
|
|
{0x08610042, nullptr, "InitializeWithSdkVersion"},
|
|
|
|
{0x08620040, nullptr, "SetPriority"},
|
|
|
|
{0x08630000, nullptr, "GetPriority"},
|
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Interface class
|
|
|
|
|
|
|
|
Interface::Interface() {
|
|
|
|
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
|
|
|
|
}
|
|
|
|
|
|
|
|
Interface::~Interface() {
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|