From b6b98af105c7bcc958b5888f8a3b85fec71989ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= <112760654+DaniElectra@users.noreply.github.com> Date: Sat, 23 Dec 2023 04:52:27 +0100 Subject: [PATCH] cecd: Stub GetCecInfoEventHandleSys (#7278) This allows usage of the LLE news sysmodule. --- src/core/hle/service/cecd/cecd.cpp | 14 ++++++++++++++ src/core/hle/service/cecd/cecd.h | 1 + src/core/hle/service/cecd/cecd_s.cpp | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp index 5d5f37ef8..4ce144e2e 100644 --- a/src/core/hle/service/cecd/cecd.cpp +++ b/src/core/hle/service/cecd/cecd.cpp @@ -37,6 +37,7 @@ template void Module::serialize(Archive& ar, const unsigned int) { ar& cecd_system_save_data_archive; ar& cecinfo_event; + ar& cecinfosys_event; ar& change_state_event; } SERIALIZE_IMPL(Module) @@ -836,6 +837,17 @@ void Module::Interface::OpenAndRead(Kernel::HLERequestContext& ctx) { open_mode.create.Value(), open_mode.check.Value()); } +void Module::Interface::GetCecInfoEventHandleSys(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx); + rp.PopPID(); + + IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); + rb.Push(RESULT_SUCCESS); + rb.PushCopyObjects(cecd->cecinfosys_event); + + LOG_WARNING(Service_CECD, "(STUBBED) called"); +} + std::string Module::EncodeBase64(std::span in) const { using namespace CryptoPP; using Name::EncodingLookupArray; @@ -1379,6 +1391,8 @@ Module::Interface::Interface(std::shared_ptr cecd, const char* name, u32 Module::Module(Core::System& system) : system(system) { using namespace Kernel; cecinfo_event = system.Kernel().CreateEvent(Kernel::ResetType::OneShot, "CECD::cecinfo_event"); + cecinfosys_event = + system.Kernel().CreateEvent(Kernel::ResetType::OneShot, "CECD::cecinfosys_event"); change_state_event = system.Kernel().CreateEvent(Kernel::ResetType::OneShot, "CECD::change_state_event"); diff --git a/src/core/hle/service/cecd/cecd.h b/src/core/hle/service/cecd/cecd.h index 2ad7cc056..bbb473d49 100644 --- a/src/core/hle/service/cecd/cecd.h +++ b/src/core/hle/service/cecd/cecd.h @@ -625,6 +625,7 @@ private: std::unique_ptr cecd_system_save_data_archive; std::shared_ptr cecinfo_event; + std::shared_ptr cecinfosys_event; std::shared_ptr change_state_event; Core::System& system; diff --git a/src/core/hle/service/cecd/cecd_s.cpp b/src/core/hle/service/cecd/cecd_s.cpp index 94745778d..3b76c738c 100644 --- a/src/core/hle/service/cecd/cecd_s.cpp +++ b/src/core/hle/service/cecd/cecd_s.cpp @@ -35,7 +35,7 @@ CECD_S::CECD_S(std::shared_ptr cecd) {0x001E, nullptr, "GetEventLog"}, {0x001F, nullptr, "GetEventLogStart"}, // cecd:s commands - {0x0402, nullptr, "GetCecInfoEventHandleSys"}, + {0x0402, &CECD_S::GetCecInfoEventHandleSys, "GetCecInfoEventHandleSys"}, // clang-format on };