diff options
| author | Liam <byteslice@airmail.cc> | 2024-01-08 00:49:00 -0500 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2024-01-11 11:28:52 -0500 |
| commit | 2397093e4f40eeca5f7e46a304cd55aec91e6348 (patch) | |
| tree | 050ccc76dd2fad3c3f81197aa6435674caeac86f /src/core/hle/service/filesystem/romfs_controller.cpp | |
| parent | 204f3316f5b77d2dc0456c15f7704547af100561 (diff) | |
fsp-srv: use program registry for SetCurrentProcess
Diffstat (limited to 'src/core/hle/service/filesystem/romfs_controller.cpp')
| -rw-r--r-- | src/core/hle/service/filesystem/romfs_controller.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/romfs_controller.cpp b/src/core/hle/service/filesystem/romfs_controller.cpp new file mode 100644 index 0000000000..19c9cec722 --- /dev/null +++ b/src/core/hle/service/filesystem/romfs_controller.cpp @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/filesystem/romfs_controller.h" + +namespace Service::FileSystem { + +RomFsController::RomFsController(std::shared_ptr<FileSys::RomFSFactory> factory_, u64 program_id_) + : factory{std::move(factory_)}, program_id{program_id_} {} +RomFsController::~RomFsController() = default; + +FileSys::VirtualFile RomFsController::OpenRomFSCurrentProcess() { + return factory->OpenCurrentProcess(program_id); +} + +FileSys::VirtualFile RomFsController::OpenPatchedRomFS(u64 title_id, + FileSys::ContentRecordType type) { + return factory->OpenPatchedRomFS(title_id, type); +} + +FileSys::VirtualFile RomFsController::OpenPatchedRomFSWithProgramIndex( + u64 title_id, u8 program_index, FileSys::ContentRecordType type) { + return factory->OpenPatchedRomFSWithProgramIndex(title_id, program_index, type); +} + +FileSys::VirtualFile RomFsController::OpenRomFS(u64 title_id, FileSys::StorageId storage_id, + FileSys::ContentRecordType type) { + return factory->Open(title_id, storage_id, type); +} + +std::shared_ptr<FileSys::NCA> RomFsController::OpenBaseNca(u64 title_id, + FileSys::StorageId storage_id, + FileSys::ContentRecordType type) { + return factory->GetEntry(title_id, storage_id, type); +} + +} // namespace Service::FileSystem |
