VERY experimental Nintendo Switch 2 emulator
C++
Rebase
David Marcecf18f3f6b8eef
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cppindex dffd2eefe9..15c156ce18 100644--- a/src/core/hle/service/ns/ns.cpp+++ b/src/core/hle/service/ns/ns.cpp@@ -617,8 +617,7 @@ public:}};-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system,- FileSystem::FileSystemController& fsc) {+void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {std::make_shared<NS>("ns:am2")->InstallAsService(service_manager);std::make_shared<NS>("ns:ec")->InstallAsService(service_manager);@@ -630,7 +629,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& systemstd::make_shared<NS_SU>()->InstallAsService(service_manager);std::make_shared<NS_VM>()->InstallAsService(service_manager);- std::make_shared<PL_U>(system, fsc)->InstallAsService(service_manager);+ std::make_shared<PL_U>(system)->InstallAsService(service_manager);}} // namespace Service::NSdiff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.hindex 4a10c98f99..13a64ad885 100644--- a/src/core/hle/service/ns/ns.h+++ b/src/core/hle/service/ns/ns.h@@ -97,8 +97,7 @@ private:};/// Registers all NS services with the specified service manager.-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system,- FileSystem::FileSystemController& fsc);+void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);} // namespace NS} // namespace Servicediff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cppindex 4f9b843e6b..c91cfa36ea 100644--- a/src/core/hle/service/ns/pl_u.cpp+++ b/src/core/hle/service/ns/pl_u.cpp@@ -145,7 +145,7 @@ struct PL_U::Impl {std::vector<FontRegion> shared_font_regions;};-PL_U::PL_U(Core::System& system, FileSystem::FileSystemController& fsc)+PL_U::PL_U(Core::System& system): ServiceFramework("pl:u"), impl{std::make_unique<Impl>()}, system(system) {static const FunctionInfo functions[] = {@@ -157,6 +157,9 @@ PL_U::PL_U(Core::System& system, FileSystem::FileSystemController& fsc){5, &PL_U::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"},};RegisterHandlers(functions);++ auto& fsc = system.GetFileSystemController();+// Attempt to load shared font data from diskconst auto* nand = fsc.GetSystemNANDContents();std::size_t offset = 0;diff --git a/src/core/hle/service/ns/pl_u.h b/src/core/hle/service/ns/pl_u.hindex 0d38d7d360..d2ef5beadb 100644--- a/src/core/hle/service/ns/pl_u.h+++ b/src/core/hle/service/ns/pl_u.h@@ -20,7 +20,7 @@ void EncryptSharedFont(const std::vector<u8>& input, Kernel::PhysicalMemory& outclass PL_U final : public ServiceFramework<PL_U> {public:- PL_U(Core::System& system, FileSystem::FileSystemController& fsc);+ PL_U(Core::System& system);~PL_U() override;private:diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cppindex 906fdc4157..b4e0855027 100644--- a/src/core/hle/service/service.cpp+++ b/src/core/hle/service/service.cpp@@ -198,50 +198,50 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& covoid Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {// NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it// here and pass it into the respective InstallInterfaces functions.- auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming());+ auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming(), system);system.GetFileSystemController().CreateFactories(*system.GetFilesystem(), false);SM::ServiceManager::InstallInterfaces(sm);Account::InstallInterfaces(system);AM::InstallInterfaces(*sm, nv_flinger, system);- AOC::InstallInterfaces(*sm);+ AOC::InstallInterfaces(*sm, system);APM::InstallInterfaces(system);Audio::InstallInterfaces(*sm, system);BCAT::InstallInterfaces(*sm);BPC::InstallInterfaces(*sm);- BtDrv::InstallInterfaces(*sm);- BTM::InstallInterfaces(*sm);+ BtDrv::InstallInterfaces(*sm, system);+ BTM::InstallInterfaces(*sm, system);Capture::InstallInterfaces(*sm);ERPT::InstallInterfaces(*sm);ES::InstallInterfaces(*sm);EUPLD::InstallInterfaces(*sm);- Fatal::InstallInterfaces(*sm);+ Fatal::InstallInterfaces(*sm, system);FGM::InstallInterfaces(*sm);FileSystem::InstallInterfaces(system);- Friend::InstallInterfaces(*sm);+ Friend::InstallInterfaces(*sm, system);Glue::InstallInterfaces(system);GRC::InstallInterfaces(*sm);- HID::InstallInterfaces(*sm);+ HID::InstallInterfaces(*sm, system);LBL::InstallInterfaces(*sm);LDN::InstallInterfaces(*sm);- LDR::InstallInterfaces(*sm);+ LDR::InstallInterfaces(*sm, system);LM::InstallInterfaces(*sm);Migration::InstallInterfaces(*sm);Mii::InstallInterfaces(*sm);MM::InstallInterfaces(*sm);NCM::InstallInterfaces(*sm);NFC::InstallInterfaces(*sm);- NFP::InstallInterfaces(*sm);- NIFM::InstallInterfaces(*sm);- NIM::InstallInterfaces(*sm);+ NFP::InstallInterfaces(*sm, system);+ NIFM::InstallInterfaces(*sm, system);+ NIM::InstallInterfaces(*sm, system);NPNS::InstallInterfaces(*sm);- NS::InstallInterfaces(*sm, system.GetFileSystemController());+ NS::InstallInterfaces(*sm, system);Nvidia::InstallInterfaces(*sm, *nv_flinger, system);PCIe::InstallInterfaces(*sm);PCTL::InstallInterfaces(*sm);PCV::InstallInterfaces(*sm);- PlayReport::InstallInterfaces(system);+ PlayReport::InstallInterfaces(*sm, system);PM::InstallInterfaces(system);PSC::InstallInterfaces(*sm);PSM::InstallInterfaces(*sm);