mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 05:15:08 +01:00
Move the loader backing out of the main loader class
The presence of a backing is an implementation detail.
This commit is contained in:
parent
3a23ec06a4
commit
b94248cec0
@ -32,8 +32,6 @@ namespace skyline::loader {
|
||||
size_t size; //!< The total size of the loaded executable
|
||||
};
|
||||
|
||||
std::shared_ptr<vfs::Backing> backing; //!< The backing of the loader
|
||||
|
||||
/**
|
||||
* @brief This loads an executable into memory
|
||||
* @param process The process to load the executable into
|
||||
@ -47,11 +45,6 @@ namespace skyline::loader {
|
||||
std::shared_ptr<vfs::NACP> nacp; //!< The NACP of the current application
|
||||
std::shared_ptr<vfs::Backing> romFs; //!< The RomFS of the current application
|
||||
|
||||
/**
|
||||
* @param backing The backing for the NRO
|
||||
*/
|
||||
Loader(const std::shared_ptr<vfs::Backing> &backing) : backing(backing) {}
|
||||
|
||||
virtual ~Loader() = default;
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "nro.h"
|
||||
|
||||
namespace skyline::loader {
|
||||
NroLoader::NroLoader(const std::shared_ptr<vfs::Backing> &backing) : Loader(backing) {
|
||||
NroLoader::NroLoader(const std::shared_ptr<vfs::Backing> &backing) : backing(backing) {
|
||||
backing->Read(&header);
|
||||
|
||||
if (header.magic != util::MakeMagic<u32>("NRO0"))
|
||||
|
@ -66,6 +66,8 @@ namespace skyline::loader {
|
||||
NroAssetSection romFs; //!< The header describing the location of the RomFS
|
||||
} assetHeader{};
|
||||
|
||||
std::shared_ptr<vfs::Backing> backing; //!< The backing of the NRO loader
|
||||
|
||||
/**
|
||||
* @brief This reads the data of the specified segment
|
||||
* @param segment The header of the segment to read
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "nso.h"
|
||||
|
||||
namespace skyline::loader {
|
||||
NsoLoader::NsoLoader(const std::shared_ptr<vfs::Backing> &backing) : Loader(backing) {
|
||||
NsoLoader::NsoLoader(const std::shared_ptr<vfs::Backing> &backing) : backing(backing) {
|
||||
u32 magic{};
|
||||
backing->Read(&magic);
|
||||
|
||||
|
@ -67,6 +67,8 @@ namespace skyline::loader {
|
||||
};
|
||||
static_assert(sizeof(NsoHeader) == 0x100);
|
||||
|
||||
std::shared_ptr<vfs::Backing> backing; //!< The backing of the NSO loader
|
||||
|
||||
/**
|
||||
* @brief This reads the specified segment from the backing and decompresses it if needed
|
||||
* @param segment The header of the segment to read
|
||||
|
Loading…
Reference in New Issue
Block a user