mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-04 07:38:47 +00:00 
			
		
		
		
	Core: pass down Core::System reference to all services (#4272)
* Core: pass down Core::System reference to all services This has to be done at once due to unified interface used by HLE/LLE switcher * apt: eliminate Core::System::GetInstance * gpu_gsp: eliminate Core::System::GetInstance in service * hid: eliminate Core::System::GetInstance * nwm: eliminate Core::System::GetInstance * err_f: eliminate Core::System::GetInstance
This commit is contained in:
		
							parent
							
								
									008242c5f3
								
							
						
					
					
						commit
						b163502744
					
				
					 77 changed files with 329 additions and 111 deletions
				
			
		| 
						 | 
				
			
			@ -2,6 +2,7 @@
 | 
			
		|||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "core/core.h"
 | 
			
		||||
#include "core/hle/service/nwm/nwm.h"
 | 
			
		||||
#include "core/hle/service/nwm/nwm_cec.h"
 | 
			
		||||
#include "core/hle/service/nwm/nwm_ext.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -13,14 +14,15 @@
 | 
			
		|||
 | 
			
		||||
namespace Service::NWM {
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
 | 
			
		||||
void InstallInterfaces(Core::System& system) {
 | 
			
		||||
    auto& service_manager = system.ServiceManager();
 | 
			
		||||
    std::make_shared<NWM_CEC>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_EXT>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_INF>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_SAP>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_SOC>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_TST>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_UDS>()->InstallAsService(service_manager);
 | 
			
		||||
    std::make_shared<NWM_UDS>(system)->InstallAsService(service_manager);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace Service::NWM
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,9 +6,13 @@
 | 
			
		|||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Core {
 | 
			
		||||
class System;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace Service::NWM {
 | 
			
		||||
 | 
			
		||||
/// Initialize all NWM services
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& service_manager);
 | 
			
		||||
void InstallInterfaces(Core::System& system);
 | 
			
		||||
 | 
			
		||||
} // namespace Service::NWM
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1283,7 +1283,7 @@ static void BeaconBroadcastCallback(u64 userdata, s64 cycles_late) {
 | 
			
		|||
                              beacon_broadcast_event, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NWM_UDS::NWM_UDS() : ServiceFramework("nwm::UDS") {
 | 
			
		||||
NWM_UDS::NWM_UDS(Core::System& system) : ServiceFramework("nwm::UDS") {
 | 
			
		||||
    static const FunctionInfo functions[] = {
 | 
			
		||||
        {0x000102C2, nullptr, "Initialize (deprecated)"},
 | 
			
		||||
        {0x00020000, nullptr, "Scrap"},
 | 
			
		||||
| 
						 | 
				
			
			@ -1334,9 +1334,8 @@ NWM_UDS::NWM_UDS() : ServiceFramework("nwm::UDS") {
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Core::System::GetInstance().GetSharedPageHandler()->SetMacAddress(mac);
 | 
			
		||||
    Core::System::GetInstance().GetSharedPageHandler()->SetWifiLinkLevel(
 | 
			
		||||
        SharedPage::WifiLinkLevel::BEST);
 | 
			
		||||
    system.GetSharedPageHandler()->SetMacAddress(mac);
 | 
			
		||||
    system.GetSharedPageHandler()->SetWifiLinkLevel(SharedPage::WifiLinkLevel::BEST);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NWM_UDS::~NWM_UDS() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,10 @@
 | 
			
		|||
#include "common/swap.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Core {
 | 
			
		||||
class System;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Local-WLAN service
 | 
			
		||||
 | 
			
		||||
namespace Service::NWM {
 | 
			
		||||
| 
						 | 
				
			
			@ -98,7 +102,7 @@ enum class TagId : u8 {
 | 
			
		|||
 | 
			
		||||
class NWM_UDS final : public ServiceFramework<NWM_UDS> {
 | 
			
		||||
public:
 | 
			
		||||
    NWM_UDS();
 | 
			
		||||
    explicit NWM_UDS(Core::System& system);
 | 
			
		||||
    ~NWM_UDS();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue