summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem/romfs_controller.cpp
blob: 19c9cec722aad2d990c3d9ac0a7be5aedffd8fb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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