mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 10:42:47 +01:00
Archives: Addressed some comments
This commit is contained in:
parent
123a76c9c8
commit
5244ac0e9c
5 changed files with 15 additions and 15 deletions
|
@ -17,19 +17,19 @@
|
||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
static std::string GetSaveDataContainerPath(const std::string& mount_point) {
|
static std::string GetSaveDataContainerPath(const std::string& sdmc_directory) {
|
||||||
return Common::StringFromFormat("%sNintendo 3DS/%s/%s/title/", mount_point.c_str(),
|
return Common::StringFromFormat("%sNintendo 3DS/%s/%s/title/", sdmc_directory.c_str(),
|
||||||
SYSTEM_ID.c_str(), SDCARD_ID.c_str());
|
SYSTEM_ID.c_str(), SDCARD_ID.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string GetSaveDataPath(const std::string& mount_point, u64 program_id) {
|
static std::string GetSaveDataPath(const std::string& mount_location, u64 program_id) {
|
||||||
u32 high = program_id >> 32;
|
u32 high = program_id >> 32;
|
||||||
u32 low = program_id & 0xFFFFFFFF;
|
u32 low = program_id & 0xFFFFFFFF;
|
||||||
return Common::StringFromFormat("%s%08x/%08x/data/00000001/", mount_point.c_str(), high, low);
|
return Common::StringFromFormat("%s%08x/%08x/data/00000001/", mount_location.c_str(), high, low);
|
||||||
}
|
}
|
||||||
|
|
||||||
Archive_SaveData::Archive_SaveData(const std::string& mount_point)
|
Archive_SaveData::Archive_SaveData(const std::string& sdmc_directory)
|
||||||
: DiskArchive(GetSaveDataContainerPath(mount_point)) {
|
: DiskArchive(GetSaveDataContainerPath(sdmc_directory)) {
|
||||||
LOG_INFO(Service_FS, "Directory %s set as SaveData.", this->mount_point.c_str());
|
LOG_INFO(Service_FS, "Directory %s set as SaveData.", this->mount_point.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
static std::string GetSaveDataCheckContainerPath(const std::string& mount_point) {
|
static std::string GetSaveDataCheckContainerPath(const std::string& nand_directory) {
|
||||||
return Common::StringFromFormat("%s%s/title/", mount_point.c_str(), SYSTEM_ID.c_str());
|
return Common::StringFromFormat("%s%s/title/", nand_directory.c_str(), SYSTEM_ID.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high, u32 low) {
|
static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high, u32 low) {
|
||||||
|
@ -21,8 +21,8 @@ static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high
|
||||||
mount_point.c_str(), high, low);
|
mount_point.c_str(), high, low);
|
||||||
}
|
}
|
||||||
|
|
||||||
Archive_SaveDataCheck::Archive_SaveDataCheck(const std::string& mount_loc) :
|
Archive_SaveDataCheck::Archive_SaveDataCheck(const std::string& nand_directory) :
|
||||||
mount_point(GetSaveDataCheckContainerPath(mount_loc)) {
|
mount_point(GetSaveDataCheckContainerPath(nand_directory)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultCode Archive_SaveDataCheck::Open(const Path& path) {
|
ResultCode Archive_SaveDataCheck::Open(const Path& path) {
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
Archive_SDMC::Archive_SDMC(const std::string& mount_point) : DiskArchive(mount_point) {
|
Archive_SDMC::Archive_SDMC(const std::string& sdmc_directory) : DiskArchive(sdmc_directory) {
|
||||||
LOG_INFO(Service_FS, "Directory %s set as SDMC.", mount_point.c_str());
|
LOG_INFO(Service_FS, "Directory %s set as SDMC.", sdmc_directory.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Archive_SDMC::Initialize() {
|
bool Archive_SDMC::Initialize() {
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace std {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// TODO(Subv): Confirm length of these strings
|
||||||
const std::string SYSTEM_ID = "00000000000000000000000000000000";
|
const std::string SYSTEM_ID = "00000000000000000000000000000000";
|
||||||
const std::string SDCARD_ID = "00000000000000000000000000000000";
|
const std::string SDCARD_ID = "00000000000000000000000000000000";
|
||||||
|
|
||||||
|
@ -436,8 +437,7 @@ void ArchiveInit() {
|
||||||
next_handle = 1;
|
next_handle = 1;
|
||||||
|
|
||||||
// TODO(Link Mauve): Add the other archive types (see here for the known types:
|
// TODO(Link Mauve): Add the other archive types (see here for the known types:
|
||||||
// http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes). Currently the only half-finished
|
// http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes).
|
||||||
// archive type is SDMC, so it is the only one getting exposed.
|
|
||||||
|
|
||||||
std::string sdmc_directory = FileUtil::GetUserPath(D_SDMC_IDX);
|
std::string sdmc_directory = FileUtil::GetUserPath(D_SDMC_IDX);
|
||||||
std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX);
|
std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX);
|
||||||
|
|
Loading…
Reference in a new issue