From a65fb85b6d3f249d2179ad88de29869ec0d38c76 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 11 Feb 2024 20:49:45 -0500 Subject: am: rewrite IApplicationCreator --- src/core/CMakeLists.txt | 4 +-- src/core/hle/service/am/application_creator.cpp | 25 ---------------- src/core/hle/service/am/application_creator.h | 16 ---------- .../hle/service/am/service/application_creator.cpp | 35 ++++++++++++++++++++++ .../hle/service/am/service/application_creator.h | 23 ++++++++++++++ .../hle/service/am/service/system_applet_proxy.cpp | 7 +++-- 6 files changed, 64 insertions(+), 46 deletions(-) delete mode 100644 src/core/hle/service/am/application_creator.cpp delete mode 100644 src/core/hle/service/am/application_creator.h create mode 100644 src/core/hle/service/am/service/application_creator.cpp create mode 100644 src/core/hle/service/am/service/application_creator.h (limited to 'src/core') diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index db27e0f3e..8fd99a5e9 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -423,8 +423,6 @@ add_library(core STATIC hle/service/am/applet_manager.h hle/service/am/applet_message_queue.cpp hle/service/am/applet_message_queue.h - hle/service/am/application_creator.cpp - hle/service/am/application_creator.h hle/service/am/hid_registration.cpp hle/service/am/hid_registration.h hle/service/am/idle.cpp @@ -443,6 +441,8 @@ add_library(core STATIC hle/service/am/service/applet_common_functions.h hle/service/am/service/application_accessor.cpp hle/service/am/service/application_accessor.h + hle/service/am/service/application_creator.cpp + hle/service/am/service/application_creator.h hle/service/am/service/application_functions.cpp hle/service/am/service/application_functions.h hle/service/am/service/application_proxy_service.cpp diff --git a/src/core/hle/service/am/application_creator.cpp b/src/core/hle/service/am/application_creator.cpp deleted file mode 100644 index 79ea045a3..000000000 --- a/src/core/hle/service/am/application_creator.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/application_creator.h" -#include "core/hle/service/ipc_helpers.h" - -namespace Service::AM { - -IApplicationCreator::IApplicationCreator(Core::System& system_) - : ServiceFramework{system_, "IApplicationCreator"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "CreateApplication"}, - {1, nullptr, "PopLaunchRequestedApplication"}, - {10, nullptr, "CreateSystemApplication"}, - {100, nullptr, "PopFloatingApplicationForDevelopment"}, - }; - // clang-format on - - RegisterHandlers(functions); -} - -IApplicationCreator::~IApplicationCreator() = default; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/application_creator.h b/src/core/hle/service/am/application_creator.h deleted file mode 100644 index 375a3c476..000000000 --- a/src/core/hle/service/am/application_creator.h +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/hle/service/service.h" - -namespace Service::AM { - -class IApplicationCreator final : public ServiceFramework { -public: - explicit IApplicationCreator(Core::System& system_); - ~IApplicationCreator() override; -}; - -} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_creator.cpp b/src/core/hle/service/am/service/application_creator.cpp new file mode 100644 index 000000000..568bb0122 --- /dev/null +++ b/src/core/hle/service/am/service/application_creator.cpp @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/am/am_types.h" +#include "core/hle/service/am/applet.h" +#include "core/hle/service/am/applet_manager.h" +#include "core/hle/service/am/service/application_accessor.h" +#include "core/hle/service/am/service/application_creator.h" +#include "core/hle/service/cmif_serialization.h" + +namespace Service::AM { + +IApplicationCreator::IApplicationCreator(Core::System& system_) + : ServiceFramework{system_, "IApplicationCreator"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"}, + {1, nullptr, "PopLaunchRequestedApplication"}, + {10, nullptr, "CreateSystemApplication"}, + {100, nullptr, "PopFloatingApplicationForDevelopment"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IApplicationCreator::~IApplicationCreator() = default; + +Result IApplicationCreator::CreateApplication( + Out> out_application_accessor, u64 application_id) { + LOG_ERROR(Service_NS, "called, application_id={:x}", application_id); + R_THROW(ResultUnknown); +} + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/application_creator.h b/src/core/hle/service/am/service/application_creator.h new file mode 100644 index 000000000..9f939ebf6 --- /dev/null +++ b/src/core/hle/service/am/service/application_creator.h @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::AM { + +class IApplicationAccessor; +struct Applet; + +class IApplicationCreator final : public ServiceFramework { +public: + explicit IApplicationCreator(Core::System& system_); + ~IApplicationCreator() override; + +private: + Result CreateApplication(Out>, u64 application_id); +}; + +} // namespace Service::AM diff --git a/src/core/hle/service/am/service/system_applet_proxy.cpp b/src/core/hle/service/am/service/system_applet_proxy.cpp index a3e801799..5ec509d2e 100644 --- a/src/core/hle/service/am/service/system_applet_proxy.cpp +++ b/src/core/hle/service/am/service/system_applet_proxy.cpp @@ -1,8 +1,8 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/am/application_creator.h" #include "core/hle/service/am/service/applet_common_functions.h" +#include "core/hle/service/am/service/application_creator.h" #include "core/hle/service/am/service/audio_controller.h" #include "core/hle/service/am/service/common_state_getter.h" #include "core/hle/service/am/service/debug_functions.h" @@ -104,8 +104,9 @@ Result ISystemAppletProxy::GetLibraryAppletCreator( Result ISystemAppletProxy::GetApplicationCreator( Out> out_application_creator) { - LOG_ERROR(Service_AM, "called"); - R_THROW(ResultUnknown); + LOG_DEBUG(Service_AM, "called"); + *out_application_creator = std::make_shared(system); + R_SUCCEED(); } Result ISystemAppletProxy::GetAppletCommonFunctions( -- cgit v1.2.3