1
1
Fork 0
forked from suyu/suyu

Archives: Change the folder layout of some archives.

This is to better represent the hardware layout, they are still aren't quite accurate, but this better and will help a bit when implementing the other archives like NAND-RO and NAND-RW
This commit is contained in:
Subv 2014-12-31 21:43:31 -05:00
parent 031237e52c
commit 3bc9f5509b
6 changed files with 27 additions and 24 deletions

View file

@ -35,26 +35,27 @@
#define JAP_DIR "JAP" #define JAP_DIR "JAP"
// Subdirs in the User dir returned by GetUserPath(D_USER_IDX) // Subdirs in the User dir returned by GetUserPath(D_USER_IDX)
#define CONFIG_DIR "config" #define CONFIG_DIR "config"
#define GAMECONFIG_DIR "game_config" #define GAMECONFIG_DIR "game_config"
#define MAPS_DIR "maps" #define MAPS_DIR "maps"
#define CACHE_DIR "cache" #define CACHE_DIR "cache"
#define SDMC_DIR "sdmc" #define SDMC_DIR "sdmc"
#define EXTSAVEDATA_DIR "extsavedata" #define EXTSAVEDATA_DIR "sdmc/Nintendo 3DS/extdata"
#define SAVEDATA_DIR "savedata" #define SHAREDEXTSAVEDATA_DIR "nand/data/extdata"
#define SAVEDATACHECK_DIR "savedatacheck" #define SAVEDATA_DIR "savedata"
#define SYSDATA_DIR "sysdata" #define SAVEDATACHECK_DIR "savedatacheck"
#define SYSSAVEDATA_DIR "syssavedata" #define SYSDATA_DIR "sysdata"
#define SHADERCACHE_DIR "shader_cache" #define SYSSAVEDATA_DIR "nand/data/sysdata"
#define STATESAVES_DIR "state_saves" #define SHADERCACHE_DIR "shader_cache"
#define SCREENSHOTS_DIR "screenShots" #define STATESAVES_DIR "state_saves"
#define DUMP_DIR "dump" #define SCREENSHOTS_DIR "screenShots"
#define DUMP_TEXTURES_DIR "textures" #define DUMP_DIR "dump"
#define DUMP_FRAMES_DIR "frames" #define DUMP_TEXTURES_DIR "textures"
#define DUMP_AUDIO_DIR "audio" #define DUMP_FRAMES_DIR "frames"
#define LOGS_DIR "logs" #define DUMP_AUDIO_DIR "audio"
#define SHADERS_DIR "shaders" #define LOGS_DIR "logs"
#define SYSCONF_DIR "sysconf" #define SHADERS_DIR "shaders"
#define SYSCONF_DIR "sysconf"
// Filenames // Filenames
// Files in the directory returned by GetUserPath(D_CONFIG_IDX) // Files in the directory returned by GetUserPath(D_CONFIG_IDX)

View file

@ -677,6 +677,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP; paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP;
paths[D_SDMC_IDX] = paths[D_USER_IDX] + SDMC_DIR DIR_SEP; paths[D_SDMC_IDX] = paths[D_USER_IDX] + SDMC_DIR DIR_SEP;
paths[D_EXTSAVEDATA] = paths[D_USER_IDX] + EXTSAVEDATA_DIR DIR_SEP; paths[D_EXTSAVEDATA] = paths[D_USER_IDX] + EXTSAVEDATA_DIR DIR_SEP;
paths[D_SHAREDEXTSAVEDATA] = paths[D_USER_IDX] + SHAREDEXTSAVEDATA_DIR DIR_SEP;
paths[D_SAVEDATA_IDX] = paths[D_USER_IDX] + SAVEDATA_DIR DIR_SEP; paths[D_SAVEDATA_IDX] = paths[D_USER_IDX] + SAVEDATA_DIR DIR_SEP;
paths[D_SAVEDATACHECK_IDX] = paths[D_USER_IDX] + SAVEDATACHECK_DIR DIR_SEP; paths[D_SAVEDATACHECK_IDX] = paths[D_USER_IDX] + SAVEDATACHECK_DIR DIR_SEP;
paths[D_SYSDATA_IDX] = paths[D_USER_IDX] + SYSDATA_DIR DIR_SEP; paths[D_SYSDATA_IDX] = paths[D_USER_IDX] + SYSDATA_DIR DIR_SEP;
@ -723,6 +724,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP; paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP;
paths[D_SDMC_IDX] = paths[D_USER_IDX] + SDMC_DIR DIR_SEP; paths[D_SDMC_IDX] = paths[D_USER_IDX] + SDMC_DIR DIR_SEP;
paths[D_EXTSAVEDATA] = paths[D_USER_IDX] + EXTSAVEDATA_DIR DIR_SEP; paths[D_EXTSAVEDATA] = paths[D_USER_IDX] + EXTSAVEDATA_DIR DIR_SEP;
paths[D_SHAREDEXTSAVEDATA] = paths[D_USER_IDX] + SHAREDEXTSAVEDATA_DIR DIR_SEP;
paths[D_SAVEDATA_IDX] = paths[D_USER_IDX] + SAVEDATA_DIR DIR_SEP; paths[D_SAVEDATA_IDX] = paths[D_USER_IDX] + SAVEDATA_DIR DIR_SEP;
paths[D_SAVEDATACHECK_IDX] = paths[D_USER_IDX] + SAVEDATACHECK_DIR DIR_SEP; paths[D_SAVEDATACHECK_IDX] = paths[D_USER_IDX] + SAVEDATACHECK_DIR DIR_SEP;
paths[D_SYSSAVEDATA_IDX] = paths[D_USER_IDX] + SYSSAVEDATA_DIR DIR_SEP; paths[D_SYSSAVEDATA_IDX] = paths[D_USER_IDX] + SYSSAVEDATA_DIR DIR_SEP;

View file

@ -28,6 +28,7 @@ enum {
D_SCREENSHOTS_IDX, D_SCREENSHOTS_IDX,
D_SDMC_IDX, D_SDMC_IDX,
D_EXTSAVEDATA, D_EXTSAVEDATA,
D_SHAREDEXTSAVEDATA,
D_SAVEDATA_IDX, D_SAVEDATA_IDX,
D_SAVEDATACHECK_IDX, D_SAVEDATACHECK_IDX,
D_SYSDATA_IDX, D_SYSDATA_IDX,

View file

@ -19,10 +19,9 @@ namespace FileSys {
static std::string GetExtSaveDataPath(const std::string& mount_point, const Path& path) { static std::string GetExtSaveDataPath(const std::string& mount_point, const Path& path) {
std::vector<u8> vec_data = path.AsBinary(); std::vector<u8> vec_data = path.AsBinary();
const u32* data = reinterpret_cast<const u32*>(vec_data.data()); const u32* data = reinterpret_cast<const u32*>(vec_data.data());
u32 media_type = data[0];
u32 save_low = data[1]; u32 save_low = data[1];
u32 save_high = data[2]; u32 save_high = data[2];
return Common::StringFromFormat("%s%s/%08X/%08X/", mount_point.c_str(), media_type == 0 ? "nand" : "sdmc", save_high, save_low); return Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), save_high, save_low);
} }
Archive_ExtSaveData::Archive_ExtSaveData(const std::string& mount_point) Archive_ExtSaveData::Archive_ExtSaveData(const std::string& mount_point)

View file

@ -455,7 +455,7 @@ void ArchiveInit() {
else else
LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path %s", extsavedata_directory.c_str()); LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path %s", extsavedata_directory.c_str());
std::string sharedextsavedata_directory = FileUtil::GetUserPath(D_EXTSAVEDATA); std::string sharedextsavedata_directory = FileUtil::GetUserPath(D_SHAREDEXTSAVEDATA);
auto sharedextsavedata_archive = Common::make_unique<FileSys::Archive_ExtSaveData>(sharedextsavedata_directory); auto sharedextsavedata_archive = Common::make_unique<FileSys::Archive_ExtSaveData>(sharedextsavedata_directory);
if (sharedextsavedata_archive->Initialize()) if (sharedextsavedata_archive->Initialize())
CreateArchive(std::move(sharedextsavedata_archive), ArchiveIdCode::SharedExtSaveData); CreateArchive(std::move(sharedextsavedata_archive), ArchiveIdCode::SharedExtSaveData);

View file

@ -142,7 +142,7 @@ Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable)); Register(FunctionTable, ARRAY_SIZE(FunctionTable));
// Create the SharedExtSaveData archive 0xF000000B and the gamecoin.dat file // Create the SharedExtSaveData archive 0xF000000B and the gamecoin.dat file
// TODO(Subv): In the future we should use the FS service to query this archive // TODO(Subv): In the future we should use the FS service to query this archive
std::string extsavedata_directory = FileUtil::GetUserPath(D_EXTSAVEDATA); std::string extsavedata_directory = FileUtil::GetUserPath(D_SHAREDEXTSAVEDATA);
ptm_shared_extsavedata = Common::make_unique<FileSys::Archive_ExtSaveData>(extsavedata_directory); ptm_shared_extsavedata = Common::make_unique<FileSys::Archive_ExtSaveData>(extsavedata_directory);
if (!ptm_shared_extsavedata->Initialize()) { if (!ptm_shared_extsavedata->Initialize()) {
LOG_CRITICAL(Service_PTM, "Could not initialize ExtSaveData archive for the PTM:U service"); LOG_CRITICAL(Service_PTM, "Could not initialize ExtSaveData archive for the PTM:U service");