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