summaryrefslogtreecommitdiff
path: root/src/core/loader/ncch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/ncch.h')
-rw-r--r--src/core/loader/ncch.h80
1 files changed, 0 insertions, 80 deletions
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h
deleted file mode 100644
index 09230ae33..000000000
--- a/src/core/loader/ncch.h
+++ /dev/null
@@ -1,80 +0,0 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <memory>
8#include "common/common_types.h"
9#include "common/swap.h"
10#include "core/file_sys/ncch_container.h"
11#include "core/loader/loader.h"
12
13////////////////////////////////////////////////////////////////////////////////////////////////////
14// Loader namespace
15
16namespace Loader {
17
18/// Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI)
19class AppLoader_NCCH final : public AppLoader {
20public:
21 AppLoader_NCCH(FileUtil::IOFile&& file, const std::string& filepath)
22 : AppLoader(std::move(file)), filepath(filepath), base_ncch(filepath),
23 overlay_ncch(&base_ncch) {}
24
25 /**
26 * Returns the type of the file
27 * @param file FileUtil::IOFile open file
28 * @return FileType found, or FileType::Error if this loader doesn't know it
29 */
30 static FileType IdentifyType(FileUtil::IOFile& file);
31
32 FileType GetFileType() override {
33 return IdentifyType(file);
34 }
35
36 ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
37
38 /**
39 * Loads the Exheader and returns the system mode for this application.
40 * @returns A pair with the optional system mode, and and the status.
41 */
42 std::pair<boost::optional<u32>, ResultStatus> LoadKernelSystemMode() override;
43
44 ResultStatus ReadCode(std::vector<u8>& buffer) override;
45
46 ResultStatus ReadIcon(std::vector<u8>& buffer) override;
47
48 ResultStatus ReadBanner(std::vector<u8>& buffer) override;
49
50 ResultStatus ReadLogo(std::vector<u8>& buffer) override;
51
52 ResultStatus ReadProgramId(u64& out_program_id) override;
53
54 ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
55 u64& size) override;
56
57 ResultStatus ReadUpdateRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
58 u64& size) override;
59
60 ResultStatus ReadTitle(std::string& title) override;
61
62private:
63 /**
64 * Loads .code section into memory for booting
65 * @param process The newly created process
66 * @return ResultStatus result of function
67 */
68 ResultStatus LoadExec(Kernel::SharedPtr<Kernel::Process>& process);
69
70 /// Reads the region lockout info in the SMDH and send it to CFG service
71 void ParseRegionLockoutInfo();
72
73 FileSys::NCCHContainer base_ncch;
74 FileSys::NCCHContainer update_ncch;
75 FileSys::NCCHContainer* overlay_ncch;
76
77 std::string filepath;
78};
79
80} // namespace Loader