1
1
Fork 0
forked from suyu/suyu

hle: Add service stubs for apm and appletOE.

This commit is contained in:
bunnei 2017-10-14 22:50:04 -04:00
parent 960a1416de
commit 72eeca1f03
10 changed files with 136 additions and 2 deletions

View file

@ -48,6 +48,9 @@ set(SRCS
hle/kernel/wait_object.cpp
hle/lock.cpp
hle/romfs.cpp
hle/service/am/am.cpp
hle/service/am/applet_oe.cpp
hle/service/apm/apm.cpp
hle/service/dsp_dsp.cpp
hle/service/gsp_gpu.cpp
hle/service/hid/hid.cpp
@ -137,6 +140,9 @@ set(HEADERS
hle/lock.h
hle/result.h
hle/romfs.h
hle/service/am/am.h
hle/service/am/applet_oe.h
hle/service/apm/apm.h
hle/service/dsp_dsp.h
hle/service/gsp_gpu.h
hle/service/hid/hid.h

View 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

View 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

View 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

View 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

View 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

View 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

View file

@ -14,7 +14,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
}
/**
* SRV::Initialize service function
* LM::Initialize service function
* Inputs:
* 0: 0x00000000
* Outputs:

View file

@ -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();

View file

@ -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