From 1966f7b0ad275e9ef8ea26de32b4fda8129e0998 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 20 Sep 2014 15:11:38 -0700 Subject: [PATCH] Use the citra user path for the sdmc directory --- src/common/common_paths.h | 1 + src/common/file_util.cpp | 2 ++ src/common/file_util.h | 1 + src/core/hle/kernel/archive.cpp | 3 +-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/common_paths.h b/src/common/common_paths.h index a36de92276..7cd5b1f352 100644 --- a/src/common/common_paths.h +++ b/src/common/common_paths.h @@ -52,6 +52,7 @@ #define GAMECONFIG_DIR "game_config" #define MAPS_DIR "maps" #define CACHE_DIR "cache" +#define SDMC_DIR "sdmc" #define SHADERCACHE_DIR "shader_cache" #define STATESAVES_DIR "state_saves" #define SCREENSHOTS_DIR "screenShots" diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index ecfccbd666..40cd32d96d 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -672,6 +672,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new paths[D_GAMECONFIG_IDX] = paths[D_USER_IDX] + GAMECONFIG_DIR DIR_SEP; paths[D_MAPS_IDX] = paths[D_USER_IDX] + MAPS_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_SHADERCACHE_IDX] = paths[D_USER_IDX] + SHADERCACHE_DIR DIR_SEP; paths[D_SHADERS_IDX] = paths[D_USER_IDX] + SHADERS_DIR DIR_SEP; paths[D_STATESAVES_IDX] = paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP; @@ -712,6 +713,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new paths[D_GAMECONFIG_IDX] = paths[D_USER_IDX] + GAMECONFIG_DIR DIR_SEP; paths[D_MAPS_IDX] = paths[D_USER_IDX] + MAPS_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_SHADERCACHE_IDX] = paths[D_USER_IDX] + SHADERCACHE_DIR DIR_SEP; paths[D_SHADERS_IDX] = paths[D_USER_IDX] + SHADERS_DIR DIR_SEP; paths[D_STATESAVES_IDX] = paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP; diff --git a/src/common/file_util.h b/src/common/file_util.h index 897cbd77e1..cddcd19519 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -25,6 +25,7 @@ enum { D_SHADERS_IDX, D_STATESAVES_IDX, D_SCREENSHOTS_IDX, + D_SDMC_IDX, D_HIRESTEXTURES_IDX, D_DUMP_IDX, D_DUMPFRAMES_IDX, diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index a7fa661d6d..fa49729945 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp @@ -394,8 +394,7 @@ void ArchiveInit() { // http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes). Currently the only half-finished // archive type is SDMC, so it is the only one getting exposed. - // TODO(Link Mauve): don't assume the path separator is '/'. - std::string sdmc_directory = FileUtil::GetCurrentDir() + "/userdata/sdmc"; + std::string sdmc_directory = FileUtil::GetUserPath(D_SDMC_IDX); auto archive = new FileSys::Archive_SDMC(sdmc_directory); if (archive->Initialize()) CreateArchive(archive, "SDMC");