VERY experimental Nintendo Switch 2 emulator
C++
bgtc: Update to 12.x and implement OpenTaskService
Morph6e9d0a685b93
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cppindex 2d4d2e9e75..4575df24d7 100644--- a/src/common/logging/backend.cpp+++ b/src/common/logging/backend.cpp@@ -212,6 +212,7 @@ void DebuggerBackend::Write(const Entry& entry) {SUB(Service, ARP) \SUB(Service, BCAT) \SUB(Service, BPC) \+ SUB(Service, BGTC) \SUB(Service, BTDRV) \SUB(Service, BTM) \SUB(Service, Capture) \diff --git a/src/common/logging/log.h b/src/common/logging/log.hindex 8358949182..3d7b7dab7e 100644--- a/src/common/logging/log.h+++ b/src/common/logging/log.h@@ -66,6 +66,7 @@ enum class Class : ClassType {Service_ARP, ///< The ARP serviceService_Audio, ///< The Audio (Audio control) serviceService_BCAT, ///< The BCAT service+ Service_BGTC, ///< The BGTC (Background Task Controller) serviceService_BPC, ///< The BPC serviceService_BTDRV, ///< The Bluetooth driver serviceService_BTM, ///< The BTM servicediff --git a/src/core/hle/service/glue/bgtc.cpp b/src/core/hle/service/glue/bgtc.cppindex a478b68e15..daecfff150 100644--- a/src/core/hle/service/glue/bgtc.cpp+++ b/src/core/hle/service/glue/bgtc.cpp@@ -2,11 +2,34 @@// Licensed under GPLv2 or any later version// Refer to the license.txt file included.+#include "common/logging/log.h"+#include "core/core.h"+#include "core/hle/ipc_helpers.h"#include "core/hle/service/glue/bgtc.h"namespace Service::Glue {BGTC_T::BGTC_T(Core::System& system_) : ServiceFramework{system_, "bgtc:t"} {+ // clang-format off+ static const FunctionInfo functions[] = {+ {100, &BGTC_T::OpenTaskService, "OpenTaskService"},+ };+ // clang-format on++ RegisterHandlers(functions);+}++BGTC_T::~BGTC_T() = default;++void BGTC_T::OpenTaskService(Kernel::HLERequestContext& ctx) {+ LOG_DEBUG(Service_BGTC, "called");++ IPC::ResponseBuilder rb{ctx, 2, 0, 1};+ rb.Push(RESULT_SUCCESS);+ rb.PushIpcInterface<ITaskService>(system);+}++ITaskService::ITaskService(Core::System& system_) : ServiceFramework{system_, "ITaskService"} {// clang-format offstatic const FunctionInfo functions[] = {{1, nullptr, "NotifyTaskStarting"},@@ -20,16 +43,18 @@ BGTC_T::BGTC_T(Core::System& system_) : ServiceFramework{system_, "bgtc:t"} {{13, nullptr, "UnscheduleTask"},{14, nullptr, "GetScheduleEvent"},{15, nullptr, "SchedulePeriodicTask"},+ {16, nullptr, "Unknown16"},{101, nullptr, "GetOperationMode"},{102, nullptr, "WillDisconnectNetworkWhenEnteringSleep"},{103, nullptr, "WillStayHalfAwakeInsteadSleep"},+ {200, nullptr, "Unknown200"},};// clang-format onRegisterHandlers(functions);}-BGTC_T::~BGTC_T() = default;+ITaskService::~ITaskService() = default;BGTC_SC::BGTC_SC(Core::System& system_) : ServiceFramework{system_, "bgtc:sc"} {// clang-format offdiff --git a/src/core/hle/service/glue/bgtc.h b/src/core/hle/service/glue/bgtc.hindex 906116ba6a..4c0142fd5a 100644--- a/src/core/hle/service/glue/bgtc.h+++ b/src/core/hle/service/glue/bgtc.h@@ -16,6 +16,14 @@ class BGTC_T final : public ServiceFramework<BGTC_T> {public:explicit BGTC_T(Core::System& system_);~BGTC_T() override;++ void OpenTaskService(Kernel::HLERequestContext& ctx);+};++class ITaskService final : public ServiceFramework<ITaskService> {+public:+ explicit ITaskService(Core::System& system_);+ ~ITaskService() override;};class BGTC_SC final : public ServiceFramework<BGTC_SC> {