diff options
Diffstat (limited to 'src/core/loader/ncch.h')
-rw-r--r-- | src/core/loader/ncch.h | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index 126eb4c80..bf65425a4 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -156,35 +156,66 @@ public: */ ResultStatus Load(); -private: + /** + * Get the code (typically .code section) of the application + * @param error ResultStatus result of function + * @return Reference to code buffer + */ + const std::vector<u8>& ReadCode(ResultStatus& error); /** - * Reads an application ExeFS section of an NCCH file into AppLoader (e.g. .code, .logo, etc.) - * @param file Handle to file to read from - * @param name Name of section to read out of NCCH file - * @param buffer Buffer to read section into. - * @return ResultStatus result of function + * Get the icon (typically icon section) of the application + * @param error ResultStatus result of function + * @return Reference to icon buffer */ - ResultStatus LoadSectionExeFS(File::IOFile& file, const char* name, std::vector<u8>& buffer); + const std::vector<u8>& ReadIcon(ResultStatus& error); /** - * Reads RomFS of an NCCH file into AppLoader - * @param file Handle to file to read from - * @return ResultStatus result of function + * Get the banner (typically banner section) of the application + * @param error ResultStatus result of function + * @return Reference to banner buffer + */ + const std::vector<u8>& ReadBanner(ResultStatus& error); + + /** + * Get the logo (typically logo section) of the application + * @param error ResultStatus result of function + * @return Reference to logo buffer */ - ResultStatus LoadRomFS(File::IOFile& file); + const std::vector<u8>& ReadLogo(ResultStatus& error); + + /** + * Get the RomFs archive of the application + * @param error ResultStatus result of function + * @return Reference to RomFs archive buffer + */ + const std::vector<u8>& ReadRomFS(ResultStatus& error); + +private: + + /** + * Reads an application ExeFS section of an NCCH file into AppLoader (e.g. .code, .logo, etc.) + * @param name Name of section to read out of NCCH file + * @param buffer Vector to read data into + * @param error ResultStatus result of function + * @return Reference to buffer of data that was read + */ + const std::vector<u8>& LoadSectionExeFS(const char* name, std::vector<u8>& buffer, + ResultStatus& error); /** * Loads .code section into memory for booting * @return ResultStatus result of function */ - ResultStatus LoadExec() const; + ResultStatus LoadExec(); + File::IOFile file; std::string filename; + bool is_loaded; bool is_compressed; - u32 entry_point; + u32 entry_point; u32 ncch_offset; // Offset to NCCH header, can be 0 or after NCSD header u32 exefs_offset; |