core/loader: Remove dependencies on the global system instance

Now all that remains is:

18 instances in file_sys code
14 instances in GDB stub code (this can be tossed wholesale)
4 instances in HLE code
2 instances in settings code.
This commit is contained in:
Lioncash 2020-09-16 08:19:25 -04:00
parent 004bfefeb5
commit 113a3972a6
20 changed files with 85 additions and 45 deletions

View file

@ -208,7 +208,7 @@ bool AppLoader_NRO::LoadNro(Kernel::Process& process, const FileSys::VfsFile& fi
return LoadNroImpl(process, file.ReadAllBytes(), file.GetName());
}
AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process) {
AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process, Core::System& system) {
if (is_loaded) {
return {ResultStatus::ErrorAlreadyLoaded, {}};
}
@ -218,7 +218,7 @@ AppLoader_NRO::LoadResult AppLoader_NRO::Load(Kernel::Process& process) {
}
if (romfs != nullptr) {
Core::System::GetInstance().GetFileSystemController().RegisterRomFS(
system.GetFileSystemController().RegisterRomFS(
std::make_unique<FileSys::RomFSFactory>(*this));
}