summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/hle/service/cecd/cecd.cpp29
-rw-r--r--src/core/hle/service/cecd/cecd.h23
-rw-r--r--src/core/hle/service/cecd/cecd_u.cpp5
5 files changed, 56 insertions, 3 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 4c86151ab..a22b0aeb0 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -46,6 +46,7 @@ namespace Log {
46 SUB(Service, NIM) \ 46 SUB(Service, NIM) \
47 SUB(Service, NWM) \ 47 SUB(Service, NWM) \
48 SUB(Service, CAM) \ 48 SUB(Service, CAM) \
49 SUB(Service, CECD) \
49 SUB(Service, CFG) \ 50 SUB(Service, CFG) \
50 SUB(Service, DSP) \ 51 SUB(Service, DSP) \
51 SUB(Service, HID) \ 52 SUB(Service, HID) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e4c39c308..b1b639f15 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -61,6 +61,7 @@ enum class Class : ClassType {
61 Service_NIM, ///< The NIM (Network interface manager) service 61 Service_NIM, ///< The NIM (Network interface manager) service
62 Service_NWM, ///< The NWM (Network wlan manager) service 62 Service_NWM, ///< The NWM (Network wlan manager) service
63 Service_CAM, ///< The CAM (Camera) service 63 Service_CAM, ///< The CAM (Camera) service
64 Service_CECD, ///< The CECD service
64 Service_CFG, ///< The CFG (Configuration) service 65 Service_CFG, ///< The CFG (Configuration) service
65 Service_DSP, ///< The DSP (DSP control) service 66 Service_DSP, ///< The DSP (DSP control) service
66 Service_HID, ///< The HID (Human interface device) service 67 Service_HID, ///< The HID (Human interface device) service
diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp
index 6d79ce9b4..e6e36e7ec 100644
--- a/src/core/hle/service/cecd/cecd.cpp
+++ b/src/core/hle/service/cecd/cecd.cpp
@@ -4,6 +4,7 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6 6
7#include "core/hle/kernel/event.h"
7#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
8#include "core/hle/service/cecd/cecd.h" 9#include "core/hle/service/cecd/cecd.h"
9#include "core/hle/service/cecd/cecd_s.h" 10#include "core/hle/service/cecd/cecd_s.h"
@@ -12,14 +13,38 @@
12namespace Service { 13namespace Service {
13namespace CECD { 14namespace CECD {
14 15
15void Init() { 16static Kernel::SharedPtr<Kernel::Event> cecinfo_event;
16 using namespace Kernel; 17static Kernel::SharedPtr<Kernel::Event> change_state_event;
18
19void GetCecInfoEventHandle(Service::Interface* self) {
20 u32* cmd_buff = Kernel::GetCommandBuffer();
21
22 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
23 cmd_buff[3] = Kernel::g_handle_table.Create(cecinfo_event).MoveFrom(); // Event handle
24
25 LOG_WARNING(Service_CECD, "(STUBBED) called");
26}
27
28void GetChangeStateEventHandle(Service::Interface* self) {
29 u32* cmd_buff = Kernel::GetCommandBuffer();
17 30
31 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
32 cmd_buff[3] = Kernel::g_handle_table.Create(change_state_event).MoveFrom(); // Event handle
33
34 LOG_WARNING(Service_CECD, "(STUBBED) called");
35}
36
37void Init() {
18 AddService(new CECD_S_Interface); 38 AddService(new CECD_S_Interface);
19 AddService(new CECD_U_Interface); 39 AddService(new CECD_U_Interface);
40
41 cecinfo_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::cecinfo_event");
42 change_state_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::change_state_event");
20} 43}
21 44
22void Shutdown() { 45void Shutdown() {
46 cecinfo_event = nullptr;
47 change_state_event = nullptr;
23} 48}
24 49
25} // namespace CECD 50} // namespace CECD
diff --git a/src/core/hle/service/cecd/cecd.h b/src/core/hle/service/cecd/cecd.h
index 9e158521b..89a8d67bb 100644
--- a/src/core/hle/service/cecd/cecd.h
+++ b/src/core/hle/service/cecd/cecd.h
@@ -5,8 +5,31 @@
5#pragma once 5#pragma once
6 6
7namespace Service { 7namespace Service {
8
9class Interface;
10
8namespace CECD { 11namespace CECD {
9 12
13/**
14 * GetCecInfoEventHandle service function
15 * Inputs:
16 * 0: 0x000F0000
17 * Outputs:
18 * 1: ResultCode
19 * 3: Event Handle
20 */
21void GetCecInfoEventHandle(Service::Interface* self);
22
23/**
24 * GetChangeStateEventHandle service function
25 * Inputs:
26 * 0: 0x00100000
27 * Outputs:
28 * 1: ResultCode
29 * 3: Event Handle
30 */
31void GetChangeStateEventHandle(Service::Interface* self);
32
10/// Initialize CECD service(s) 33/// Initialize CECD service(s)
11void Init(); 34void Init();
12 35
diff --git a/src/core/hle/service/cecd/cecd_u.cpp b/src/core/hle/service/cecd/cecd_u.cpp
index 9b720a738..ace1c73c0 100644
--- a/src/core/hle/service/cecd/cecd_u.cpp
+++ b/src/core/hle/service/cecd/cecd_u.cpp
@@ -2,13 +2,16 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/cecd/cecd.h"
5#include "core/hle/service/cecd/cecd_u.h" 6#include "core/hle/service/cecd/cecd_u.h"
6 7
7namespace Service { 8namespace Service {
8namespace CECD { 9namespace CECD {
9 10
10static const Interface::FunctionInfo FunctionTable[] = { 11static const Interface::FunctionInfo FunctionTable[] = {
11 { 0x00120104, nullptr, "ReadSavedData" }, 12 {0x000F0000, GetCecInfoEventHandle, "GetCecInfoEventHandle"},
13 {0x00100000, GetChangeStateEventHandle, "GetChangeStateEventHandle"},
14 {0x00120104, nullptr, "ReadSavedData"},
12}; 15};
13 16
14CECD_U_Interface::CECD_U_Interface() { 17CECD_U_Interface::CECD_U_Interface() {