summaryrefslogtreecommitdiff
path: root/src/core/loader/nca.h
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-06-21 11:16:23 -0400
committerGravatar bunnei2018-06-21 11:16:23 -0400
commit63f26d5c40adb49094b03b232528672f526afe49 (patch)
treeb76a154e17c819df7803d5860f08406446507a5c /src/core/loader/nca.h
parentMerge pull request #576 from Subv/warnings1 (diff)
downloadyuzu-63f26d5c40adb49094b03b232528672f526afe49.tar.gz
yuzu-63f26d5c40adb49094b03b232528672f526afe49.tar.xz
yuzu-63f26d5c40adb49094b03b232528672f526afe49.zip
Add support for decrypted NCA files (#567)
* Start to add NCA support in loader * More nca stuff * More changes to nca.cpp * Now identifies decrypted NCA cont. * Game list fixes and more structs and stuff * More updates to Nca class * Now reads ExeFs (i think) * ACTUALLY LOADS EXEFS! * RomFS loads and games execute * Cleanup and Finalize * plumbing, cleanup and testing * fix some things that i didnt think of before * Preliminary Review Changes * Review changes for bunnei and subv
Diffstat (limited to 'src/core/loader/nca.h')
-rw-r--r--src/core/loader/nca.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h
new file mode 100644
index 000000000..3b6c451d0
--- /dev/null
+++ b/src/core/loader/nca.h
@@ -0,0 +1,49 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <string>
8#include "common/common_types.h"
9#include "core/file_sys/partition_filesystem.h"
10#include "core/file_sys/program_metadata.h"
11#include "core/hle/kernel/kernel.h"
12#include "core/loader/loader.h"
13
14namespace Loader {
15
16class Nca;
17
18/// Loads an NCA file
19class AppLoader_NCA final : public AppLoader {
20public:
21 AppLoader_NCA(FileUtil::IOFile&& file, std::string filepath);
22
23 /**
24 * Returns the type of the file
25 * @param file FileUtil::IOFile open file
26 * @param filepath Path of the file that we are opening.
27 * @return FileType found, or FileType::Error if this loader doesn't know it
28 */
29 static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath);
30
31 FileType GetFileType() override {
32 return IdentifyType(file, filepath);
33 }
34
35 ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
36
37 ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
38 u64& size) override;
39
40 ~AppLoader_NCA();
41
42private:
43 std::string filepath;
44 FileSys::ProgramMetadata metadata;
45
46 std::unique_ptr<Nca> nca;
47};
48
49} // namespace Loader