2015-06-11 22:12:16 +00:00
|
|
|
// Copyright 2015 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "common/logging/log.h"
|
2018-07-01 03:27:57 +00:00
|
|
|
#include "core/hle/ipc_helpers.h"
|
2017-06-06 08:29:46 +00:00
|
|
|
#include "core/hle/result.h"
|
2016-09-21 06:52:38 +00:00
|
|
|
#include "core/hle/service/cecd/cecd.h"
|
2016-12-15 06:52:40 +00:00
|
|
|
#include "core/hle/service/cecd/cecd_ndm.h"
|
2015-06-11 22:12:16 +00:00
|
|
|
#include "core/hle/service/cecd/cecd_s.h"
|
|
|
|
#include "core/hle/service/cecd/cecd_u.h"
|
2018-07-01 03:27:57 +00:00
|
|
|
|
2015-06-11 22:12:16 +00:00
|
|
|
namespace Service {
|
|
|
|
namespace CECD {
|
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
void Module::Interface::GetCecStateAbbreviated(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp(ctx, 0x0E, 0, 0);
|
2016-04-08 19:39:52 +00:00
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
2018-07-01 16:38:40 +00:00
|
|
|
rb.PushEnum(CecStateAbbreviated::CEC_STATE_ABBREV_IDLE);
|
2016-04-08 19:39:52 +00:00
|
|
|
|
2018-06-29 11:18:07 +00:00
|
|
|
LOG_WARNING(Service_CECD, "(STUBBED) called");
|
2016-04-08 19:39:52 +00:00
|
|
|
}
|
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
void Module::Interface::GetCecInfoEventHandle(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp(ctx, 0x0F, 0, 0);
|
2016-03-31 09:21:02 +00:00
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.PushCopyObjects(cecd->cecinfo_event);
|
2016-03-31 09:21:02 +00:00
|
|
|
|
2018-06-29 11:18:07 +00:00
|
|
|
LOG_WARNING(Service_CECD, "(STUBBED) called");
|
2016-03-31 09:21:02 +00:00
|
|
|
}
|
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
void Module::Interface::GetChangeStateEventHandle(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp(ctx, 0x10, 0, 0);
|
2015-06-11 22:12:16 +00:00
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.PushCopyObjects(cecd->change_state_event);
|
2016-03-31 09:21:02 +00:00
|
|
|
|
2018-06-29 11:18:07 +00:00
|
|
|
LOG_WARNING(Service_CECD, "(STUBBED) called");
|
2016-03-31 09:21:02 +00:00
|
|
|
}
|
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
Module::Interface::Interface(std::shared_ptr<Module> cecd, const char* name, u32 max_session)
|
|
|
|
: ServiceFramework(name, max_session), cecd(std::move(cecd)) {}
|
2016-03-31 09:21:02 +00:00
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
Module::Module() {
|
|
|
|
using namespace Kernel;
|
|
|
|
cecinfo_event = Event::Create(Kernel::ResetType::OneShot, "CECD::cecinfo_event");
|
|
|
|
change_state_event = Event::Create(Kernel::ResetType::OneShot, "CECD::change_state_event");
|
2015-06-11 22:12:16 +00:00
|
|
|
}
|
|
|
|
|
2018-07-01 03:27:57 +00:00
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
|
|
|
auto cecd = std::make_shared<Module>();
|
|
|
|
std::make_shared<CECD_NDM>(cecd)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<CECD_S>(cecd)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<CECD_U>(cecd)->InstallAsService(service_manager);
|
2015-06-11 22:12:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace CECD
|
|
|
|
} // namespace Service
|