summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ns
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-22 15:38:13 +0200
committerGitHub <noreply@github.com>2019-09-22 15:38:13 +0200
commit4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b (patch)
treecbf3e722bf583a48f851744c8276a2caf0b2e8ef /src/core/hle/service/ns
parentMerge pull request #2870 from FernandoS27/multi-draw (diff)
parentremoved unneeded semicolon (diff)
downloadyuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.gz
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.bz2
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.lz
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.xz
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.zst
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.zip
Diffstat (limited to 'src/core/hle/service/ns')
-rw-r--r--src/core/hle/service/ns/ns.cpp5
-rw-r--r--src/core/hle/service/ns/ns.h3
-rw-r--r--src/core/hle/service/ns/pl_u.cpp10
-rw-r--r--src/core/hle/service/ns/pl_u.h3
4 files changed, 13 insertions, 8 deletions
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp
index 13121c4f1..15c156ce1 100644
--- a/src/core/hle/service/ns/ns.cpp
+++ b/src/core/hle/service/ns/ns.cpp
@@ -617,7 +617,8 @@ public:
}
};
-void InstallInterfaces(SM::ServiceManager& service_manager, 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);
std::make_shared<NS>("ns:rid")->InstallAsService(service_manager);
@@ -628,7 +629,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSyst
std::make_shared<NS_SU>()->InstallAsService(service_manager);
std::make_shared<NS_VM>()->InstallAsService(service_manager);
- std::make_shared<PL_U>(fsc)->InstallAsService(service_manager);
+ std::make_shared<PL_U>(system)->InstallAsService(service_manager);
}
} // namespace Service::NS
diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h
index d067e7a9a..13a64ad88 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, FileSystem::FileSystemController& fsc);
+void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
} // namespace NS
-
} // namespace Service
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index 9d49f36e8..7dcdb4a07 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -150,8 +150,9 @@ struct PL_U::Impl {
std::vector<FontRegion> shared_font_regions;
};
-PL_U::PL_U(FileSystem::FileSystemController& fsc)
- : ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} {
+PL_U::PL_U(Core::System& system)
+ : ServiceFramework("pl:u"), impl{std::make_unique<Impl>()}, system(system) {
+
static const FunctionInfo functions[] = {
{0, &PL_U::RequestLoad, "RequestLoad"},
{1, &PL_U::GetLoadState, "GetLoadState"},
@@ -161,6 +162,9 @@ PL_U::PL_U(FileSystem::FileSystemController& fsc)
{5, &PL_U::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"},
};
RegisterHandlers(functions);
+
+ auto& fsc = system.GetFileSystemController();
+
// Attempt to load shared font data from disk
const auto* nand = fsc.GetSystemNANDContents();
std::size_t offset = 0;
@@ -325,7 +329,7 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
Kernel::MemoryState::Shared);
// Create shared font memory object
- auto& kernel = Core::System::GetInstance().Kernel();
+ auto& kernel = system.Kernel();
impl->shared_font_mem = Kernel::SharedMemory::Create(
kernel, Core::CurrentProcess(), SHARED_FONT_MEM_SIZE, Kernel::MemoryPermission::ReadWrite,
Kernel::MemoryPermission::Read, SHARED_FONT_MEM_VADDR, Kernel::MemoryRegion::BASE,
diff --git a/src/core/hle/service/ns/pl_u.h b/src/core/hle/service/ns/pl_u.h
index 35ca424d2..1063f4204 100644
--- a/src/core/hle/service/ns/pl_u.h
+++ b/src/core/hle/service/ns/pl_u.h
@@ -17,7 +17,7 @@ namespace NS {
class PL_U final : public ServiceFramework<PL_U> {
public:
- PL_U(FileSystem::FileSystemController& fsc);
+ explicit PL_U(Core::System& system);
~PL_U() override;
private:
@@ -30,6 +30,7 @@ private:
struct Impl;
std::unique_ptr<Impl> impl;
+ Core::System& system;
};
} // namespace NS