mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-26 00:56:45 +00:00
[fs/core] Load external content without NAND install (#2862)
Adds the capability to add DLC and Updates without installing them to NAND. This was tested on Windows only and needs Android integration. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: wildcard <wildcard@eden-emu.dev> Co-authored-by: nekle <nekle@protonmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2862 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/bis_factory.h"
|
||||
@@ -507,6 +508,10 @@ FileSys::RegisteredCache* FileSystemController::GetSDMCContents() const {
|
||||
return sdmc_factory->GetSDMCContents();
|
||||
}
|
||||
|
||||
FileSys::ExternalContentProvider* FileSystemController::GetExternalContentProvider() const {
|
||||
return external_provider.get();
|
||||
}
|
||||
|
||||
FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() const {
|
||||
LOG_TRACE(Service_FS, "Opening System NAND Placeholder");
|
||||
|
||||
@@ -684,6 +689,7 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
|
||||
if (overwrite) {
|
||||
bis_factory = nullptr;
|
||||
sdmc_factory = nullptr;
|
||||
external_provider = nullptr;
|
||||
}
|
||||
|
||||
using EdenPath = Common::FS::EdenPath;
|
||||
@@ -716,6 +722,36 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
|
||||
system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::SDMC,
|
||||
sdmc_factory->GetSDMCContents());
|
||||
}
|
||||
|
||||
if (external_provider == nullptr) {
|
||||
std::vector<FileSys::VirtualDir> external_dirs;
|
||||
|
||||
LOG_DEBUG(Service_FS, "Initializing ExternalContentProvider with {} configured directories",
|
||||
Settings::values.external_content_dirs.size());
|
||||
|
||||
for (const auto& dir_path : Settings::values.external_content_dirs) {
|
||||
if (!dir_path.empty()) {
|
||||
LOG_DEBUG(Service_FS, "Attempting to open directory: {}", dir_path);
|
||||
auto dir = vfs.OpenDirectory(dir_path, FileSys::OpenMode::Read);
|
||||
if (dir != nullptr) {
|
||||
external_dirs.push_back(std::move(dir));
|
||||
LOG_DEBUG(Service_FS, "Successfully opened directory: {}", dir_path);
|
||||
} else {
|
||||
LOG_ERROR(Service_FS, "Failed to open directory: {}", dir_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG(Service_FS, "Creating ExternalContentProvider with {} opened directories",
|
||||
external_dirs.size());
|
||||
|
||||
external_provider = std::make_unique<FileSys::ExternalContentProvider>(
|
||||
std::move(external_dirs));
|
||||
system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::External,
|
||||
external_provider.get());
|
||||
|
||||
LOG_DEBUG(Service_FS, "ExternalContentProvider registered to content provider union");
|
||||
}
|
||||
}
|
||||
|
||||
void FileSystemController::Reset() {
|
||||
|
||||
Reference in New Issue
Block a user