citra/src/core/hle/service/cecd/cecd.cpp

67 lines
2.0 KiB
C++
Raw Normal View History

// Copyright 2015 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.h"
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/handle_table.h"
#include "core/hle/result.h"
#include "core/hle/service/cecd/cecd.h"
2016-12-15 06:52:40 +00:00
#include "core/hle/service/cecd/cecd_ndm.h"
#include "core/hle/service/cecd/cecd_s.h"
#include "core/hle/service/cecd/cecd_u.h"
#include "core/hle/service/service.h"
namespace Service {
namespace CECD {
static Kernel::SharedPtr<Kernel::Event> cecinfo_event;
static Kernel::SharedPtr<Kernel::Event> change_state_event;
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-29 11:18:07 +00:00
LOG_WARNING(Service_CECD, "(STUBBED) called");
}
void GetCecInfoEventHandle(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[3] = Kernel::g_handle_table.Create(cecinfo_event).Unwrap(); // Event handle
2018-06-29 11:18:07 +00:00
LOG_WARNING(Service_CECD, "(STUBBED) called");
}
void GetChangeStateEventHandle(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[3] = Kernel::g_handle_table.Create(change_state_event).Unwrap(); // Event handle
2018-06-29 11:18:07 +00:00
LOG_WARNING(Service_CECD, "(STUBBED) called");
}
void Init() {
2016-12-15 06:52:40 +00:00
AddService(new CECD_NDM);
AddService(new CECD_S);
AddService(new CECD_U);
2016-12-15 06:52:40 +00:00
cecinfo_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD::cecinfo_event");
change_state_event =
2016-12-15 06:52:40 +00:00
Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD::change_state_event");
}
void Shutdown() {
cecinfo_event = nullptr;
change_state_event = nullptr;
}
} // namespace CECD
} // namespace Service