diff options
| author | 2016-04-02 01:43:35 -0400 | |
|---|---|---|
| committer | 2016-04-02 01:43:35 -0400 | |
| commit | e5e3b97db21fe96852d45da2be0360b078547cd5 (patch) | |
| tree | 604e67b9d94fe763bba02679c20d4d039bdf200e /src | |
| parent | Merge pull request #1390 from purpasmart96/citra_gsp_error_codes (diff) | |
| parent | cecd:u: stub GetCecInfoEventHandle, GetChangeStateEventHandle (diff) | |
| download | yuzu-e5e3b97db21fe96852d45da2be0360b078547cd5.tar.gz yuzu-e5e3b97db21fe96852d45da2be0360b078547cd5.tar.xz yuzu-e5e3b97db21fe96852d45da2be0360b078547cd5.zip | |
Merge pull request #1619 from mailwl/cecd
cecd:u: stub GetCecInfoEventHandle, GetChangeStateEventHandle
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/logging/backend.cpp | 1 | ||||
| -rw-r--r-- | src/common/logging/log.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/cecd/cecd.cpp | 29 | ||||
| -rw-r--r-- | src/core/hle/service/cecd/cecd.h | 23 | ||||
| -rw-r--r-- | src/core/hle/service/cecd/cecd_u.cpp | 5 |
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 @@ | |||
| 12 | namespace Service { | 13 | namespace Service { |
| 13 | namespace CECD { | 14 | namespace CECD { |
| 14 | 15 | ||
| 15 | void Init() { | 16 | static Kernel::SharedPtr<Kernel::Event> cecinfo_event; |
| 16 | using namespace Kernel; | 17 | static Kernel::SharedPtr<Kernel::Event> change_state_event; |
| 18 | |||
| 19 | void 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 | |||
| 28 | void 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 | |||
| 37 | void 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 | ||
| 22 | void Shutdown() { | 45 | void 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 | ||
| 7 | namespace Service { | 7 | namespace Service { |
| 8 | |||
| 9 | class Interface; | ||
| 10 | |||
| 8 | namespace CECD { | 11 | namespace CECD { |
| 9 | 12 | ||
| 13 | /** | ||
| 14 | * GetCecInfoEventHandle service function | ||
| 15 | * Inputs: | ||
| 16 | * 0: 0x000F0000 | ||
| 17 | * Outputs: | ||
| 18 | * 1: ResultCode | ||
| 19 | * 3: Event Handle | ||
| 20 | */ | ||
| 21 | void 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 | */ | ||
| 31 | void GetChangeStateEventHandle(Service::Interface* self); | ||
| 32 | |||
| 10 | /// Initialize CECD service(s) | 33 | /// Initialize CECD service(s) |
| 11 | void Init(); | 34 | void 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 | ||
| 7 | namespace Service { | 8 | namespace Service { |
| 8 | namespace CECD { | 9 | namespace CECD { |
| 9 | 10 | ||
| 10 | static const Interface::FunctionInfo FunctionTable[] = { | 11 | static const Interface::FunctionInfo FunctionTable[] = { |
| 11 | { 0x00120104, nullptr, "ReadSavedData" }, | 12 | {0x000F0000, GetCecInfoEventHandle, "GetCecInfoEventHandle"}, |
| 13 | {0x00100000, GetChangeStateEventHandle, "GetChangeStateEventHandle"}, | ||
| 14 | {0x00120104, nullptr, "ReadSavedData"}, | ||
| 12 | }; | 15 | }; |
| 13 | 16 | ||
| 14 | CECD_U_Interface::CECD_U_Interface() { | 17 | CECD_U_Interface::CECD_U_Interface() { |