summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2021-06-16 01:59:10 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-06-28 16:08:08 +0200
commit844e0114b07f38feaf948d66a1336d350cfa6c6d (patch)
tree054ecb8b45f2a550c2f8001a1b3abbd42afb9c04
parentcore: Support LayeredFS mod from SDMC directory (diff)
downloadyuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.tar
yuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.tar.gz
yuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.tar.bz2
yuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.tar.lz
yuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.tar.xz
yuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.tar.zst
yuzu-844e0114b07f38feaf948d66a1336d350cfa6c6d.zip
-rw-r--r--src/core/file_sys/patch_manager.cpp25
-rw-r--r--src/core/file_sys/sdmc_factory.cpp3
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp3
3 files changed, 10 insertions, 21 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 6f5aa6da2..13d294ad8 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -529,26 +529,13 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u
}
}
- // SDMC mod directory (LayeredFS)
+ // SDMC mod directory (RomFS LayeredFS)
const auto sdmc_mod_dir = fs_controller.GetSDMCModificationLoadRoot(title_id);
- if (sdmc_mod_dir != nullptr && sdmc_mod_dir->GetSize() > 0) {
- std::string types;
-
- const auto exefs_dir = FindSubdirectoryCaseless(sdmc_mod_dir, "exefs");
- if (IsDirValidAndNonEmpty(exefs_dir)) {
- bool layeredfs = false;
-
- if (layeredfs)
- AppendCommaIfNotEmpty(types, "LayeredExeFS");
- }
- if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfs")))
- AppendCommaIfNotEmpty(types, "LayeredFS");
-
- if (!types.empty()) {
- const auto mod_disabled =
- std::find(disabled.begin(), disabled.end(), "SDMC") != disabled.end();
- out.insert_or_assign(mod_disabled ? "[D] SDMC" : "SDMC", types);
- }
+ if (sdmc_mod_dir != nullptr && sdmc_mod_dir->GetSize() > 0 &&
+ IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfs"))) {
+ const auto mod_disabled =
+ std::find(disabled.begin(), disabled.end(), "SDMC") != disabled.end();
+ out.insert_or_assign(mod_disabled ? "[D] SDMC" : "SDMC", "LayeredFS");
}
// DLC
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp
index f4dba8f16..7e878123c 100644
--- a/src/core/file_sys/sdmc_factory.cpp
+++ b/src/core/file_sys/sdmc_factory.cpp
@@ -29,8 +29,9 @@ ResultVal<VirtualDir> SDMCFactory::Open() const {
VirtualDir SDMCFactory::GetSDMCModificationLoadRoot(u64 title_id) const {
// LayeredFS doesn't work on updates and title id-less homebrew
- if (title_id == 0 || (title_id & 0xFFF) == 0x800)
+ if (title_id == 0 || (title_id & 0xFFF) == 0x800) {
return nullptr;
+ }
return GetOrCreateDirectoryRelative(dir, fmt::format("/atmosphere/contents/{:016X}", title_id));
}
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 9191f19fe..d66e74d3a 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -706,8 +706,9 @@ FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id)
FileSys::VirtualDir FileSystemController::GetSDMCModificationLoadRoot(u64 title_id) const {
LOG_TRACE(Service_FS, "Opening SDMC mod load root for tid={:016X}", title_id);
- if (sdmc_factory == nullptr)
+ if (sdmc_factory == nullptr) {
return nullptr;
+ }
return sdmc_factory->GetSDMCModificationLoadRoot(title_id);
}