mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	hle: Add service stubs for apm and appletOE.
This commit is contained in:
		
							
								
								
									
										18
									
								
								src/core/hle/service/am/am.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/core/hle/service/am/am.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
// Copyright 2017 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "core/hle/ipc_helpers.h"
 | 
			
		||||
#include "core/hle/service/am/am.h"
 | 
			
		||||
#include "core/hle/service/am/applet_oe.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
 | 
			
		||||
    std::make_shared<AppletOE>()->InstallAsService(service_manager);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										16
									
								
								src/core/hle/service/am/am.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/core/hle/service/am/am.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
// Copyright 2017 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
/// Registers all AM services with the specified service manager.
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& service_manager);
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/applet_oe.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/applet_oe.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
// Copyright 2017 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "core/hle/ipc_helpers.h"
 | 
			
		||||
#include "core/hle/service/am/applet_oe.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
AppletOE::AppletOE() : ServiceFramework("appletOE") {
 | 
			
		||||
    static const FunctionInfo functions[] = {
 | 
			
		||||
        {0x00000000, nullptr, "OpenApplicationProxy"},
 | 
			
		||||
    };
 | 
			
		||||
    RegisterHandlers(functions);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AppletOE::~AppletOE() = default;
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										19
									
								
								src/core/hle/service/am/applet_oe.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/core/hle/service/am/applet_oe.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
// Copyright 2017 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
class AppletOE final : public ServiceFramework<AppletOE> {
 | 
			
		||||
public:
 | 
			
		||||
    explicit AppletOE();
 | 
			
		||||
    ~AppletOE();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										27
									
								
								src/core/hle/service/apm/apm.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/core/hle/service/apm/apm.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
// Copyright 2017 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
#include "core/hle/ipc_helpers.h"
 | 
			
		||||
#include "core/hle/service/apm/apm.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace APM {
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
 | 
			
		||||
    std::make_shared<APM>()->InstallAsService(service_manager);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
APM::APM() : ServiceFramework("apm") {
 | 
			
		||||
    static const FunctionInfo functions[] = {
 | 
			
		||||
        {0x00000000, nullptr, "OpenSession"},
 | 
			
		||||
        {0x00000001, nullptr, "GetPerformanceMode"},
 | 
			
		||||
    };
 | 
			
		||||
    RegisterHandlers(functions);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
APM::~APM() = default;
 | 
			
		||||
 | 
			
		||||
} // namespace APM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/apm/apm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/apm/apm.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
// Copyright 2017 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace APM {
 | 
			
		||||
 | 
			
		||||
class APM final : public ServiceFramework<APM> {
 | 
			
		||||
public:
 | 
			
		||||
    explicit APM();
 | 
			
		||||
    ~APM();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/// Registers all AM services with the specified service manager.
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& service_manager);
 | 
			
		||||
 | 
			
		||||
} // namespace APM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
@@ -14,7 +14,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SRV::Initialize service function
 | 
			
		||||
 * LM::Initialize service function
 | 
			
		||||
 *  Inputs:
 | 
			
		||||
 *      0: 0x00000000
 | 
			
		||||
 *  Outputs:
 | 
			
		||||
 
 | 
			
		||||
@@ -15,6 +15,8 @@
 | 
			
		||||
#include "core/hle/kernel/server_session.h"
 | 
			
		||||
#include "core/hle/kernel/thread.h"
 | 
			
		||||
#include "core/hle/kernel/handle_table.h"
 | 
			
		||||
#include "core/hle/service/am/am.h"
 | 
			
		||||
#include "core/hle/service/apm/apm.h"
 | 
			
		||||
#include "core/hle/service/dsp_dsp.h"
 | 
			
		||||
#include "core/hle/service/gsp_gpu.h"
 | 
			
		||||
#include "core/hle/service/hid/hid.h"
 | 
			
		||||
@@ -157,6 +159,8 @@ void Init() {
 | 
			
		||||
    SM::g_service_manager = std::make_shared<SM::ServiceManager>();
 | 
			
		||||
    SM::ServiceManager::InstallInterfaces(SM::g_service_manager);
 | 
			
		||||
 | 
			
		||||
    AM::InstallInterfaces(*SM::g_service_manager);
 | 
			
		||||
    APM::InstallInterfaces(*SM::g_service_manager);
 | 
			
		||||
    LM::InstallInterfaces(*SM::g_service_manager);
 | 
			
		||||
 | 
			
		||||
    HID::Init();
 | 
			
		||||
 
 | 
			
		||||
@@ -103,7 +103,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
    IPC::RequestParser rp{ctx};
 | 
			
		||||
    u32 unk1 = rp.Pop<u32>();
 | 
			
		||||
    u32 unk2 = rp.Pop<u32>();
 | 
			
		||||
    auto name_buf = rp.PopRaw<std::array<char, 6>>();
 | 
			
		||||
    auto name_buf = rp.PopRaw<std::array<char, 9>>();
 | 
			
		||||
    std::string name(name_buf.data());
 | 
			
		||||
 | 
			
		||||
    // TODO(yuriks): Permission checks go here
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user