2015-06-12 00:12:16 +02: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"
|
2017-06-06 10:29:46 +02:00
|
|
|
#include "core/hle/ipc.h"
|
2016-03-31 11:21:02 +02:00
|
|
|
#include "core/hle/kernel/event.h"
|
2017-06-06 10:29:46 +02:00
|
|
|
#include "core/hle/kernel/handle_table.h"
|
|
|
|
#include "core/hle/result.h"
|
2016-09-21 08:52:38 +02:00
|
|
|
#include "core/hle/service/cecd/cecd.h"
|
2016-12-15 07:52:40 +01:00
|
|
|
#include "core/hle/service/cecd/cecd_ndm.h"
|
2015-06-12 00:12:16 +02:00
|
|
|
#include "core/hle/service/cecd/cecd_s.h"
|
|
|
|
#include "core/hle/service/cecd/cecd_u.h"
|
2016-09-18 02:38:01 +02:00
|
|
|
#include "core/hle/service/service.h"
|
2015-06-12 00:12:16 +02:00
|
|
|
|
|
|
|
namespace Service {
|
|
|
|
namespace CECD {
|
|
|
|
|
2016-03-31 11:21:02 +02:00
|
|
|
static Kernel::SharedPtr<Kernel::Event> cecinfo_event;
|
|
|
|
static Kernel::SharedPtr<Kernel::Event> change_state_event;
|
|
|
|
|
2016-04-08 21:39:52 +02:00
|
|
|
void GetCecStateAbbreviated(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
cmd_buff[2] = static_cast<u32>(CecStateAbbreviated::CEC_STATE_ABBREV_IDLE);
|
|
|
|
|
|
|
|
LOG_WARNING(Service_CECD, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
|
2016-03-31 11:21:02 +02:00
|
|
|
void GetCecInfoEventHandle(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
2016-09-18 02:38:01 +02:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-03-31 11:21:02 +02:00
|
|
|
cmd_buff[3] = Kernel::g_handle_table.Create(cecinfo_event).MoveFrom(); // Event handle
|
|
|
|
|
|
|
|
LOG_WARNING(Service_CECD, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
|
|
|
|
void GetChangeStateEventHandle(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2015-06-12 00:12:16 +02:00
|
|
|
|
2016-09-18 02:38:01 +02:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-03-31 11:21:02 +02:00
|
|
|
cmd_buff[3] = Kernel::g_handle_table.Create(change_state_event).MoveFrom(); // Event handle
|
|
|
|
|
|
|
|
LOG_WARNING(Service_CECD, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
|
|
|
|
void Init() {
|
2016-12-15 07:52:40 +01:00
|
|
|
AddService(new CECD_NDM);
|
|
|
|
AddService(new CECD_S);
|
|
|
|
AddService(new CECD_U);
|
2016-03-31 11:21:02 +02:00
|
|
|
|
2016-12-15 07:52:40 +01:00
|
|
|
cecinfo_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD::cecinfo_event");
|
2016-09-18 02:38:01 +02:00
|
|
|
change_state_event =
|
2016-12-15 07:52:40 +01:00
|
|
|
Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD::change_state_event");
|
2015-06-12 00:12:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Shutdown() {
|
2016-03-31 11:21:02 +02:00
|
|
|
cecinfo_event = nullptr;
|
|
|
|
change_state_event = nullptr;
|
2015-06-12 00:12:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace CECD
|
|
|
|
|
|
|
|
} // namespace Service
|