am: rewrite IApplicationCreator

This commit is contained in:
Liam 2024-02-11 20:49:45 -05:00
parent bbb1ff6574
commit a65fb85b6d
4 changed files with 26 additions and 8 deletions

View File

@ -423,8 +423,6 @@ add_library(core STATIC
hle/service/am/applet_manager.h hle/service/am/applet_manager.h
hle/service/am/applet_message_queue.cpp hle/service/am/applet_message_queue.cpp
hle/service/am/applet_message_queue.h 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.cpp
hle/service/am/hid_registration.h hle/service/am/hid_registration.h
hle/service/am/idle.cpp 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/applet_common_functions.h
hle/service/am/service/application_accessor.cpp hle/service/am/service/application_accessor.cpp
hle/service/am/service/application_accessor.h 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.cpp
hle/service/am/service/application_functions.h hle/service/am/service/application_functions.h
hle/service/am/service/application_proxy_service.cpp hle/service/am/service/application_proxy_service.cpp

View File

@ -1,8 +1,12 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/am/application_creator.h" #include "core/hle/service/am/am_types.h"
#include "core/hle/service/ipc_helpers.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 { namespace Service::AM {
@ -10,7 +14,7 @@ IApplicationCreator::IApplicationCreator(Core::System& system_)
: ServiceFramework{system_, "IApplicationCreator"} { : ServiceFramework{system_, "IApplicationCreator"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, nullptr, "CreateApplication"}, {0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"},
{1, nullptr, "PopLaunchRequestedApplication"}, {1, nullptr, "PopLaunchRequestedApplication"},
{10, nullptr, "CreateSystemApplication"}, {10, nullptr, "CreateSystemApplication"},
{100, nullptr, "PopFloatingApplicationForDevelopment"}, {100, nullptr, "PopFloatingApplicationForDevelopment"},
@ -22,4 +26,10 @@ IApplicationCreator::IApplicationCreator(Core::System& system_)
IApplicationCreator::~IApplicationCreator() = default; IApplicationCreator::~IApplicationCreator() = default;
Result IApplicationCreator::CreateApplication(
Out<SharedPointer<IApplicationAccessor>> out_application_accessor, u64 application_id) {
LOG_ERROR(Service_NS, "called, application_id={:x}", application_id);
R_THROW(ResultUnknown);
}
} // namespace Service::AM } // namespace Service::AM

View File

@ -3,14 +3,21 @@
#pragma once #pragma once
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
namespace Service::AM { namespace Service::AM {
class IApplicationAccessor;
struct Applet;
class IApplicationCreator final : public ServiceFramework<IApplicationCreator> { class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
public: public:
explicit IApplicationCreator(Core::System& system_); explicit IApplicationCreator(Core::System& system_);
~IApplicationCreator() override; ~IApplicationCreator() override;
private:
Result CreateApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
}; };
} // namespace Service::AM } // namespace Service::AM

View File

@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // 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/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/audio_controller.h"
#include "core/hle/service/am/service/common_state_getter.h" #include "core/hle/service/am/service/common_state_getter.h"
#include "core/hle/service/am/service/debug_functions.h" #include "core/hle/service/am/service/debug_functions.h"
@ -104,8 +104,9 @@ Result ISystemAppletProxy::GetLibraryAppletCreator(
Result ISystemAppletProxy::GetApplicationCreator( Result ISystemAppletProxy::GetApplicationCreator(
Out<SharedPointer<IApplicationCreator>> out_application_creator) { Out<SharedPointer<IApplicationCreator>> out_application_creator) {
LOG_ERROR(Service_AM, "called"); LOG_DEBUG(Service_AM, "called");
R_THROW(ResultUnknown); *out_application_creator = std::make_shared<IApplicationCreator>(system);
R_SUCCEED();
} }
Result ISystemAppletProxy::GetAppletCommonFunctions( Result ISystemAppletProxy::GetAppletCommonFunctions(