summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-10-06 19:02:23 +0200
committerLioncash <mathew1800@gmail.com>2019-10-06 19:42:23 +0200
commit69f16ba50e3c52a17405670b976ac4ba63f58021 (patch)
treee64b63528a155da323ea02039ede638fb6994ecd /src/core/hle/service/filesystem
parentMerge pull request #2942 from ReinUsesLisp/clang-warnings (diff)
downloadyuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.tar
yuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.tar.gz
yuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.tar.bz2
yuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.tar.lz
yuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.tar.xz
yuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.tar.zst
yuzu-69f16ba50e3c52a17405670b976ac4ba63f58021.zip
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp20
-rw-r--r--src/core/hle/service/filesystem/filesystem.h8
2 files changed, 17 insertions, 11 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 7fa4e820b..11e5c56b7 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -241,7 +241,7 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType(
return FileSys::ERROR_PATH_NOT_FOUND;
}
-FileSystemController::FileSystemController() = default;
+FileSystemController::FileSystemController(Core::System& system_) : system{system_} {}
FileSystemController::~FileSystemController() = default;
@@ -290,7 +290,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess()
return ResultCode(-1);
}
- return romfs_factory->OpenCurrentProcess();
+ return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID());
}
ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS(
@@ -447,10 +447,10 @@ FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataTy
FileSys::SaveDataSize new_size{SUFFICIENT_SAVE_DATA_SIZE, SUFFICIENT_SAVE_DATA_SIZE};
FileSys::NACP nacp;
- const auto res = Core::System::GetInstance().GetAppLoader().ReadControlData(nacp);
+ const auto res = system.GetAppLoader().ReadControlData(nacp);
if (res != Loader::ResultStatus::Success) {
- FileSys::PatchManager pm{Core::CurrentProcess()->GetTitleID()};
+ FileSys::PatchManager pm{system.CurrentProcess()->GetTitleID()};
auto [nacp_unique, discard] = pm.GetControlMetadata();
if (nacp_unique != nullptr) {
@@ -702,10 +702,10 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
if (bis_factory == nullptr) {
bis_factory =
std::make_unique<FileSys::BISFactory>(nand_directory, load_directory, dump_directory);
- Core::System::GetInstance().RegisterContentProvider(
- FileSys::ContentProviderUnionSlot::SysNAND, bis_factory->GetSystemNANDContents());
- Core::System::GetInstance().RegisterContentProvider(
- FileSys::ContentProviderUnionSlot::UserNAND, bis_factory->GetUserNANDContents());
+ system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::SysNAND,
+ bis_factory->GetSystemNANDContents());
+ system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::UserNAND,
+ bis_factory->GetUserNANDContents());
}
if (save_data_factory == nullptr) {
@@ -714,8 +714,8 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
if (sdmc_factory == nullptr) {
sdmc_factory = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory));
- Core::System::GetInstance().RegisterContentProvider(FileSys::ContentProviderUnionSlot::SDMC,
- sdmc_factory->GetSDMCContents());
+ system.RegisterContentProvider(FileSys::ContentProviderUnionSlot::SDMC,
+ sdmc_factory->GetSDMCContents());
}
}
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index e6b49d8a2..1b0a6a949 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -10,6 +10,10 @@
#include "core/file_sys/vfs.h"
#include "core/hle/result.h"
+namespace Core {
+class System;
+}
+
namespace FileSys {
class BISFactory;
class RegisteredCache;
@@ -52,7 +56,7 @@ enum class ImageDirectoryId : u32 {
class FileSystemController {
public:
- FileSystemController();
+ explicit FileSystemController(Core::System& system_);
~FileSystemController();
ResultCode RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory);
@@ -125,6 +129,8 @@ private:
std::unique_ptr<FileSys::XCI> gamecard;
std::unique_ptr<FileSys::RegisteredCache> gamecard_registered;
std::unique_ptr<FileSys::PlaceholderCache> gamecard_placeholder;
+
+ Core::System& system;
};
void InstallInterfaces(Core::System& system);