Add GetModule() helper functions, for HID, CAM, and CFG

This commit is contained in:
B3n30
2018-10-12 11:50:50 +02:00
parent 1b1de23a98
commit eb3af0f16a
12 changed files with 49 additions and 51 deletions

View File

@@ -137,7 +137,7 @@ void Module::Interface::GetCountryCodeString(Kernel::HLERequestContext& ctx) {
rb.Push<u32>(country_codes[country_code_id]);
}
std::shared_ptr<Module> Module::Interface::GetModule() const {
std::shared_ptr<Module> Module::Interface::Interface::GetModule() const {
return cfg;
}
@@ -718,6 +718,13 @@ u64 Module::GetConsoleUniqueId() {
return console_id_le;
}
std::shared_ptr<Module> GetModule(Core::System& system) {
auto cfg = system.ServiceManager().GetService<Service::CFG::Module::Interface>("cfg:u");
if (!cfg)
return nullptr;
return cfg->GetModule();
}
void InstallInterfaces(Core::System& system) {
auto& service_manager = system.ServiceManager();
auto cfg = std::make_shared<Module>();

View File

@@ -411,6 +411,8 @@ private:
u32 preferred_region_code = 0;
};
std::shared_ptr<Module> GetModule(Core::System& system);
void InstallInterfaces(Core::System& system);
} // namespace Service::CFG