mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-27 03:12:02 +00:00
@@ -444,8 +444,6 @@ add_library(core STATIC
|
||||
hle/service/am/process_creation.h
|
||||
hle/service/am/process_holder.cpp
|
||||
hle/service/am/process_holder.h
|
||||
hle/service/am/service/all_system_applet_proxies_service.cpp
|
||||
hle/service/am/service/all_system_applet_proxies_service.h
|
||||
hle/service/am/service/applet_common_functions.cpp
|
||||
hle/service/am/service/applet_common_functions.h
|
||||
hle/service/am/service/application_accessor.cpp
|
||||
@@ -454,10 +452,6 @@ add_library(core STATIC
|
||||
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.cpp
|
||||
hle/service/am/service/application_proxy.h
|
||||
hle/service/am/service/application_proxy_service.cpp
|
||||
hle/service/am/service/application_proxy_service.h
|
||||
hle/service/am/service/audio_controller.cpp
|
||||
hle/service/am/service/audio_controller.h
|
||||
hle/service/am/service/common_state_getter.cpp
|
||||
@@ -474,18 +468,8 @@ add_library(core STATIC
|
||||
hle/service/am/service/home_menu_functions.h
|
||||
hle/service/am/service/library_applet_accessor.cpp
|
||||
hle/service/am/service/library_applet_accessor.h
|
||||
hle/service/am/service/library_applet_creator.cpp
|
||||
hle/service/am/service/library_applet_creator.h
|
||||
hle/service/am/service/library_applet_proxy.cpp
|
||||
hle/service/am/service/library_applet_proxy.h
|
||||
hle/service/am/service/library_applet_self_accessor.cpp
|
||||
hle/service/am/service/library_applet_self_accessor.h
|
||||
hle/service/am/service/lock_accessor.cpp
|
||||
hle/service/am/service/lock_accessor.h
|
||||
hle/service/am/service/overlay_functions.cpp
|
||||
hle/service/am/service/overlay_functions.h
|
||||
hle/service/am/service/overlay_applet_proxy.cpp
|
||||
hle/service/am/service/overlay_applet_proxy.h
|
||||
hle/service/am/service/process_winding_controller.cpp
|
||||
hle/service/am/service/process_winding_controller.h
|
||||
hle/service/am/service/self_controller.cpp
|
||||
@@ -494,8 +478,6 @@ add_library(core STATIC
|
||||
hle/service/am/service/storage.h
|
||||
hle/service/am/service/storage_accessor.cpp
|
||||
hle/service/am/service/storage_accessor.h
|
||||
hle/service/am/service/system_applet_proxy.cpp
|
||||
hle/service/am/service/system_applet_proxy.h
|
||||
hle/service/am/service/window_controller.cpp
|
||||
hle/service/am/service/window_controller.h
|
||||
hle/service/am/window_system.cpp
|
||||
@@ -580,16 +562,6 @@ add_library(core STATIC
|
||||
hle/service/btdrv/btdrv.h
|
||||
hle/service/btm/btm.cpp
|
||||
hle/service/btm/btm.h
|
||||
hle/service/btm/btm_debug.cpp
|
||||
hle/service/btm/btm_debug.h
|
||||
hle/service/btm/btm_system.cpp
|
||||
hle/service/btm/btm_system.h
|
||||
hle/service/btm/btm_system_core.cpp
|
||||
hle/service/btm/btm_system_core.h
|
||||
hle/service/btm/btm_user.cpp
|
||||
hle/service/btm/btm_user.h
|
||||
hle/service/btm/btm_user_core.cpp
|
||||
hle/service/btm/btm_user_core.h
|
||||
hle/service/caps/caps.cpp
|
||||
hle/service/caps/caps.h
|
||||
hle/service/caps/caps_a.cpp
|
||||
@@ -913,8 +885,6 @@ add_library(core STATIC
|
||||
hle/service/olsc/native_handle_holder.h
|
||||
hle/service/olsc/olsc_service_for_application.cpp
|
||||
hle/service/olsc/olsc_service_for_application.h
|
||||
hle/service/olsc/olsc_service_for_system_service.cpp
|
||||
hle/service/olsc/olsc_service_for_system_service.h
|
||||
hle/service/olsc/olsc.cpp
|
||||
hle/service/olsc/olsc.h
|
||||
hle/service/olsc/remote_storage_controller.cpp
|
||||
@@ -944,14 +914,8 @@ add_library(core STATIC
|
||||
hle/service/os/process.h
|
||||
hle/service/pcie/pcie.cpp
|
||||
hle/service/pcie/pcie.h
|
||||
hle/service/pctl/parental_control_service_factory.cpp
|
||||
hle/service/pctl/parental_control_service_factory.h
|
||||
hle/service/pctl/parental_control_service.cpp
|
||||
hle/service/pctl/parental_control_service.h
|
||||
hle/service/pctl/pctl.cpp
|
||||
hle/service/pctl/pctl.h
|
||||
hle/service/pctl/pctl_results.h
|
||||
hle/service/pctl/pctl_types.h
|
||||
hle/service/pcv/pcv.cpp
|
||||
hle/service/pcv/pcv.h
|
||||
hle/service/pm/pm.cpp
|
||||
@@ -971,8 +935,6 @@ add_library(core STATIC
|
||||
hle/service/psc/pm_control.h
|
||||
hle/service/psc/pm_module.cpp
|
||||
hle/service/psc/pm_module.h
|
||||
hle/service/psc/pm_service.cpp
|
||||
hle/service/psc/pm_service.h
|
||||
hle/service/psc/psc.cpp
|
||||
hle/service/psc/psc.h
|
||||
hle/service/psc/time/alarms.cpp
|
||||
|
||||
+1215
-8
File diff suppressed because it is too large
Load Diff
@@ -1,118 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/am/applet_manager.h"
|
||||
#include "core/hle/service/am/service/all_system_applet_proxies_service.h"
|
||||
#include "core/hle/service/am/service/application_proxy.h"
|
||||
#include "core/hle/service/am/service/library_applet_proxy.h"
|
||||
#include "core/hle/service/am/service/system_applet_proxy.h"
|
||||
#include "core/hle/service/am/service/overlay_applet_proxy.h"
|
||||
#include "core/hle/service/am/window_system.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
IAllSystemAppletProxiesService::IAllSystemAppletProxiesService(Core::System& system_,
|
||||
WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "appletAE"}, m_window_system{window_system} {
|
||||
}
|
||||
|
||||
IAllSystemAppletProxiesService::~IAllSystemAppletProxiesService() = default;
|
||||
|
||||
Result IAllSystemAppletProxiesService::OpenSystemAppletProxy(
|
||||
Out<SharedPointer<ISystemAppletProxy>> out_system_applet_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||
*out_system_applet_proxy = std::make_shared<ISystemAppletProxy>(
|
||||
system, applet, process_handle.Get(), m_window_system);
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
}
|
||||
|
||||
Result IAllSystemAppletProxiesService::OpenLibraryAppletProxy(
|
||||
Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle,
|
||||
InLargeData<AppletAttribute, BufferAttr_HipcMapAlias> attribute) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||
*out_library_applet_proxy = std::make_shared<ILibraryAppletProxy>(
|
||||
system, applet, process_handle.Get(), m_window_system);
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
}
|
||||
|
||||
Result IAllSystemAppletProxiesService::OpenOverlayAppletProxy(
|
||||
Out<SharedPointer<IOverlayAppletProxy>> out_overlay_applet_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||
LOG_WARNING(Service_AM, "called");
|
||||
|
||||
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||
*out_overlay_applet_proxy = std::make_shared<IOverlayAppletProxy>(
|
||||
system, applet, process_handle.Get(), m_window_system);
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
}
|
||||
|
||||
Result IAllSystemAppletProxiesService::OpenSystemApplicationProxy(
|
||||
Out<SharedPointer<IApplicationProxy>> out_system_application_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
if (const auto applet = this->GetAppletFromProcessId(pid); applet) {
|
||||
*out_system_application_proxy = std::make_shared<IApplicationProxy>(
|
||||
system, applet, process_handle.Get(), m_window_system);
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
}
|
||||
|
||||
Result IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld(
|
||||
Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
AppletAttribute attribute{};
|
||||
R_RETURN(
|
||||
this->OpenLibraryAppletProxy(out_library_applet_proxy, pid, process_handle, attribute));
|
||||
}
|
||||
|
||||
Result IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions() {
|
||||
LOG_DEBUG(Service_AM, "(STUBBED) called.");
|
||||
|
||||
// TODO (jarrodnorwell)
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IAllSystemAppletProxiesService::GetAppletAlternativeFunctions() {
|
||||
LOG_DEBUG(Service_AM, "(STUBBED) called.");
|
||||
|
||||
// TODO (maufeat)
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
std::shared_ptr<Applet> IAllSystemAppletProxiesService::GetAppletFromProcessId(
|
||||
ProcessId process_id) {
|
||||
return m_window_system.GetByAppletResourceUserId(process_id.pid);
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,72 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 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"
|
||||
#include "core/hle/service/am/service/overlay_applet_proxy.h"
|
||||
|
||||
namespace Service {
|
||||
|
||||
namespace AM {
|
||||
|
||||
struct Applet;
|
||||
struct AppletAttribute;
|
||||
class IApplicationProxy;
|
||||
class ILibraryAppletProxy;
|
||||
class ISystemAppletProxy;
|
||||
class WindowSystem;
|
||||
|
||||
class IAllSystemAppletProxiesService final
|
||||
: public ServiceFramework<IAllSystemAppletProxiesService> {
|
||||
public:
|
||||
explicit IAllSystemAppletProxiesService(Core::System& system_, WindowSystem& window_system);
|
||||
~IAllSystemAppletProxiesService() override;
|
||||
|
||||
private:
|
||||
Result OpenSystemAppletProxy(Out<SharedPointer<ISystemAppletProxy>> out_system_applet_proxy,
|
||||
ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle);
|
||||
Result OpenLibraryAppletProxy(Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy,
|
||||
ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle,
|
||||
InLargeData<AppletAttribute, BufferAttr_HipcMapAlias> attribute);
|
||||
Result OpenOverlayAppletProxy(Out<SharedPointer<IOverlayAppletProxy>> out_overlay_applet_proxy,
|
||||
ClientProcessId pid, InCopyHandle<Kernel::KProcess> process_handle);
|
||||
Result OpenLibraryAppletProxyOld(
|
||||
Out<SharedPointer<ILibraryAppletProxy>> out_library_applet_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle);
|
||||
Result OpenSystemApplicationProxy(
|
||||
Out<SharedPointer<IApplicationProxy>> out_system_application_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle);
|
||||
Result GetSystemProcessCommonFunctions();
|
||||
Result GetAppletAlternativeFunctions();
|
||||
|
||||
private:
|
||||
std::shared_ptr<Applet> GetAppletFromProcessId(ProcessId pid);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{100, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxy"},
|
||||
FunctionInfo{110, D<&IAllSystemAppletProxiesService::OpenSystemAppletProxy>, "OpenSystemAppletProxyEx"},
|
||||
FunctionInfo{200, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxyOld>, "OpenLibraryAppletProxyOld"},
|
||||
FunctionInfo{201, D<&IAllSystemAppletProxiesService::OpenLibraryAppletProxy>, "OpenLibraryAppletProxy"},
|
||||
FunctionInfo{300, D<&IAllSystemAppletProxiesService::OpenOverlayAppletProxy>, "OpenOverlayAppletProxy"},
|
||||
FunctionInfo{350, D<&IAllSystemAppletProxiesService::OpenSystemApplicationProxy>, "OpenSystemApplicationProxy"},
|
||||
FunctionInfo{400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"},
|
||||
FunctionInfo{410, nullptr, "GetSystemAppletControllerForDebug"},
|
||||
FunctionInfo{450, D<&IAllSystemAppletProxiesService::GetSystemProcessCommonFunctions>, "GetSystemProcessCommonFunctions"}, // 19.0.0+
|
||||
FunctionInfo{460, D<&IAllSystemAppletProxiesService::GetAppletAlternativeFunctions>, "GetAppletAlternativeFunctions"}, // 20.0.0+
|
||||
FunctionInfo{1000, nullptr, "GetDebugFunctions"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
};
|
||||
|
||||
} // namespace AM
|
||||
} // namespace Service
|
||||
@@ -12,6 +12,36 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAppletCommonFunctions::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "SetTerminateResult"},
|
||||
FunctionInfo{10, nullptr, "ReadThemeStorage"},
|
||||
FunctionInfo{11, nullptr, "WriteThemeStorage"},
|
||||
FunctionInfo{20, nullptr, "PushToAppletBoundChannel"},
|
||||
FunctionInfo{21, nullptr, "TryPopFromAppletBoundChannel"},
|
||||
FunctionInfo{40, nullptr, "GetDisplayLogicalResolution"},
|
||||
FunctionInfo{42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"},
|
||||
FunctionInfo{50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"},
|
||||
FunctionInfo{51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"},
|
||||
FunctionInfo{52, nullptr, "IsHomeButtonShortPressedBlocked"},
|
||||
FunctionInfo{60, nullptr, "IsVrModeCurtainRequired"},
|
||||
FunctionInfo{61, nullptr, "IsSleepRequiredByHighTemperature"},
|
||||
FunctionInfo{62, nullptr, "IsSleepRequiredByLowBattery"},
|
||||
FunctionInfo{70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"},
|
||||
FunctionInfo{80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"},
|
||||
FunctionInfo{81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"},
|
||||
FunctionInfo{90, nullptr, "OpenNamedChannelAsParent"},
|
||||
FunctionInfo{91, nullptr, "OpenNamedChannelAsChild"},
|
||||
FunctionInfo{100, nullptr, "SetApplicationCoreUsageMode"},
|
||||
FunctionInfo{300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"},
|
||||
FunctionInfo{310, nullptr, "IsSystemAppletHomeMenu"}, //19.0.0+
|
||||
FunctionInfo{320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost"}, //19.0.0+
|
||||
FunctionInfo{321, nullptr, "SetGpuTimeSliceBoostDueToApplication"}, //19.0.0+
|
||||
FunctionInfo{350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350"} //20.0.0+
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_,
|
||||
std::shared_ptr<Applet> applet_)
|
||||
: ServiceFramework{system_, "IAppletCommonFunctions"}, applet{std::move(applet_)} {
|
||||
|
||||
@@ -27,35 +27,7 @@ private:
|
||||
Result SetGpuTimeSliceBoost(s64 time_span);
|
||||
Result Unknown350(Out<u16> out_unknown);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "SetTerminateResult"},
|
||||
FunctionInfo{10, nullptr, "ReadThemeStorage"},
|
||||
FunctionInfo{11, nullptr, "WriteThemeStorage"},
|
||||
FunctionInfo{20, nullptr, "PushToAppletBoundChannel"},
|
||||
FunctionInfo{21, nullptr, "TryPopFromAppletBoundChannel"},
|
||||
FunctionInfo{40, nullptr, "GetDisplayLogicalResolution"},
|
||||
FunctionInfo{42, D<&IAppletCommonFunctions::SetDisplayMagnification>, "SetDisplayMagnification"},
|
||||
FunctionInfo{50, D<&IAppletCommonFunctions::SetHomeButtonDoubleClickEnabled>, "SetHomeButtonDoubleClickEnabled"},
|
||||
FunctionInfo{51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"},
|
||||
FunctionInfo{52, nullptr, "IsHomeButtonShortPressedBlocked"},
|
||||
FunctionInfo{60, nullptr, "IsVrModeCurtainRequired"},
|
||||
FunctionInfo{61, nullptr, "IsSleepRequiredByHighTemperature"},
|
||||
FunctionInfo{62, nullptr, "IsSleepRequiredByLowBattery"},
|
||||
FunctionInfo{70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"},
|
||||
FunctionInfo{80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"},
|
||||
FunctionInfo{81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"},
|
||||
FunctionInfo{90, nullptr, "OpenNamedChannelAsParent"},
|
||||
FunctionInfo{91, nullptr, "OpenNamedChannelAsChild"},
|
||||
FunctionInfo{100, nullptr, "SetApplicationCoreUsageMode"},
|
||||
FunctionInfo{300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"},
|
||||
FunctionInfo{310, nullptr, "IsSystemAppletHomeMenu"}, //19.0.0+
|
||||
FunctionInfo{320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost"}, //19.0.0+
|
||||
FunctionInfo{321, nullptr, "SetGpuTimeSliceBoostDueToApplication"}, //19.0.0+
|
||||
FunctionInfo{350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350"} //20.0.0+
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
const std::shared_ptr<Applet> applet;
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,38 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IApplicationAccessor::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
||||
FunctionInfo{1, nullptr, "IsCompleted"},
|
||||
FunctionInfo{10, D<&IApplicationAccessor::Start>, "Start"},
|
||||
FunctionInfo{20, D<&IApplicationAccessor::RequestExit>, "RequestExit"},
|
||||
FunctionInfo{25, D<&IApplicationAccessor::Terminate>, "Terminate"},
|
||||
FunctionInfo{30, D<&IApplicationAccessor::GetResult>, "GetResult"},
|
||||
FunctionInfo{101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"},
|
||||
FunctionInfo{110, nullptr, "TerminateAllLibraryApplets"},
|
||||
FunctionInfo{111, nullptr, "AreAnyLibraryAppletsLeft"},
|
||||
FunctionInfo{112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"},
|
||||
FunctionInfo{120, nullptr, "GetApplicationId"},
|
||||
FunctionInfo{121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"},
|
||||
FunctionInfo{122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"},
|
||||
FunctionInfo{123, nullptr, "GetApplicationLaunchProperty"},
|
||||
FunctionInfo{124, nullptr, "GetApplicationLaunchRequestInfo"},
|
||||
FunctionInfo{130, D<&IApplicationAccessor::SetUsers>, "SetUsers"},
|
||||
FunctionInfo{131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"},
|
||||
FunctionInfo{132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"},
|
||||
FunctionInfo{140, nullptr, "GetDesirableUids"},
|
||||
FunctionInfo{150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"},
|
||||
FunctionInfo{160, nullptr, "SetApplicationAttribute"},
|
||||
FunctionInfo{170, nullptr, "HasSaveDataAccessPermission"},
|
||||
FunctionInfo{180, nullptr, "PushToFriendInvitationStorageChannel"},
|
||||
FunctionInfo{190, nullptr, "PushToNotificationStorageChannel"},
|
||||
FunctionInfo{200, nullptr, "RequestApplicationSoftReset"},
|
||||
FunctionInfo{201, nullptr, "RestartApplicationTimer"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IApplicationAccessor::IApplicationAccessor(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "IApplicationAccessor"}, m_window_system(window_system),
|
||||
|
||||
@@ -36,37 +36,7 @@ private:
|
||||
Result GetNsRightsEnvironmentHandle(Out<u64> out_handle);
|
||||
Result ReportApplicationExitTimeout();
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IApplicationAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
||||
FunctionInfo{1, nullptr, "IsCompleted"},
|
||||
FunctionInfo{10, D<&IApplicationAccessor::Start>, "Start"},
|
||||
FunctionInfo{20, D<&IApplicationAccessor::RequestExit>, "RequestExit"},
|
||||
FunctionInfo{25, D<&IApplicationAccessor::Terminate>, "Terminate"},
|
||||
FunctionInfo{30, D<&IApplicationAccessor::GetResult>, "GetResult"},
|
||||
FunctionInfo{101, D<&IApplicationAccessor::RequestForApplicationToGetForeground>, "RequestForApplicationToGetForeground"},
|
||||
FunctionInfo{110, nullptr, "TerminateAllLibraryApplets"},
|
||||
FunctionInfo{111, nullptr, "AreAnyLibraryAppletsLeft"},
|
||||
FunctionInfo{112, D<&IApplicationAccessor::GetCurrentLibraryApplet>, "GetCurrentLibraryApplet"},
|
||||
FunctionInfo{120, nullptr, "GetApplicationId"},
|
||||
FunctionInfo{121, D<&IApplicationAccessor::PushLaunchParameter>, "PushLaunchParameter"},
|
||||
FunctionInfo{122, D<&IApplicationAccessor::GetApplicationControlProperty>, "GetApplicationControlProperty"},
|
||||
FunctionInfo{123, nullptr, "GetApplicationLaunchProperty"},
|
||||
FunctionInfo{124, nullptr, "GetApplicationLaunchRequestInfo"},
|
||||
FunctionInfo{130, D<&IApplicationAccessor::SetUsers>, "SetUsers"},
|
||||
FunctionInfo{131, D<&IApplicationAccessor::CheckRightsEnvironmentAvailable>, "CheckRightsEnvironmentAvailable"},
|
||||
FunctionInfo{132, D<&IApplicationAccessor::GetNsRightsEnvironmentHandle>, "GetNsRightsEnvironmentHandle"},
|
||||
FunctionInfo{140, nullptr, "GetDesirableUids"},
|
||||
FunctionInfo{150, D<&IApplicationAccessor::ReportApplicationExitTimeout>, "ReportApplicationExitTimeout"},
|
||||
FunctionInfo{160, nullptr, "SetApplicationAttribute"},
|
||||
FunctionInfo{170, nullptr, "HasSaveDataAccessPermission"},
|
||||
FunctionInfo{180, nullptr, "PushToFriendInvitationStorageChannel"},
|
||||
FunctionInfo{190, nullptr, "PushToNotificationStorageChannel"},
|
||||
FunctionInfo{200, nullptr, "RequestApplicationSoftReset"},
|
||||
FunctionInfo{201, nullptr, "RestartApplicationTimer"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
WindowSystem& m_window_system;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IApplicationCreator::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"},
|
||||
FunctionInfo{1, nullptr, "PopLaunchRequestedApplication"},
|
||||
FunctionInfo{10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"},
|
||||
FunctionInfo{100, nullptr, "PopFloatingApplicationForDevelopment"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Result CreateGuestApplication(SharedPointer<IApplicationAccessor>* out_application_accessor, Core::System& system, WindowSystem& window_system, u64 program_id) {
|
||||
|
||||
@@ -24,15 +24,7 @@ private:
|
||||
Result CreateApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
|
||||
Result CreateSystemApplication(Out<SharedPointer<IApplicationAccessor>>, u64 application_id);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IApplicationCreator::CreateApplication>, "CreateApplication"},
|
||||
FunctionInfo{1, nullptr, "PopLaunchRequestedApplication"},
|
||||
FunctionInfo{10, D<&IApplicationCreator::CreateSystemApplication>, "CreateSystemApplication"},
|
||||
FunctionInfo{100, nullptr, "PopFloatingApplicationForDevelopment"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
WindowSystem& m_window_system;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/am/service/applet_common_functions.h"
|
||||
#include "core/hle/service/am/service/application_functions.h"
|
||||
#include "core/hle/service/am/service/application_proxy.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"
|
||||
#include "core/hle/service/am/service/display_controller.h"
|
||||
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||
#include "core/hle/service/am/service/self_controller.h"
|
||||
#include "core/hle/service/am/service/window_controller.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
IApplicationProxy::IApplicationProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "IApplicationProxy"},
|
||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
IApplicationProxy::~IApplicationProxy() = default;
|
||||
|
||||
Result IApplicationProxy::GetAudioController(
|
||||
Out<SharedPointer<IAudioController>> out_audio_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetDisplayController(
|
||||
Out<SharedPointer<IDisplayController>> out_display_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetDebugFunctions(
|
||||
Out<SharedPointer<IDebugFunctions>> out_debug_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetWindowController(
|
||||
Out<SharedPointer<IWindowController>> out_window_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetSelfController(
|
||||
Out<SharedPointer<ISelfController>> out_self_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetCommonStateGetter(
|
||||
Out<SharedPointer<ICommonStateGetter>> out_common_state_getter) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_library_applet_creator =
|
||||
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IApplicationProxy::GetApplicationFunctions(
|
||||
Out<SharedPointer<IApplicationFunctions>> out_application_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_application_functions = std::make_shared<IApplicationFunctions>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,63 +0,0 @@
|
||||
// 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 {
|
||||
|
||||
struct Applet;
|
||||
class IAudioController;
|
||||
class IApplicationFunctions;
|
||||
class ICommonStateGetter;
|
||||
class IDebugFunctions;
|
||||
class IDisplayController;
|
||||
class ILibraryAppletCreator;
|
||||
class IProcessWindingController;
|
||||
class ISelfController;
|
||||
class IWindowController;
|
||||
class WindowSystem;
|
||||
|
||||
class IApplicationProxy final : public ServiceFramework<IApplicationProxy> {
|
||||
public:
|
||||
explicit IApplicationProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system);
|
||||
~IApplicationProxy();
|
||||
|
||||
private:
|
||||
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||
Result GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||
Result GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||
Result GetApplicationFunctions(
|
||||
Out<SharedPointer<IApplicationFunctions>> out_application_functions);
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||
FunctionInfo{1, D<&IApplicationProxy::GetSelfController>, "GetSelfController"},
|
||||
FunctionInfo{2, D<&IApplicationProxy::GetWindowController>, "GetWindowController"},
|
||||
FunctionInfo{3, D<&IApplicationProxy::GetAudioController>, "GetAudioController"},
|
||||
FunctionInfo{4, D<&IApplicationProxy::GetDisplayController>, "GetDisplayController"},
|
||||
FunctionInfo{10, D<&IApplicationProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||
FunctionInfo{11, D<&IApplicationProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||
FunctionInfo{20, D<&IApplicationProxy::GetApplicationFunctions>, "GetApplicationFunctions"},
|
||||
FunctionInfo{1000, D<&IApplicationProxy::GetDebugFunctions>, "GetDebugFunctions"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
Kernel::KProcess* const m_process;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,40 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/am/applet_manager.h"
|
||||
#include "core/hle/service/am/service/application_proxy.h"
|
||||
#include "core/hle/service/am/service/application_proxy_service.h"
|
||||
#include "core/hle/service/am/window_system.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
IApplicationProxyService::IApplicationProxyService(Core::System& system_,
|
||||
WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "appletOE"}, m_window_system{window_system} {
|
||||
}
|
||||
|
||||
IApplicationProxyService::~IApplicationProxyService() = default;
|
||||
|
||||
Result IApplicationProxyService::OpenApplicationProxy(
|
||||
Out<SharedPointer<IApplicationProxy>> out_application_proxy, ClientProcessId pid,
|
||||
InCopyHandle<Kernel::KProcess> process_handle) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
if (const auto applet = this->GetAppletFromProcessId(pid)) {
|
||||
*out_application_proxy = std::make_shared<IApplicationProxy>(
|
||||
system, applet, process_handle.Get(), m_window_system);
|
||||
R_SUCCEED();
|
||||
} else {
|
||||
UNIMPLEMENTED();
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Applet> IApplicationProxyService::GetAppletFromProcessId(ProcessId process_id) {
|
||||
return m_window_system.GetByAppletResourceUserId(process_id.pid);
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,39 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 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 {
|
||||
|
||||
namespace AM {
|
||||
|
||||
struct Applet;
|
||||
class IApplicationProxy;
|
||||
class WindowSystem;
|
||||
|
||||
class IApplicationProxyService final : public ServiceFramework<IApplicationProxyService> {
|
||||
public:
|
||||
explicit IApplicationProxyService(Core::System& system_, WindowSystem& window_system);
|
||||
~IApplicationProxyService() override;
|
||||
|
||||
private:
|
||||
Result OpenApplicationProxy(Out<SharedPointer<IApplicationProxy>> out_application_proxy,
|
||||
ClientProcessId pid, InCopyHandle<Kernel::KProcess> process_handle);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Applet> GetAppletFromProcessId(ProcessId pid);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IApplicationProxyService::OpenApplicationProxy>, "OpenApplicationProxy"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
};
|
||||
|
||||
} // namespace AM
|
||||
} // namespace Service
|
||||
@@ -9,6 +9,18 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioController::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"},
|
||||
FunctionInfo{1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"},
|
||||
FunctionInfo{2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"},
|
||||
FunctionInfo{3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"},
|
||||
FunctionInfo{4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"},
|
||||
FunctionInfo{5, nullptr, "Unknown5"} //20.0.0+
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioController::IAudioController(Core::System& system_)
|
||||
: ServiceFramework{system_, "IAudioController"} {
|
||||
}
|
||||
|
||||
@@ -20,17 +20,7 @@ private:
|
||||
Result ChangeMainAppletMasterVolume(f32 volume, s64 fade_time_ns);
|
||||
Result SetTransparentVolumeRate(f32 transparent_volume_rate);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioController::SetExpectedMasterVolume>, "SetExpectedMasterVolume"},
|
||||
FunctionInfo{1, D<&IAudioController::GetMainAppletExpectedMasterVolume>, "GetMainAppletExpectedMasterVolume"},
|
||||
FunctionInfo{2, D<&IAudioController::GetLibraryAppletExpectedMasterVolume>, "GetLibraryAppletExpectedMasterVolume"},
|
||||
FunctionInfo{3, D<&IAudioController::ChangeMainAppletMasterVolume>, "ChangeMainAppletMasterVolume"},
|
||||
FunctionInfo{4, D<&IAudioController::SetTransparentVolumeRate>, "SetTransparentVolumeRate"},
|
||||
FunctionInfo{5, nullptr, "Unknown5"}, //20.0.0+
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
static constexpr float MinAllowedVolume = 0.0f;
|
||||
static constexpr float MaxAllowedVolume = 1.0f;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "core/hle/service/am/am_results.h"
|
||||
#include "core/hle/service/am/applet.h"
|
||||
#include "core/hle/service/am/service/common_state_getter.h"
|
||||
#include "core/hle/service/am/service/lock_accessor.h"
|
||||
#include "core/hle/service/am/service/storage.h"
|
||||
#include "core/hle/service/apm/apm_interface.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
@@ -18,6 +17,145 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* ICommonStateGetter::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"},
|
||||
FunctionInfo{1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"},
|
||||
FunctionInfo{2, nullptr, "GetThisAppletKind"},
|
||||
FunctionInfo{3, nullptr, "AllowToEnterSleep"},
|
||||
FunctionInfo{4, nullptr, "DisallowToEnterSleep"},
|
||||
FunctionInfo{5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"},
|
||||
FunctionInfo{6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"},
|
||||
FunctionInfo{7, nullptr, "GetCradleStatus"},
|
||||
FunctionInfo{8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"},
|
||||
FunctionInfo{9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"},
|
||||
FunctionInfo{10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"},
|
||||
FunctionInfo{11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"},
|
||||
FunctionInfo{12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"},
|
||||
FunctionInfo{13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"},
|
||||
FunctionInfo{14, nullptr, "GetWakeupCount"}, //11.0.0+
|
||||
FunctionInfo{15, nullptr, "Unknown15"}, //19.0.0+
|
||||
FunctionInfo{20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"},
|
||||
FunctionInfo{30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"},
|
||||
FunctionInfo{31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx"}, //2.0.0+
|
||||
FunctionInfo{32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx"}, //7.0.0+
|
||||
FunctionInfo{40, nullptr, "GetCradleFwVersion"}, //2.0.0+
|
||||
FunctionInfo{50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled"}, //3.0.0+
|
||||
FunctionInfo{51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled"}, //3.0.0+
|
||||
FunctionInfo{52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled"}, //4.0.0+
|
||||
FunctionInfo{53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx"}, //7.0.0+
|
||||
FunctionInfo{54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx"}, //7.0.0+
|
||||
FunctionInfo{55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection"}, //3.0.0+
|
||||
FunctionInfo{59, nullptr, "SetVrPositionForDebug"}, //1.0.0+
|
||||
FunctionInfo{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"},
|
||||
FunctionInfo{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"},
|
||||
FunctionInfo{62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"},
|
||||
FunctionInfo{63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"},
|
||||
FunctionInfo{64, nullptr, "SetTvPowerStateMatchingMode"},
|
||||
FunctionInfo{65, nullptr, "GetApplicationIdByContentActionName"},
|
||||
FunctionInfo{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
|
||||
FunctionInfo{67, nullptr, "CancelCpuBoostMode"},
|
||||
FunctionInfo{68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"},
|
||||
FunctionInfo{80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"},
|
||||
FunctionInfo{90, nullptr, "SetPerformanceConfigurationChangedNotification"},
|
||||
FunctionInfo{91, nullptr, "GetCurrentPerformanceConfiguration"},
|
||||
FunctionInfo{100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
||||
FunctionInfo{110, nullptr, "OpenMyGpuErrorHandler"},
|
||||
FunctionInfo{120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory"}, //13.0.0+
|
||||
FunctionInfo{130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage"}, //21.0.0+
|
||||
FunctionInfo{200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"},
|
||||
FunctionInfo{300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"},
|
||||
FunctionInfo{400, nullptr, "ActivateMigrationService"},
|
||||
FunctionInfo{401, nullptr, "DeactivateMigrationService"},
|
||||
FunctionInfo{500, nullptr, "DisableSleepTillShutdown"},
|
||||
FunctionInfo{501, nullptr, "SuppressDisablingSleepTemporarily"},
|
||||
FunctionInfo{502, nullptr, "IsSleepEnabled"},
|
||||
FunctionInfo{503, nullptr, "IsDisablingSleepSuppressed"},
|
||||
FunctionInfo{600, nullptr, "SetHidInputMagnificationForApplication"}, //20.0.0+
|
||||
FunctionInfo{610, D<&ICommonStateGetter::Unknown610>, "Unknown610"}, //21.0.0+
|
||||
FunctionInfo{611, D<&ICommonStateGetter::Unknown611>, "Unknown611"}, //22.0.0+
|
||||
FunctionInfo{900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, //11.0.0+
|
||||
FunctionInfo{910, nullptr, "GetLaunchRequiredTick"}, //17.0.0+
|
||||
FunctionInfo{1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d"}, //19.0.0+
|
||||
FunctionInfo{1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d"}, //19.0.0+
|
||||
FunctionInfo{1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d"}, //19.0.0+
|
||||
FunctionInfo{1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport"}, //21.0.0+
|
||||
FunctionInfo{1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle"}, //21.0.0+
|
||||
FunctionInfo{1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle"} //21.0.0+
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
class ILockAccessor final : public ServiceFramework<ILockAccessor> {
|
||||
public:
|
||||
explicit ILockAccessor(Core::System& system_)
|
||||
: ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"},
|
||||
m_event{m_context} {
|
||||
m_event.Signal(system.Kernel());
|
||||
}
|
||||
~ILockAccessor() override = default;
|
||||
|
||||
Result TryLock(Out<bool> out_is_locked, OutCopyHandle<Kernel::KReadableEvent> out_handle, bool return_handle) {
|
||||
LOG_INFO(Service_AM, "called, return_handle={}", return_handle);
|
||||
|
||||
{
|
||||
std::scoped_lock lk{m_mutex};
|
||||
if (m_is_locked) {
|
||||
*out_is_locked = false;
|
||||
} else {
|
||||
m_is_locked = true;
|
||||
*out_is_locked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (return_handle) {
|
||||
*out_handle = m_event.GetHandle();
|
||||
}
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result Unlock() {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
|
||||
{
|
||||
std::scoped_lock lk{m_mutex};
|
||||
m_is_locked = false;
|
||||
}
|
||||
|
||||
m_event.Signal(system.Kernel());
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_handle) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_handle = m_event.GetHandle();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IsLocked(Out<bool> out_is_locked) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
std::scoped_lock lk{m_mutex};
|
||||
*out_is_locked = m_is_locked;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{1, D<&ILockAccessor::TryLock>, "TryLock"},
|
||||
FunctionInfo{2, D<&ILockAccessor::Unlock>, "Unlock"},
|
||||
FunctionInfo{3, D<&ILockAccessor::GetEvent>, "GetEvent"},
|
||||
FunctionInfo{4, D<&ILockAccessor::IsLocked>, "IsLocked"}
|
||||
);
|
||||
KernelHelpers::ServiceContext m_context;
|
||||
Event m_event;
|
||||
std::mutex m_mutex{};
|
||||
bool m_is_locked{};
|
||||
};
|
||||
|
||||
ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr<Applet> applet)
|
||||
: ServiceFramework{system_, "ICommonStateGetter"}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
@@ -76,74 +76,7 @@ private:
|
||||
|
||||
void SetCpuBoostMode(HLERequestContext& ctx);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ICommonStateGetter::GetEventHandle>, "GetEventHandle"},
|
||||
FunctionInfo{1, D<&ICommonStateGetter::ReceiveMessage>, "ReceiveMessage"},
|
||||
FunctionInfo{2, nullptr, "GetThisAppletKind"},
|
||||
FunctionInfo{3, nullptr, "AllowToEnterSleep"},
|
||||
FunctionInfo{4, nullptr, "DisallowToEnterSleep"},
|
||||
FunctionInfo{5, D<&ICommonStateGetter::GetOperationMode>, "GetOperationMode"},
|
||||
FunctionInfo{6, D<&ICommonStateGetter::GetPerformanceMode>, "GetPerformanceMode"},
|
||||
FunctionInfo{7, nullptr, "GetCradleStatus"},
|
||||
FunctionInfo{8, D<&ICommonStateGetter::GetBootMode>, "GetBootMode"},
|
||||
FunctionInfo{9, D<&ICommonStateGetter::GetCurrentFocusState>, "GetCurrentFocusState"},
|
||||
FunctionInfo{10, D<&ICommonStateGetter::RequestToAcquireSleepLock>, "RequestToAcquireSleepLock"},
|
||||
FunctionInfo{11, D<&ICommonStateGetter::ReleaseSleepLock>, "ReleaseSleepLock"},
|
||||
FunctionInfo{12, D<&ICommonStateGetter::ReleaseSleepLockTransiently>, "ReleaseSleepLockTransiently"},
|
||||
FunctionInfo{13, D<&ICommonStateGetter::GetAcquiredSleepLockEvent>, "GetAcquiredSleepLockEvent"},
|
||||
FunctionInfo{14, nullptr, "GetWakeupCount"}, //11.0.0+
|
||||
FunctionInfo{15, nullptr, "Unknown15"}, //19.0.0+
|
||||
FunctionInfo{20, D<&ICommonStateGetter::PushToGeneralChannel>, "PushToGeneralChannel"},
|
||||
FunctionInfo{30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"},
|
||||
FunctionInfo{31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx"}, //2.0.0+
|
||||
FunctionInfo{32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx"}, //7.0.0+
|
||||
FunctionInfo{40, nullptr, "GetCradleFwVersion"}, //2.0.0+
|
||||
FunctionInfo{50, D<&ICommonStateGetter::IsVrModeEnabled>, "IsVrModeEnabled"}, //3.0.0+
|
||||
FunctionInfo{51, D<&ICommonStateGetter::SetVrModeEnabled>, "SetVrModeEnabled"}, //3.0.0+
|
||||
FunctionInfo{52, D<&ICommonStateGetter::SetLcdBacklighOffEnabled>, "SetLcdBacklighOffEnabled"}, //4.0.0+
|
||||
FunctionInfo{53, D<&ICommonStateGetter::BeginVrModeEx>, "BeginVrModeEx"}, //7.0.0+
|
||||
FunctionInfo{54, D<&ICommonStateGetter::EndVrModeEx>, "EndVrModeEx"}, //7.0.0+
|
||||
FunctionInfo{55, D<&ICommonStateGetter::IsInControllerFirmwareUpdateSection>, "IsInControllerFirmwareUpdateSection"}, //3.0.0+
|
||||
FunctionInfo{59, nullptr, "SetVrPositionForDebug"}, //1.0.0+
|
||||
FunctionInfo{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"},
|
||||
FunctionInfo{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"},
|
||||
FunctionInfo{62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"},
|
||||
FunctionInfo{63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"},
|
||||
FunctionInfo{64, nullptr, "SetTvPowerStateMatchingMode"},
|
||||
FunctionInfo{65, nullptr, "GetApplicationIdByContentActionName"},
|
||||
FunctionInfo{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
|
||||
FunctionInfo{67, nullptr, "CancelCpuBoostMode"},
|
||||
FunctionInfo{68, D<&ICommonStateGetter::GetBuiltInDisplayType>, "GetBuiltInDisplayType"},
|
||||
FunctionInfo{80, D<&ICommonStateGetter::PerformSystemButtonPressingIfInFocus>, "PerformSystemButtonPressingIfInFocus"},
|
||||
FunctionInfo{90, nullptr, "SetPerformanceConfigurationChangedNotification"},
|
||||
FunctionInfo{91, nullptr, "GetCurrentPerformanceConfiguration"},
|
||||
FunctionInfo{100, D<&ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
||||
FunctionInfo{110, nullptr, "OpenMyGpuErrorHandler"},
|
||||
FunctionInfo{120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory"}, //13.0.0+
|
||||
FunctionInfo{130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage"}, //21.0.0+
|
||||
FunctionInfo{200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"},
|
||||
FunctionInfo{300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"},
|
||||
FunctionInfo{400, nullptr, "ActivateMigrationService"},
|
||||
FunctionInfo{401, nullptr, "DeactivateMigrationService"},
|
||||
FunctionInfo{500, nullptr, "DisableSleepTillShutdown"},
|
||||
FunctionInfo{501, nullptr, "SuppressDisablingSleepTemporarily"},
|
||||
FunctionInfo{502, nullptr, "IsSleepEnabled"},
|
||||
FunctionInfo{503, nullptr, "IsDisablingSleepSuppressed"},
|
||||
FunctionInfo{600, nullptr, "SetHidInputMagnificationForApplication"}, //20.0.0+
|
||||
FunctionInfo{610, D<&ICommonStateGetter::Unknown610>, "Unknown610"}, //21.0.0+
|
||||
FunctionInfo{611, D<&ICommonStateGetter::Unknown611>, "Unknown611"}, //22.0.0+
|
||||
FunctionInfo{900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, //11.0.0+
|
||||
FunctionInfo{910, nullptr, "GetLaunchRequiredTick"}, //17.0.0+
|
||||
FunctionInfo{1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d"}, //19.0.0+
|
||||
FunctionInfo{1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d"}, //19.0.0+
|
||||
FunctionInfo{1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d"}, //19.0.0+
|
||||
FunctionInfo{1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport"}, //21.0.0+
|
||||
FunctionInfo{1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle"}, //21.0.0+
|
||||
FunctionInfo{1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle"}, //21.0.0+
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,18 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* ICradleFirmwareUpdater::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"},
|
||||
FunctionInfo{1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"},
|
||||
FunctionInfo{2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"},
|
||||
FunctionInfo{3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"},
|
||||
FunctionInfo{4, nullptr, "GetUpdateProgressInfo"},
|
||||
FunctionInfo{5, nullptr, "GetLastInternalResult"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_)
|
||||
: ServiceFramework{system_, "ICradleFirmwareUpdater"},
|
||||
m_context{system, "ICradleFirmwareUpdater"}, m_cradle_device_info_event{m_context} {
|
||||
|
||||
@@ -30,17 +30,7 @@ private:
|
||||
Result GetCradleDeviceInfoChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"},
|
||||
FunctionInfo{1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"},
|
||||
FunctionInfo{2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"},
|
||||
FunctionInfo{3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"},
|
||||
FunctionInfo{4, nullptr, "GetUpdateProgressInfo"},
|
||||
FunctionInfo{5, nullptr, "GetLastInternalResult"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
KernelHelpers::ServiceContext m_context;
|
||||
Event m_cradle_device_info_event;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,40 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IDisplayController::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "GetLastForegroundCaptureImage"},
|
||||
FunctionInfo{1, nullptr, "UpdateLastForegroundCaptureImage"},
|
||||
FunctionInfo{2, nullptr, "GetLastApplicationCaptureImage"},
|
||||
FunctionInfo{3, nullptr, "GetCallerAppletCaptureImage"},
|
||||
FunctionInfo{4, nullptr, "UpdateCallerAppletCaptureImage"},
|
||||
FunctionInfo{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"},
|
||||
FunctionInfo{6, nullptr, "GetLastApplicationCaptureImageEx"},
|
||||
FunctionInfo{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"},
|
||||
FunctionInfo{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"},
|
||||
FunctionInfo{9, nullptr, "CopyBetweenCaptureBuffers"},
|
||||
FunctionInfo{10, nullptr, "AcquireLastApplicationCaptureBuffer"},
|
||||
FunctionInfo{11, nullptr, "ReleaseLastApplicationCaptureBuffer"},
|
||||
FunctionInfo{12, nullptr, "AcquireLastForegroundCaptureBuffer"},
|
||||
FunctionInfo{13, nullptr, "ReleaseLastForegroundCaptureBuffer"},
|
||||
FunctionInfo{14, nullptr, "AcquireCallerAppletCaptureBuffer"},
|
||||
FunctionInfo{15, nullptr, "ReleaseCallerAppletCaptureBuffer"},
|
||||
FunctionInfo{16, nullptr, "AcquireLastApplicationCaptureBufferEx"},
|
||||
FunctionInfo{17, nullptr, "AcquireLastForegroundCaptureBufferEx"},
|
||||
FunctionInfo{18, nullptr, "AcquireCallerAppletCaptureBufferEx"},
|
||||
FunctionInfo{20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"},
|
||||
FunctionInfo{21, nullptr, "ClearAppletTransitionBuffer"},
|
||||
FunctionInfo{22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"},
|
||||
FunctionInfo{23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"},
|
||||
FunctionInfo{24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"},
|
||||
FunctionInfo{25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"},
|
||||
FunctionInfo{26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"},
|
||||
FunctionInfo{27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"},
|
||||
FunctionInfo{28, nullptr, "TakeScreenShotOfOwnLayerEx"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IDisplayController::IDisplayController(Core::System& system_, std::shared_ptr<Applet> applet_)
|
||||
: ServiceFramework{system_, "IDisplayController"}, applet(std::move(applet_)) {
|
||||
}
|
||||
|
||||
@@ -35,39 +35,7 @@ private:
|
||||
Out<s32> out_fbshare_layer_index);
|
||||
Result ReleaseLastApplicationCaptureSharedBuffer();
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "GetLastForegroundCaptureImage"},
|
||||
FunctionInfo{1, nullptr, "UpdateLastForegroundCaptureImage"},
|
||||
FunctionInfo{2, nullptr, "GetLastApplicationCaptureImage"},
|
||||
FunctionInfo{3, nullptr, "GetCallerAppletCaptureImage"},
|
||||
FunctionInfo{4, nullptr, "UpdateCallerAppletCaptureImage"},
|
||||
FunctionInfo{5, D<&IDisplayController::GetLastForegroundCaptureImageEx>, "GetLastForegroundCaptureImageEx"},
|
||||
FunctionInfo{6, nullptr, "GetLastApplicationCaptureImageEx"},
|
||||
FunctionInfo{7, D<&IDisplayController::GetCallerAppletCaptureImageEx>, "GetCallerAppletCaptureImageEx"},
|
||||
FunctionInfo{8, D<&IDisplayController::TakeScreenShotOfOwnLayer>, "TakeScreenShotOfOwnLayer"},
|
||||
FunctionInfo{9, nullptr, "CopyBetweenCaptureBuffers"},
|
||||
FunctionInfo{10, nullptr, "AcquireLastApplicationCaptureBuffer"},
|
||||
FunctionInfo{11, nullptr, "ReleaseLastApplicationCaptureBuffer"},
|
||||
FunctionInfo{12, nullptr, "AcquireLastForegroundCaptureBuffer"},
|
||||
FunctionInfo{13, nullptr, "ReleaseLastForegroundCaptureBuffer"},
|
||||
FunctionInfo{14, nullptr, "AcquireCallerAppletCaptureBuffer"},
|
||||
FunctionInfo{15, nullptr, "ReleaseCallerAppletCaptureBuffer"},
|
||||
FunctionInfo{16, nullptr, "AcquireLastApplicationCaptureBufferEx"},
|
||||
FunctionInfo{17, nullptr, "AcquireLastForegroundCaptureBufferEx"},
|
||||
FunctionInfo{18, nullptr, "AcquireCallerAppletCaptureBufferEx"},
|
||||
FunctionInfo{20, D<&IDisplayController::ClearCaptureBuffer>, "ClearCaptureBuffer"},
|
||||
FunctionInfo{21, nullptr, "ClearAppletTransitionBuffer"},
|
||||
FunctionInfo{22, D<&IDisplayController::AcquireLastApplicationCaptureSharedBuffer>, "AcquireLastApplicationCaptureSharedBuffer"},
|
||||
FunctionInfo{23, D<&IDisplayController::ReleaseLastApplicationCaptureSharedBuffer>, "ReleaseLastApplicationCaptureSharedBuffer"},
|
||||
FunctionInfo{24, D<&IDisplayController::AcquireLastForegroundCaptureSharedBuffer>, "AcquireLastForegroundCaptureSharedBuffer"},
|
||||
FunctionInfo{25, D<&IDisplayController::ReleaseLastForegroundCaptureSharedBuffer>, "ReleaseLastForegroundCaptureSharedBuffer"},
|
||||
FunctionInfo{26, D<&IDisplayController::AcquireCallerAppletCaptureSharedBuffer>, "AcquireCallerAppletCaptureSharedBuffer"},
|
||||
FunctionInfo{27, D<&IDisplayController::ReleaseCallerAppletCaptureSharedBuffer>, "ReleaseCallerAppletCaptureSharedBuffer"},
|
||||
FunctionInfo{28, nullptr, "TakeScreenShotOfOwnLayerEx"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
const std::shared_ptr<Applet> applet;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,25 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IGlobalStateController::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "RequestToEnterSleep"},
|
||||
FunctionInfo{1, nullptr, "EnterSleep"},
|
||||
FunctionInfo{2, nullptr, "StartSleepSequence"},
|
||||
FunctionInfo{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"},
|
||||
FunctionInfo{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"},
|
||||
FunctionInfo{9, nullptr, "IsAutoPowerDownRequested"},
|
||||
FunctionInfo{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"},
|
||||
FunctionInfo{11, nullptr, "NotifyCecSettingsChanged"},
|
||||
FunctionInfo{12, nullptr, "SetDefaultHomeButtonLongPressTime"},
|
||||
FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"},
|
||||
FunctionInfo{14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"},
|
||||
FunctionInfo{15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"},
|
||||
FunctionInfo{30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IGlobalStateController::IGlobalStateController(Core::System& system_)
|
||||
: ServiceFramework{system_, "IGlobalStateController"},
|
||||
m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} {
|
||||
|
||||
@@ -25,24 +25,7 @@ private:
|
||||
Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result OpenCradleFirmwareUpdater(Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "RequestToEnterSleep"},
|
||||
FunctionInfo{1, nullptr, "EnterSleep"},
|
||||
FunctionInfo{2, nullptr, "StartSleepSequence"},
|
||||
FunctionInfo{3, D<&IGlobalStateController::StartShutdownSequence>, "StartShutdownSequence"},
|
||||
FunctionInfo{4, D<&IGlobalStateController::StartRebootSequence>, "StartRebootSequence"},
|
||||
FunctionInfo{9, nullptr, "IsAutoPowerDownRequested"},
|
||||
FunctionInfo{10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"},
|
||||
FunctionInfo{11, nullptr, "NotifyCecSettingsChanged"},
|
||||
FunctionInfo{12, nullptr, "SetDefaultHomeButtonLongPressTime"},
|
||||
FunctionInfo{13, nullptr, "UpdateDefaultDisplayResolution"},
|
||||
FunctionInfo{14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"},
|
||||
FunctionInfo{15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"},
|
||||
FunctionInfo{30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
KernelHelpers::ServiceContext m_context;
|
||||
Event m_hdcp_authentication_failed_event;
|
||||
};
|
||||
|
||||
@@ -14,6 +14,27 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IHomeMenuFunctions::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"},
|
||||
FunctionInfo{11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"},
|
||||
FunctionInfo{12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"},
|
||||
FunctionInfo{20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"},
|
||||
FunctionInfo{21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"},
|
||||
FunctionInfo{30, nullptr, "GetHomeButtonWriterLockAccessor"},
|
||||
FunctionInfo{31, nullptr, "GetWriterLockAccessorEx"},
|
||||
FunctionInfo{40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"},
|
||||
FunctionInfo{41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"},
|
||||
FunctionInfo{50, nullptr, "LaunchSystemApplet"},
|
||||
FunctionInfo{51, nullptr, "LaunchStarter"},
|
||||
FunctionInfo{100, nullptr, "PopRequestLaunchApplicationForDebug"},
|
||||
FunctionInfo{110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"},
|
||||
FunctionInfo{200, nullptr, "LaunchDevMenu"},
|
||||
FunctionInfo{1000, nullptr, "SetLastApplicationExitReason"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "IHomeMenuFunctions"}, m_window_system{window_system},
|
||||
|
||||
@@ -34,26 +34,7 @@ private:
|
||||
Result IsForceTerminateApplicationDisabledForDebug(
|
||||
Out<bool> out_is_force_terminate_application_disabled_for_debug);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"},
|
||||
FunctionInfo{11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"},
|
||||
FunctionInfo{12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"},
|
||||
FunctionInfo{20, D<&IHomeMenuFunctions::PopFromGeneralChannel>, "PopFromGeneralChannel"},
|
||||
FunctionInfo{21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"},
|
||||
FunctionInfo{30, nullptr, "GetHomeButtonWriterLockAccessor"},
|
||||
FunctionInfo{31, nullptr, "GetWriterLockAccessorEx"},
|
||||
FunctionInfo{40, D<&IHomeMenuFunctions::IsSleepEnabled>, "IsSleepEnabled"},
|
||||
FunctionInfo{41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"},
|
||||
FunctionInfo{50, nullptr, "LaunchSystemApplet"},
|
||||
FunctionInfo{51, nullptr, "LaunchStarter"},
|
||||
FunctionInfo{100, nullptr, "PopRequestLaunchApplicationForDebug"},
|
||||
FunctionInfo{110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"},
|
||||
FunctionInfo{200, nullptr, "LaunchDevMenu"},
|
||||
FunctionInfo{1000, nullptr, "SetLastApplicationExitReason"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
WindowSystem& m_window_system;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
KernelHelpers::ServiceContext m_context;
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
namespace {
|
||||
|
||||
void EnableSingleUserPlay(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||
static void EnableSingleUserPlay(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||
constexpr s64 DisplayOptionsOffset = 0x90;
|
||||
constexpr s64 IsSkipEnabledOffset = 1;
|
||||
constexpr s64 ShowSkipButtonOffset = 4;
|
||||
@@ -29,7 +27,7 @@ void EnableSingleUserPlay(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||
impl->Write(DisplayOptionsOffset + ShowSkipButtonOffset, &enabled, sizeof(enabled));
|
||||
}
|
||||
|
||||
void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||
static void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr<LibraryAppletStorage>& impl) {
|
||||
Frontend::UiReturnArg return_arg{};
|
||||
impl->Read(0, &return_arg, sizeof(return_arg));
|
||||
|
||||
@@ -47,7 +45,34 @@ void ReplaceEmptyUuidWithCurrentUser(const std::shared_ptr<LibraryAppletStorage>
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
ServiceFrameworkBase::FunctionInfoBase const* ILibraryAppletAccessor::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
||||
FunctionInfo{1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"},
|
||||
FunctionInfo{10, D<&ILibraryAppletAccessor::Start>, "Start"},
|
||||
FunctionInfo{20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"},
|
||||
FunctionInfo{25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"},
|
||||
FunctionInfo{30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"},
|
||||
FunctionInfo{50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
|
||||
FunctionInfo{60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero"}, //10.0.0+
|
||||
FunctionInfo{80, nullptr, "RequestForLibraryAppletToGetForeground"}, //19.0.0+
|
||||
FunctionInfo{81, nullptr, "GetCurrentChildLibraryApplet"}, //19.0.0+
|
||||
FunctionInfo{90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90"}, //20.0.0+
|
||||
FunctionInfo{100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"},
|
||||
FunctionInfo{101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"},
|
||||
FunctionInfo{102, nullptr, "PushExtraStorage"},
|
||||
FunctionInfo{103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"},
|
||||
FunctionInfo{104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"},
|
||||
FunctionInfo{105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"},
|
||||
FunctionInfo{106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"},
|
||||
FunctionInfo{110, nullptr, "NeedsToExitProcess"},
|
||||
FunctionInfo{120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"},
|
||||
FunctionInfo{150, nullptr, "RequestForAppletToGetForeground"},
|
||||
FunctionInfo{160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle"}, //2.0.0+
|
||||
FunctionInfo{170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170"} //22.0.0+
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
ILibraryAppletAccessor::ILibraryAppletAccessor(Core::System& system_,
|
||||
std::shared_ptr<AppletDataBroker> broker,
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/am/service/library_applet_self_accessor.h"
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
@@ -16,6 +15,26 @@ class AppletDataBroker;
|
||||
struct Applet;
|
||||
class IStorage;
|
||||
|
||||
struct LibraryAppletInfo {
|
||||
AppletId applet_id;
|
||||
LibraryAppletMode library_applet_mode;
|
||||
};
|
||||
static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size.");
|
||||
|
||||
struct ErrorCode {
|
||||
u32 category;
|
||||
u32 number;
|
||||
};
|
||||
static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size.");
|
||||
|
||||
struct ErrorContext {
|
||||
u8 type;
|
||||
INSERT_PADDING_BYTES_NOINIT(0x7);
|
||||
std::array<u8, 0x1f4> data;
|
||||
Result result;
|
||||
};
|
||||
static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size.");
|
||||
|
||||
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
||||
public:
|
||||
explicit ILibraryAppletAccessor(Core::System& system_, std::shared_ptr<AppletDataBroker> broker,
|
||||
@@ -49,34 +68,7 @@ private:
|
||||
void FrontendExecuteInteractive();
|
||||
void FrontendRequestExit();
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ILibraryAppletAccessor::GetAppletStateChangedEvent>, "GetAppletStateChangedEvent"},
|
||||
FunctionInfo{1, D<&ILibraryAppletAccessor::IsCompleted>, "IsCompleted"},
|
||||
FunctionInfo{10, D<&ILibraryAppletAccessor::Start>, "Start"},
|
||||
FunctionInfo{20, D<&ILibraryAppletAccessor::RequestExit>, "RequestExit"},
|
||||
FunctionInfo{25, D<&ILibraryAppletAccessor::Terminate>, "Terminate"},
|
||||
FunctionInfo{30, D<&ILibraryAppletAccessor::GetResult>, "GetResult"},
|
||||
FunctionInfo{50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
|
||||
FunctionInfo{60, D<&ILibraryAppletAccessor::PresetLibraryAppletGpuTimeSliceZero>, "PresetLibraryAppletGpuTimeSliceZero"}, //10.0.0+
|
||||
FunctionInfo{80, nullptr, "RequestForLibraryAppletToGetForeground"}, //19.0.0+
|
||||
FunctionInfo{81, nullptr, "GetCurrentChildLibraryApplet"}, //19.0.0+
|
||||
FunctionInfo{90, D<&ILibraryAppletAccessor::Unknown90>, "Unknown90"}, //20.0.0+
|
||||
FunctionInfo{100, D<&ILibraryAppletAccessor::PushInData>, "PushInData"},
|
||||
FunctionInfo{101, D<&ILibraryAppletAccessor::PopOutData>, "PopOutData"},
|
||||
FunctionInfo{102, nullptr, "PushExtraStorage"},
|
||||
FunctionInfo{103, D<&ILibraryAppletAccessor::PushInteractiveInData>, "PushInteractiveInData"},
|
||||
FunctionInfo{104, D<&ILibraryAppletAccessor::PopInteractiveOutData>, "PopInteractiveOutData"},
|
||||
FunctionInfo{105, D<&ILibraryAppletAccessor::GetPopOutDataEvent>, "GetPopOutDataEvent"},
|
||||
FunctionInfo{106, D<&ILibraryAppletAccessor::GetPopInteractiveOutDataEvent>, "GetPopInteractiveOutDataEvent"},
|
||||
FunctionInfo{110, nullptr, "NeedsToExitProcess"},
|
||||
FunctionInfo{120, D<&ILibraryAppletAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"},
|
||||
FunctionInfo{150, nullptr, "RequestForAppletToGetForeground"},
|
||||
FunctionInfo{160, D<&ILibraryAppletAccessor::GetIndirectLayerConsumerHandle>, "GetIndirectLayerConsumerHandle"}, //2.0.0+
|
||||
FunctionInfo{170, D<&ILibraryAppletAccessor::Unknown170>, "Unknown170"}, //22.0.0+
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
const std::shared_ptr<AppletDataBroker> m_broker;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
@@ -1,277 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/service/am/applet_data_broker.h"
|
||||
#include "core/hle/service/am/applet_manager.h"
|
||||
#include "core/hle/service/am/frontend/applets.h"
|
||||
#include "core/hle/service/am/library_applet_storage.h"
|
||||
#include "core/hle/service/am/process_creation.h"
|
||||
#include "core/hle/service/am/service/library_applet_accessor.h"
|
||||
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||
|
||||
#include "core/hle/api_version.h"
|
||||
#include "core/hle/service/am/service/storage.h"
|
||||
#include "core/hle/service/am/window_system.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
namespace {
|
||||
|
||||
bool ShouldCreateGuestApplet(AppletId applet_id) {
|
||||
#define X(Name, name) \
|
||||
if (applet_id == AppletId::Name && \
|
||||
Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \
|
||||
return false; \
|
||||
}
|
||||
|
||||
X(Cabinet, cabinet)
|
||||
X(Controller, controller)
|
||||
X(DataErase, data_erase)
|
||||
X(Error, error)
|
||||
X(NetConnect, net_connect)
|
||||
X(ProfileSelect, player_select)
|
||||
X(SoftwareKeyboard, swkbd)
|
||||
X(MiiEdit, mii_edit)
|
||||
X(Web, web)
|
||||
X(Shop, shop)
|
||||
X(PhotoViewer, photo_viewer)
|
||||
X(OfflineWeb, offline_web)
|
||||
X(LoginShare, login_share)
|
||||
X(WebAuth, wifi_web_auth)
|
||||
X(MyPage, my_page)
|
||||
|
||||
#undef X
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
AppletProgramId AppletIdToProgramId(AppletId applet_id) {
|
||||
switch (applet_id) {
|
||||
case AppletId::OverlayDisplay:
|
||||
return AppletProgramId::OverlayDisplay;
|
||||
case AppletId::QLaunch:
|
||||
return AppletProgramId::QLaunch;
|
||||
case AppletId::Starter:
|
||||
return AppletProgramId::Starter;
|
||||
case AppletId::Auth:
|
||||
return AppletProgramId::Auth;
|
||||
case AppletId::Cabinet:
|
||||
return AppletProgramId::Cabinet;
|
||||
case AppletId::Controller:
|
||||
return AppletProgramId::Controller;
|
||||
case AppletId::DataErase:
|
||||
return AppletProgramId::DataErase;
|
||||
case AppletId::Error:
|
||||
return AppletProgramId::Error;
|
||||
case AppletId::NetConnect:
|
||||
return AppletProgramId::NetConnect;
|
||||
case AppletId::ProfileSelect:
|
||||
return AppletProgramId::ProfileSelect;
|
||||
case AppletId::SoftwareKeyboard:
|
||||
return AppletProgramId::SoftwareKeyboard;
|
||||
case AppletId::MiiEdit:
|
||||
return AppletProgramId::MiiEdit;
|
||||
case AppletId::Web:
|
||||
return AppletProgramId::Web;
|
||||
case AppletId::Shop:
|
||||
return AppletProgramId::Shop;
|
||||
case AppletId::PhotoViewer:
|
||||
return AppletProgramId::PhotoViewer;
|
||||
case AppletId::Settings:
|
||||
return AppletProgramId::Settings;
|
||||
case AppletId::OfflineWeb:
|
||||
return AppletProgramId::OfflineWeb;
|
||||
case AppletId::LoginShare:
|
||||
return AppletProgramId::LoginShare;
|
||||
case AppletId::WebAuth:
|
||||
return AppletProgramId::WebAuth;
|
||||
case AppletId::MyPage:
|
||||
return AppletProgramId::MyPage;
|
||||
default:
|
||||
return static_cast<AppletProgramId>(0);
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system,
|
||||
WindowSystem& window_system,
|
||||
std::shared_ptr<Applet> caller_applet,
|
||||
AppletId applet_id,
|
||||
LibraryAppletMode mode) {
|
||||
const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id));
|
||||
if (program_id == 0) {
|
||||
// Unknown applet
|
||||
return {};
|
||||
}
|
||||
|
||||
auto process = CreateProcess(system, program_id, 1, HLE::ApiVersion::HOS_VERSION_MAJOR);
|
||||
if (process) {
|
||||
const auto applet = std::make_shared<Applet>(system, std::move(process), false);
|
||||
applet->program_id = program_id;
|
||||
applet->applet_id = applet_id;
|
||||
applet->type = AppletType::LibraryApplet;
|
||||
applet->library_applet_mode = mode;
|
||||
applet->window_visible = mode != LibraryAppletMode::AllForegroundInitiallyHidden;
|
||||
|
||||
auto broker = std::make_shared<AppletDataBroker>(system);
|
||||
applet->caller_applet = caller_applet;
|
||||
applet->caller_applet_broker = broker;
|
||||
{
|
||||
std::scoped_lock lk{caller_applet->lock};
|
||||
caller_applet->child_applets.push_back(applet);
|
||||
}
|
||||
window_system.TrackApplet(applet, false);
|
||||
return std::make_shared<ILibraryAppletAccessor>(system, broker, applet);
|
||||
}
|
||||
// Couldn't initialize the guest process
|
||||
return {};
|
||||
}
|
||||
|
||||
std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& system,
|
||||
WindowSystem& window_system,
|
||||
std::shared_ptr<Applet> caller_applet,
|
||||
AppletId applet_id,
|
||||
LibraryAppletMode mode) {
|
||||
const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id));
|
||||
|
||||
auto process = std::make_unique<Process>(system);
|
||||
auto applet = std::make_shared<Applet>(system, std::move(process), false);
|
||||
applet->program_id = program_id;
|
||||
applet->applet_id = applet_id;
|
||||
applet->type = AppletType::LibraryApplet;
|
||||
applet->library_applet_mode = mode;
|
||||
|
||||
auto storage = std::make_shared<AppletDataBroker>(system);
|
||||
applet->caller_applet = caller_applet;
|
||||
applet->caller_applet_broker = storage;
|
||||
applet->frontend = system.GetFrontendAppletHolder().GetApplet(applet, applet_id, mode);
|
||||
{
|
||||
std::scoped_lock lk{caller_applet->lock};
|
||||
caller_applet->child_applets.push_back(applet);
|
||||
}
|
||||
return std::make_shared<ILibraryAppletAccessor>(system, storage, applet);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "ILibraryAppletCreator"},
|
||||
m_window_system{window_system}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
ILibraryAppletCreator::~ILibraryAppletCreator() = default;
|
||||
|
||||
Result ILibraryAppletCreator::CreateLibraryApplet(
|
||||
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||
LibraryAppletMode library_applet_mode) {
|
||||
LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={}", applet_id,
|
||||
library_applet_mode);
|
||||
|
||||
std::shared_ptr<ILibraryAppletAccessor> library_applet;
|
||||
if (ShouldCreateGuestApplet(applet_id)) {
|
||||
library_applet =
|
||||
CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||
}
|
||||
if (!library_applet) {
|
||||
library_applet =
|
||||
CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||
}
|
||||
if (!library_applet) {
|
||||
LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id);
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
// Applet is created, can now be launched.
|
||||
m_applet->library_applet_launchable_event.Signal(system.Kernel());
|
||||
*out_library_applet_accessor = library_applet;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletCreator::CreateLibraryAppletEx(
|
||||
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||
LibraryAppletMode library_applet_mode, u64 thread_id) {
|
||||
LOG_DEBUG(Service_AM, "called with applet_id={} applet_mode={} thread_id={}", applet_id,
|
||||
library_applet_mode, thread_id);
|
||||
|
||||
std::shared_ptr<ILibraryAppletAccessor> library_applet;
|
||||
if (ShouldCreateGuestApplet(applet_id)) {
|
||||
library_applet =
|
||||
CreateGuestApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||
}
|
||||
if (!library_applet) {
|
||||
library_applet =
|
||||
CreateFrontendApplet(system, m_window_system, m_applet, applet_id, library_applet_mode);
|
||||
}
|
||||
if (!library_applet) {
|
||||
LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id);
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
// Applet is created, can now be launched.
|
||||
m_applet->library_applet_launchable_event.Signal(system.Kernel());
|
||||
*out_library_applet_accessor = library_applet;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletCreator::CreateStorage(Out<SharedPointer<IStorage>> out_storage, s64 size) {
|
||||
LOG_DEBUG(Service_AM, "called, size={}", size);
|
||||
|
||||
if (size <= 0) {
|
||||
LOG_ERROR(Service_AM, "size is less than or equal to 0");
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
*out_storage = std::make_shared<IStorage>(system, AM::CreateStorage(std::vector<u8>(size)));
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletCreator::CreateTransferMemoryStorage(
|
||||
Out<SharedPointer<IStorage>> out_storage, bool is_writable, s64 size,
|
||||
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle) {
|
||||
LOG_DEBUG(Service_AM, "called, is_writable={} size={}", is_writable, size);
|
||||
|
||||
if (size <= 0) {
|
||||
LOG_ERROR(Service_AM, "size is less than or equal to 0");
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
if (!transfer_memory_handle) {
|
||||
LOG_ERROR(Service_AM, "transfer_memory_handle is null");
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
*out_storage = std::make_shared<IStorage>(
|
||||
system, AM::CreateTransferMemoryStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(),
|
||||
transfer_memory_handle.Get(), is_writable, size));
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletCreator::CreateHandleStorage(
|
||||
Out<SharedPointer<IStorage>> out_storage, s64 size,
|
||||
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle) {
|
||||
LOG_DEBUG(Service_AM, "called, size={}", size);
|
||||
|
||||
if (size <= 0) {
|
||||
LOG_ERROR(Service_AM, "size is less than or equal to 0");
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
if (!transfer_memory_handle) {
|
||||
LOG_ERROR(Service_AM, "transfer_memory_handle is null");
|
||||
R_THROW(ResultUnknown);
|
||||
}
|
||||
|
||||
*out_storage = std::make_shared<IStorage>(
|
||||
system, AM::CreateHandleStorage(system.Kernel(), transfer_memory_handle->GetOwner()->GetMemory(),
|
||||
transfer_memory_handle.Get(), size));
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,56 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/am/am_types.h"
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
struct Applet;
|
||||
class ILibraryAppletAccessor;
|
||||
class IStorage;
|
||||
class WindowSystem;
|
||||
|
||||
class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
|
||||
public:
|
||||
explicit ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
WindowSystem& window_system);
|
||||
~ILibraryAppletCreator() override;
|
||||
|
||||
private:
|
||||
Result CreateLibraryApplet(
|
||||
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||
LibraryAppletMode library_applet_mode);
|
||||
Result CreateLibraryAppletEx(
|
||||
Out<SharedPointer<ILibraryAppletAccessor>> out_library_applet_accessor, AppletId applet_id,
|
||||
LibraryAppletMode library_applet_mode, u64 thread_id);
|
||||
Result CreateStorage(Out<SharedPointer<IStorage>> out_storage, s64 size);
|
||||
Result CreateTransferMemoryStorage(
|
||||
Out<SharedPointer<IStorage>> out_storage, bool is_writable, s64 size,
|
||||
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle);
|
||||
Result CreateHandleStorage(Out<SharedPointer<IStorage>> out_storage, s64 size,
|
||||
InCopyHandle<Kernel::KTransferMemory> transfer_memory_handle);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"},
|
||||
FunctionInfo{1, nullptr, "TerminateAllLibraryApplets"},
|
||||
FunctionInfo{2, nullptr, "AreAnyLibraryAppletsLeft"},
|
||||
FunctionInfo{3, D<&ILibraryAppletCreator::CreateLibraryAppletEx>, "CreateLibraryAppletEx"},
|
||||
FunctionInfo{10, D<&ILibraryAppletCreator::CreateStorage>, "CreateStorage"},
|
||||
FunctionInfo{11, D<&ILibraryAppletCreator::CreateTransferMemoryStorage>, "CreateTransferMemoryStorage"},
|
||||
FunctionInfo{12, D<&ILibraryAppletCreator::CreateHandleStorage>, "CreateHandleStorage"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,116 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/am/service/applet_common_functions.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"
|
||||
#include "core/hle/service/am/service/display_controller.h"
|
||||
#include "core/hle/service/am/service/global_state_controller.h"
|
||||
#include "core/hle/service/am/service/home_menu_functions.h"
|
||||
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||
#include "core/hle/service/am/service/library_applet_proxy.h"
|
||||
#include "core/hle/service/am/service/library_applet_self_accessor.h"
|
||||
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||
#include "core/hle/service/am/service/self_controller.h"
|
||||
#include "core/hle/service/am/service/window_controller.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ILibraryAppletProxy::ILibraryAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "ILibraryAppletProxy"},
|
||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
ILibraryAppletProxy::~ILibraryAppletProxy() = default;
|
||||
|
||||
Result ILibraryAppletProxy::GetAudioController(
|
||||
Out<SharedPointer<IAudioController>> out_audio_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetDisplayController(
|
||||
Out<SharedPointer<IDisplayController>> out_display_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetDebugFunctions(
|
||||
Out<SharedPointer<IDebugFunctions>> out_debug_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetWindowController(
|
||||
Out<SharedPointer<IWindowController>> out_window_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetSelfController(
|
||||
Out<SharedPointer<ISelfController>> out_self_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetCommonStateGetter(
|
||||
Out<SharedPointer<ICommonStateGetter>> out_common_state_getter) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_library_applet_creator =
|
||||
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::OpenLibraryAppletSelfAccessor(
|
||||
Out<SharedPointer<ILibraryAppletSelfAccessor>> out_library_applet_self_accessor) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_library_applet_self_accessor =
|
||||
std::make_shared<ILibraryAppletSelfAccessor>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetAppletCommonFunctions(
|
||||
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_applet_common_functions = std::make_shared<IAppletCommonFunctions>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetHomeMenuFunctions(
|
||||
Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_home_menu_functions =
|
||||
std::make_shared<IHomeMenuFunctions>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletProxy::GetGlobalStateController(
|
||||
Out<SharedPointer<IGlobalStateController>> out_global_state_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_global_state_controller = std::make_shared<IGlobalStateController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,73 +0,0 @@
|
||||
// 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 {
|
||||
|
||||
struct Applet;
|
||||
class IAppletCommonFunctions;
|
||||
class IAudioController;
|
||||
class ICommonStateGetter;
|
||||
class IDebugFunctions;
|
||||
class IDisplayController;
|
||||
class IHomeMenuFunctions;
|
||||
class IGlobalStateController;
|
||||
class ILibraryAppletCreator;
|
||||
class ILibraryAppletSelfAccessor;
|
||||
class IProcessWindingController;
|
||||
class ISelfController;
|
||||
class IWindowController;
|
||||
class WindowSystem;
|
||||
|
||||
class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
|
||||
public:
|
||||
explicit ILibraryAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system);
|
||||
~ILibraryAppletProxy();
|
||||
|
||||
private:
|
||||
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||
Result GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||
Result GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||
Result OpenLibraryAppletSelfAccessor(
|
||||
Out<SharedPointer<ILibraryAppletSelfAccessor>> out_library_applet_self_accessor);
|
||||
Result GetAppletCommonFunctions(
|
||||
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions);
|
||||
Result GetHomeMenuFunctions(Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions);
|
||||
Result GetGlobalStateController(
|
||||
Out<SharedPointer<IGlobalStateController>> out_global_state_controller);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||
FunctionInfo{1, D<&ILibraryAppletProxy::GetSelfController>, "GetSelfController"},
|
||||
FunctionInfo{2, D<&ILibraryAppletProxy::GetWindowController>, "GetWindowController"},
|
||||
FunctionInfo{3, D<&ILibraryAppletProxy::GetAudioController>, "GetAudioController"},
|
||||
FunctionInfo{4, D<&ILibraryAppletProxy::GetDisplayController>, "GetDisplayController"},
|
||||
FunctionInfo{10, D<&ILibraryAppletProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||
FunctionInfo{11, D<&ILibraryAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||
FunctionInfo{20, D<&ILibraryAppletProxy::OpenLibraryAppletSelfAccessor>, "OpenLibraryAppletSelfAccessor"},
|
||||
FunctionInfo{21, D<&ILibraryAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"},
|
||||
FunctionInfo{22, D<&ILibraryAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"},
|
||||
FunctionInfo{23, D<&ILibraryAppletProxy::GetGlobalStateController>, "GetGlobalStateController"},
|
||||
FunctionInfo{1000, D<&ILibraryAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
Kernel::KProcess* const m_process;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,291 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/core_timing.h"
|
||||
#include "core/file_sys/control_metadata.h"
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/hle/service/acc/profile_manager.h"
|
||||
#include "core/hle/service/am/applet_data_broker.h"
|
||||
#include "core/hle/service/am/applet_manager.h"
|
||||
#include "core/hle/service/am/frontend/applets.h"
|
||||
#include "core/hle/service/am/service/library_applet_self_accessor.h"
|
||||
#include "core/hle/service/am/service/storage.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/glue/glue_manager.h"
|
||||
#include "core/hle/service/ns/application_manager_interface.h"
|
||||
#include "core/hle/service/ns/service_getter_interface.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
namespace {
|
||||
|
||||
AppletIdentityInfo GetCallerIdentity(Applet& applet) {
|
||||
if (const auto caller_applet = applet.caller_applet.lock(); caller_applet) {
|
||||
// TODO: is this actually the application ID?
|
||||
return {
|
||||
.applet_id = caller_applet->applet_id,
|
||||
.application_id = caller_applet->program_id,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
.applet_id = AppletId::QLaunch,
|
||||
.application_id = 0x0100000000001000ull,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_,
|
||||
std::shared_ptr<Applet> applet)
|
||||
: ServiceFramework{system_, "ILibraryAppletSelfAccessor"}, m_applet{std::move(applet)},
|
||||
m_broker{m_applet->caller_applet_broker} {
|
||||
}
|
||||
|
||||
ILibraryAppletSelfAccessor::~ILibraryAppletSelfAccessor() = default;
|
||||
|
||||
Result ILibraryAppletSelfAccessor::PopInData(Out<SharedPointer<IStorage>> out_storage) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
R_RETURN(m_broker->GetInData().Pop(system.Kernel(), out_storage));
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer<IStorage> storage) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
m_broker->GetOutData().Push(system.Kernel(), storage);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::PopInteractiveInData(Out<SharedPointer<IStorage>> out_storage) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
R_RETURN(m_broker->GetInteractiveInData().Pop(system.Kernel(), out_storage));
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::PushInteractiveOutData(SharedPointer<IStorage> storage) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
m_broker->GetInteractiveOutData().Push(system.Kernel(), storage);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetPopInDataEvent(
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_event = m_broker->GetInData().GetEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent(
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_event = m_broker->GetInteractiveInData().GetEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetLibraryAppletInfo(
|
||||
Out<LibraryAppletInfo> out_library_applet_info) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_library_applet_info = {
|
||||
.applet_id = m_applet->applet_id,
|
||||
.library_applet_mode = m_applet->library_applet_mode,
|
||||
};
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo(
|
||||
Out<AppletIdentityInfo> out_identity_info) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
*out_identity_info = {
|
||||
.applet_id = AppletId::QLaunch,
|
||||
.application_id = 0x0100000000001000ull,
|
||||
};
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::CanUseApplicationCore(Out<bool> out_can_use_application_core) {
|
||||
// TODO: This appears to read the NPDM from state and check the core mask of the applet.
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
*out_can_use_application_core = false;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty(
|
||||
OutLargeData<std::array<u8, 0x4000>, BufferAttr_HipcMapAlias> out_nacp) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
// TODO: this should be the main applet, not the caller applet
|
||||
const auto application = GetCallerIdentity(*m_applet);
|
||||
std::vector<u8> nacp;
|
||||
const auto result =
|
||||
system.GetARPManager().GetControlProperty(&nacp, application.application_id);
|
||||
|
||||
if (R_SUCCEEDED(result)) {
|
||||
std::memcpy(out_nacp->data(), nacp.data(), (std::min)(nacp.size(), out_nacp->size()));
|
||||
}
|
||||
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out<FileSys::StorageId> out_storage_id) {
|
||||
LOG_INFO(Service_AM, "(STUBBED) called");
|
||||
*out_storage_id = FileSys::StorageId::NandUser;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
|
||||
if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) {
|
||||
m_applet->process->Terminate();
|
||||
} else {
|
||||
system.GetUserChannel() = m_applet->user_channel_launch_parameter;
|
||||
system.ExecuteProgram(0);
|
||||
}
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo(
|
||||
Out<AppletIdentityInfo> out_identity_info) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_identity_info = GetCallerIdentity(*m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack(
|
||||
Out<s32> out_count, OutArray<AppletIdentityInfo, BufferAttr_HipcMapAlias> out_identity_info) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
|
||||
std::shared_ptr<Applet> applet = m_applet;
|
||||
*out_count = 0;
|
||||
|
||||
do {
|
||||
if (*out_count >= static_cast<s32>(out_identity_info.size())) {
|
||||
break;
|
||||
}
|
||||
out_identity_info[(*out_count)++] = GetCallerIdentity(*applet);
|
||||
} while ((applet = applet->caller_applet.lock()));
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(Out<u32> out_desirable_layout) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
*out_desirable_layout = 0;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::ReportVisibleError(ErrorCode error_code) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category,
|
||||
error_code.number);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext(
|
||||
ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called, error {}-{}", error_code.category,
|
||||
error_code.number);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::UnpopInData(SharedPointer<IStorage> storage) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
m_broker->GetInData().Unpop(system.Kernel(), storage);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage(
|
||||
Out<u64> out_desired_language) {
|
||||
// FIXME: this is copied from IApplicationFunctions::GetDesiredLanguage
|
||||
// FIXME: all of this stuff belongs to ns
|
||||
auto identity = GetCallerIdentity(*m_applet);
|
||||
|
||||
// TODO(bunnei): This should be configurable
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
// Get supported languages from NACP, if possible
|
||||
// Default to 0 (all languages supported)
|
||||
u32 supported_languages = 0;
|
||||
|
||||
const auto res = FileSys::PatchManager::GetMetadataFromBaseOrUpdate(system, identity.application_id);
|
||||
|
||||
if (res.first != nullptr) {
|
||||
supported_languages = res.first->GetSupportedLanguages();
|
||||
}
|
||||
|
||||
// Call IApplicationManagerInterface implementation.
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto ns_am2 = service_manager.GetService<NS::IServiceGetterInterface>("ns:am2");
|
||||
|
||||
std::shared_ptr<NS::IApplicationManagerInterface> app_man;
|
||||
R_TRY(ns_am2->GetApplicationManagerInterface(&app_man));
|
||||
|
||||
// Get desired application language
|
||||
NS::ApplicationLanguage desired_language{};
|
||||
R_TRY(app_man->GetApplicationDesiredLanguage(&desired_language, supported_languages));
|
||||
|
||||
// Convert to settings language code.
|
||||
u64 language_code{};
|
||||
R_TRY(app_man->ConvertApplicationLanguageToLanguageCode(&language_code, desired_language));
|
||||
|
||||
LOG_DEBUG(Service_AM, "got desired_language={:016X}", language_code);
|
||||
|
||||
*out_desired_language = language_code;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out<u64> out_application_id) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
// TODO: this should be the main applet, not the caller applet
|
||||
const auto main_applet = GetCallerIdentity(*m_applet);
|
||||
*out_application_id = main_applet.application_id;
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(
|
||||
Out<bool> out_can_select_any_user, Out<s32> out_users_count,
|
||||
OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) {
|
||||
const Service::Account::ProfileManager manager{};
|
||||
|
||||
*out_can_select_any_user = false;
|
||||
*out_users_count = -1;
|
||||
|
||||
LOG_INFO(Service_AM, "called");
|
||||
|
||||
if (manager.GetUserCount() > 0) {
|
||||
*out_can_select_any_user = true;
|
||||
*out_users_count = static_cast<s32>(manager.GetUserCount());
|
||||
|
||||
const auto users = manager.GetAllUsers();
|
||||
for (size_t i = 0; i < users.size() && i < out_users.size(); i++) {
|
||||
out_users[i] = users[i];
|
||||
}
|
||||
}
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually(
|
||||
Out<bool> out_should_set_gpu_time_slice_manually) {
|
||||
LOG_INFO(Service_AM, "(STUBBED) called");
|
||||
*out_should_set_gpu_time_slice_manually = false;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx(
|
||||
Out<LibraryAppletInfo> out_library_applet_info) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_library_applet_info = {
|
||||
.applet_id = m_applet->applet_id,
|
||||
.library_applet_mode = m_applet->library_applet_mode,
|
||||
};
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,128 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/service/am/am_types.h"
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace FileSys {
|
||||
enum class StorageId : u8;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class KReadableEvent;
|
||||
}
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class AppletDataBroker;
|
||||
struct Applet;
|
||||
class IStorage;
|
||||
|
||||
struct LibraryAppletInfo {
|
||||
AppletId applet_id;
|
||||
LibraryAppletMode library_applet_mode;
|
||||
};
|
||||
static_assert(sizeof(LibraryAppletInfo) == 0x8, "LibraryAppletInfo has incorrect size.");
|
||||
|
||||
struct ErrorCode {
|
||||
u32 category;
|
||||
u32 number;
|
||||
};
|
||||
static_assert(sizeof(ErrorCode) == 0x8, "ErrorCode has incorrect size.");
|
||||
|
||||
struct ErrorContext {
|
||||
u8 type;
|
||||
INSERT_PADDING_BYTES_NOINIT(0x7);
|
||||
std::array<u8, 0x1f4> data;
|
||||
Result result;
|
||||
};
|
||||
static_assert(sizeof(ErrorContext) == 0x200, "ErrorContext has incorrect size.");
|
||||
|
||||
class ILibraryAppletSelfAccessor final : public ServiceFramework<ILibraryAppletSelfAccessor> {
|
||||
public:
|
||||
explicit ILibraryAppletSelfAccessor(Core::System& system_, std::shared_ptr<Applet> applet);
|
||||
~ILibraryAppletSelfAccessor() override;
|
||||
|
||||
private:
|
||||
Result PopInData(Out<SharedPointer<IStorage>> out_storage);
|
||||
Result PushOutData(SharedPointer<IStorage> storage);
|
||||
Result PopInteractiveInData(Out<SharedPointer<IStorage>> out_storage);
|
||||
Result PushInteractiveOutData(SharedPointer<IStorage> storage);
|
||||
Result GetPopInDataEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result GetPopInteractiveInDataEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result GetLibraryAppletInfo(Out<LibraryAppletInfo> out_library_applet_info);
|
||||
Result GetMainAppletIdentityInfo(Out<AppletIdentityInfo> out_identity_info);
|
||||
Result CanUseApplicationCore(Out<bool> out_can_use_application_core);
|
||||
Result GetMainAppletApplicationControlProperty(
|
||||
OutLargeData<std::array<u8, 0x4000>, BufferAttr_HipcMapAlias> out_nacp);
|
||||
Result GetMainAppletStorageId(Out<FileSys::StorageId> out_storage_id);
|
||||
Result ExitProcessAndReturn();
|
||||
Result GetCallerAppletIdentityInfo(Out<AppletIdentityInfo> out_identity_info);
|
||||
Result GetCallerAppletIdentityInfoStack(
|
||||
Out<s32> out_count,
|
||||
OutArray<AppletIdentityInfo, BufferAttr_HipcMapAlias> out_identity_info);
|
||||
Result GetDesirableKeyboardLayout(Out<u32> out_desirable_layout);
|
||||
Result ReportVisibleError(ErrorCode error_code);
|
||||
Result ReportVisibleErrorWithErrorContext(
|
||||
ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context);
|
||||
Result UnpopInData(SharedPointer<IStorage> storage);
|
||||
Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language);
|
||||
Result GetCurrentApplicationId(Out<u64> out_application_id);
|
||||
Result GetMainAppletAvailableUsers(Out<bool> out_can_select_any_user, Out<s32> out_users_count,
|
||||
OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users);
|
||||
Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually);
|
||||
Result GetLibraryAppletInfoEx(Out<LibraryAppletInfo> out_library_applet_info);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ILibraryAppletSelfAccessor::PopInData>, "PopInData"},
|
||||
FunctionInfo{1, D<&ILibraryAppletSelfAccessor::PushOutData>, "PushOutData"},
|
||||
FunctionInfo{2, D<&ILibraryAppletSelfAccessor::PopInteractiveInData>, "PopInteractiveInData"},
|
||||
FunctionInfo{3, D<&ILibraryAppletSelfAccessor::PushInteractiveOutData>, "PushInteractiveOutData"},
|
||||
FunctionInfo{5, D<&ILibraryAppletSelfAccessor::GetPopInDataEvent>, "GetPopInDataEvent"},
|
||||
FunctionInfo{6, D<&ILibraryAppletSelfAccessor::GetPopInteractiveInDataEvent>, "GetPopInteractiveInDataEvent"},
|
||||
FunctionInfo{10, D<&ILibraryAppletSelfAccessor::ExitProcessAndReturn>, "ExitProcessAndReturn"},
|
||||
FunctionInfo{11, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfo>, "GetLibraryAppletInfo"},
|
||||
FunctionInfo{12, D<&ILibraryAppletSelfAccessor::GetMainAppletIdentityInfo>, "GetMainAppletIdentityInfo"},
|
||||
FunctionInfo{13, D<&ILibraryAppletSelfAccessor::CanUseApplicationCore>, "CanUseApplicationCore"},
|
||||
FunctionInfo{14, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo>, "GetCallerAppletIdentityInfo"},
|
||||
FunctionInfo{15, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationControlProperty>, "GetMainAppletApplicationControlProperty"},
|
||||
FunctionInfo{16, D<&ILibraryAppletSelfAccessor::GetMainAppletStorageId>, "GetMainAppletStorageId"},
|
||||
FunctionInfo{17, D<&ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfoStack>, "GetCallerAppletIdentityInfoStack"},
|
||||
FunctionInfo{18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"},
|
||||
FunctionInfo{19, D<&ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout>, "GetDesirableKeyboardLayout"},
|
||||
FunctionInfo{20, nullptr, "PopExtraStorage"},
|
||||
FunctionInfo{25, nullptr, "GetPopExtraStorageEvent"},
|
||||
FunctionInfo{30, D<&ILibraryAppletSelfAccessor::UnpopInData>, "UnpopInData"},
|
||||
FunctionInfo{31, nullptr, "UnpopExtraStorage"},
|
||||
FunctionInfo{40, nullptr, "GetIndirectLayerProducerHandle"},
|
||||
FunctionInfo{50, D<&ILibraryAppletSelfAccessor::ReportVisibleError>, "ReportVisibleError"},
|
||||
FunctionInfo{51, D<&ILibraryAppletSelfAccessor::ReportVisibleErrorWithErrorContext>, "ReportVisibleErrorWithErrorContext"},
|
||||
FunctionInfo{60, D<&ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage>, "GetMainAppletApplicationDesiredLanguage"},
|
||||
FunctionInfo{70, D<&ILibraryAppletSelfAccessor::GetCurrentApplicationId>, "GetCurrentApplicationId"},
|
||||
FunctionInfo{80, nullptr, "RequestExitToSelf"},
|
||||
FunctionInfo{90, nullptr, "CreateApplicationAndPushAndRequestToLaunch"},
|
||||
FunctionInfo{100, nullptr, "CreateGameMovieTrimmer"},
|
||||
FunctionInfo{101, nullptr, "ReserveResourceForMovieOperation"},
|
||||
FunctionInfo{102, nullptr, "UnreserveResourceForMovieOperation"},
|
||||
FunctionInfo{110, D<&ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers>, "GetMainAppletAvailableUsers"},
|
||||
FunctionInfo{120, nullptr, "GetLaunchStorageInfoForDebug"},
|
||||
FunctionInfo{130, nullptr, "GetGpuErrorDetectedSystemEvent"},
|
||||
FunctionInfo{140, nullptr, "SetApplicationMemoryReservation"},
|
||||
FunctionInfo{150, D<&ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually>, "ShouldSetGpuTimeSliceManually"},
|
||||
FunctionInfo{160, D<&ILibraryAppletSelfAccessor::GetLibraryAppletInfoEx>, "GetLibraryAppletInfoEx"}
|
||||
);
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
const std::shared_ptr<AppletDataBroker> m_broker;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,67 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/am/service/lock_accessor.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ILockAccessor::ILockAccessor(Core::System& system_)
|
||||
: ServiceFramework{system_, "ILockAccessor"}, m_context{system_, "ILockAccessor"},
|
||||
m_event{m_context} {
|
||||
m_event.Signal(system.Kernel());
|
||||
}
|
||||
|
||||
ILockAccessor::~ILockAccessor() = default;
|
||||
|
||||
Result ILockAccessor::TryLock(Out<bool> out_is_locked,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_handle,
|
||||
bool return_handle) {
|
||||
LOG_INFO(Service_AM, "called, return_handle={}", return_handle);
|
||||
|
||||
{
|
||||
std::scoped_lock lk{m_mutex};
|
||||
if (m_is_locked) {
|
||||
*out_is_locked = false;
|
||||
} else {
|
||||
m_is_locked = true;
|
||||
*out_is_locked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (return_handle) {
|
||||
*out_handle = m_event.GetHandle();
|
||||
}
|
||||
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILockAccessor::Unlock() {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
|
||||
{
|
||||
std::scoped_lock lk{m_mutex};
|
||||
m_is_locked = false;
|
||||
}
|
||||
|
||||
m_event.Signal(system.Kernel());
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILockAccessor::GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_handle) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
*out_handle = m_event.GetHandle();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ILockAccessor::IsLocked(Out<bool> out_is_locked) {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
std::scoped_lock lk{m_mutex};
|
||||
*out_is_locked = m_is_locked;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,41 +0,0 @@
|
||||
// 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/kernel_helpers.h"
|
||||
#include "core/hle/service/os/event.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class ILockAccessor final : public ServiceFramework<ILockAccessor> {
|
||||
public:
|
||||
explicit ILockAccessor(Core::System& system_);
|
||||
~ILockAccessor() override;
|
||||
|
||||
private:
|
||||
Result TryLock(Out<bool> out_is_locked, OutCopyHandle<Kernel::KReadableEvent> out_handle,
|
||||
bool return_handle);
|
||||
Result Unlock();
|
||||
Result GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_handle);
|
||||
Result IsLocked(Out<bool> out_is_locked);
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{1, D<&ILockAccessor::TryLock>, "TryLock"},
|
||||
FunctionInfo{2, D<&ILockAccessor::Unlock>, "Unlock"},
|
||||
FunctionInfo{3, D<&ILockAccessor::GetEvent>, "GetEvent"},
|
||||
FunctionInfo{4, D<&ILockAccessor::IsLocked>, "IsLocked"}
|
||||
);
|
||||
KernelHelpers::ServiceContext m_context;
|
||||
Event m_event;
|
||||
std::mutex m_mutex{};
|
||||
bool m_is_locked{};
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,103 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "core/hle/service/am/service/common_state_getter.h"
|
||||
#include "core/hle/service/am/service/display_controller.h"
|
||||
#include "core/hle/service/am/service/global_state_controller.h"
|
||||
#include "core/hle/service/am/service/audio_controller.h"
|
||||
#include "core/hle/service/am/service/applet_common_functions.h"
|
||||
#include "core/hle/service/am/service/overlay_applet_proxy.h"
|
||||
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||
#include "core/hle/service/am/service/self_controller.h"
|
||||
#include "core/hle/service/am/service/window_controller.h"
|
||||
#include "core/hle/service/am/service/debug_functions.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
IOverlayAppletProxy::IOverlayAppletProxy(Core::System &system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess *process, WindowSystem &window_system)
|
||||
: ServiceFramework{system_, "IOverlayAppletProxy"},
|
||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
IOverlayAppletProxy::~IOverlayAppletProxy() = default;
|
||||
|
||||
Result IOverlayAppletProxy::GetCommonStateGetter(
|
||||
Out<SharedPointer<ICommonStateGetter> > out_common_state_getter) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetSelfController(
|
||||
Out<SharedPointer<ISelfController> > out_self_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetWindowController(
|
||||
Out<SharedPointer<IWindowController> > out_window_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetAudioController(
|
||||
Out<SharedPointer<IAudioController> > out_audio_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetDisplayController(
|
||||
Out<SharedPointer<IDisplayController> > out_display_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController> > out_process_winding_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator> > out_library_applet_creator) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_library_applet_creator =
|
||||
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetOverlayFunctions(
|
||||
Out<SharedPointer<IOverlayFunctions> > out_overlay_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_overlay_functions = std::make_shared<IOverlayFunctions>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetAppletCommonFunctions(
|
||||
Out<SharedPointer<IAppletCommonFunctions> > out_applet_common_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_applet_common_functions = std::make_shared<IAppletCommonFunctions>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetGlobalStateController(
|
||||
Out<SharedPointer<IGlobalStateController> > out_global_state_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_global_state_controller = std::make_shared<IGlobalStateController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IOverlayAppletProxy::GetDebugFunctions(
|
||||
Out<SharedPointer<IDebugFunctions> > out_debug_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
} // namespace Service::AM
|
||||
@@ -1,71 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/am/service/overlay_functions.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
struct Applet;
|
||||
class IAppletCommonFunctions;
|
||||
class IAudioController;
|
||||
class ICommonStateGetter;
|
||||
class IDebugFunctions;
|
||||
class IDisplayController;
|
||||
class IHomeMenuFunctions;
|
||||
class IGlobalStateController;
|
||||
class ILibraryAppletCreator;
|
||||
class ILibraryAppletSelfAccessor;
|
||||
class IProcessWindingController;
|
||||
class ISelfController;
|
||||
class IWindowController;
|
||||
class WindowSystem;
|
||||
|
||||
class IOverlayAppletProxy final : public ServiceFramework<IOverlayAppletProxy> {
|
||||
public:
|
||||
explicit IOverlayAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system);
|
||||
~IOverlayAppletProxy();
|
||||
|
||||
private:
|
||||
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||
Result GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||
Result GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||
Result GetOverlayFunctions(Out<SharedPointer<IOverlayFunctions>> out_overlay_functions);
|
||||
Result GetAppletCommonFunctions(
|
||||
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions);
|
||||
Result GetGlobalStateController(
|
||||
Out<SharedPointer<IGlobalStateController>> out_global_state_controller);
|
||||
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IOverlayAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||
FunctionInfo{1, D<&IOverlayAppletProxy::GetSelfController>, "GetSelfController"},
|
||||
FunctionInfo{2, D<&IOverlayAppletProxy::GetWindowController>, "GetWindowController"},
|
||||
FunctionInfo{3, D<&IOverlayAppletProxy::GetAudioController>, "GetAudioController"},
|
||||
FunctionInfo{4, D<&IOverlayAppletProxy::GetDisplayController>, "GetDisplayController"},
|
||||
FunctionInfo{10, D<&IOverlayAppletProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||
FunctionInfo{11, D<&IOverlayAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||
FunctionInfo{20, D<&IOverlayAppletProxy::GetOverlayFunctions>, "GetOverlayFunctions"},
|
||||
FunctionInfo{21, D<&IOverlayAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"},
|
||||
FunctionInfo{23, D<&IOverlayAppletProxy::GetGlobalStateController>, "GetGlobalStateController"},
|
||||
FunctionInfo{1000, D<&IOverlayAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
Kernel::KProcess* const m_process;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -8,6 +8,32 @@
|
||||
#include "core/hle/service/am/window_system.h"
|
||||
|
||||
namespace Service::AM {
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IOverlayFunctions::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"},
|
||||
FunctionInfo{1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"},
|
||||
FunctionInfo{2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"},
|
||||
FunctionInfo{3, nullptr, "SetGpuTimeSliceBoost"},
|
||||
FunctionInfo{4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"},
|
||||
FunctionInfo{5, nullptr, "TerminateApplicationAndSetReason"},
|
||||
FunctionInfo{6, nullptr, "SetScreenShotPermissionGlobally"},
|
||||
FunctionInfo{10, nullptr, "StartShutdownSequenceForOverlay"},
|
||||
FunctionInfo{11, nullptr, "StartRebootSequenceForOverlay"},
|
||||
FunctionInfo{20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
||||
FunctionInfo{21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"},
|
||||
FunctionInfo{30, nullptr, "SetHealthWarningShowingState"},
|
||||
FunctionInfo{31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"},
|
||||
FunctionInfo{40, nullptr, "GetApplicationNintendoLogo"},
|
||||
FunctionInfo{41, nullptr, "GetApplicationStartupMovie"},
|
||||
FunctionInfo{50, nullptr, "SetGpuTimeSliceBoostForApplication"},
|
||||
FunctionInfo{60, nullptr, "Unknown60"},
|
||||
FunctionInfo{70, D<&IOverlayFunctions::Unknown70>, "Unknown70"},
|
||||
FunctionInfo{90, nullptr, "SetRequiresGpuResourceUse"},
|
||||
FunctionInfo{101, nullptr, "BeginToObserveHidInputForDevelop"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IOverlayFunctions::IOverlayFunctions(Core::System &system_, std::shared_ptr<Applet> applet)
|
||||
: ServiceFramework{system_, "IOverlayFunctions"}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
@@ -24,31 +24,7 @@ private:
|
||||
Result Unknown70();
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IOverlayFunctions::BeginToWatchShortHomeButtonMessage>, "BeginToWatchShortHomeButtonMessage"},
|
||||
FunctionInfo{1, D<&IOverlayFunctions::EndToWatchShortHomeButtonMessage>, "EndToWatchShortHomeButtonMessage"},
|
||||
FunctionInfo{2, D<&IOverlayFunctions::GetApplicationIdForLogo>, "GetApplicationIdForLogo"},
|
||||
FunctionInfo{3, nullptr, "SetGpuTimeSliceBoost"},
|
||||
FunctionInfo{4, D<&IOverlayFunctions::SetAutoSleepTimeAndDimmingTimeEnabled>, "SetAutoSleepTimeAndDimmingTimeEnabled"},
|
||||
FunctionInfo{5, nullptr, "TerminateApplicationAndSetReason"},
|
||||
FunctionInfo{6, nullptr, "SetScreenShotPermissionGlobally"},
|
||||
FunctionInfo{10, nullptr, "StartShutdownSequenceForOverlay"},
|
||||
FunctionInfo{11, nullptr, "StartRebootSequenceForOverlay"},
|
||||
FunctionInfo{20, D<&IOverlayFunctions::SetHandlingHomeButtonShortPressedEnabled>, "SetHandlingHomeButtonShortPressedEnabled"},
|
||||
FunctionInfo{21, D<&IOverlayFunctions::SetHandlingTouchScreenInputEnabled>, "SetHandlingTouchScreenInputEnabled"},
|
||||
FunctionInfo{30, nullptr, "SetHealthWarningShowingState"},
|
||||
FunctionInfo{31, D<&IOverlayFunctions::IsHealthWarningRequired>, "IsHealthWarningRequired"},
|
||||
FunctionInfo{40, nullptr, "GetApplicationNintendoLogo"},
|
||||
FunctionInfo{41, nullptr, "GetApplicationStartupMovie"},
|
||||
FunctionInfo{50, nullptr, "SetGpuTimeSliceBoostForApplication"},
|
||||
FunctionInfo{60, nullptr, "Unknown60"},
|
||||
FunctionInfo{70, D<&IOverlayFunctions::Unknown70>, "Unknown70"},
|
||||
FunctionInfo{90, nullptr, "SetRequiresGpuResourceUse"},
|
||||
FunctionInfo{101, nullptr, "BeginToObserveHidInputForDevelop"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
} // namespace Service::AM
|
||||
|
||||
@@ -13,6 +13,20 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IProcessWindingController::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"},
|
||||
FunctionInfo{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"},
|
||||
FunctionInfo{21, D<&IProcessWindingController::PushContext>, "PushContext"},
|
||||
FunctionInfo{22, D<&IProcessWindingController::PopContext>, "PopContext"},
|
||||
FunctionInfo{23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"},
|
||||
FunctionInfo{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"},
|
||||
FunctionInfo{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"},
|
||||
FunctionInfo{41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IProcessWindingController::IProcessWindingController(Core::System& system_,
|
||||
std::shared_ptr<Applet> applet)
|
||||
: ServiceFramework{system_, "IProcessWindingController"}, m_applet{std::move(applet)} {
|
||||
|
||||
@@ -33,19 +33,7 @@ private:
|
||||
SharedPointer<ILibraryAppletAccessor> reserved_applet_accessor);
|
||||
Result ReserveToStartAndWait(SharedPointer<ILibraryAppletAccessor> reserved_applet_accessor);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IProcessWindingController::GetLaunchReason>, "GetLaunchReason"},
|
||||
FunctionInfo{11, D<&IProcessWindingController::OpenCallingLibraryApplet>, "OpenCallingLibraryApplet"},
|
||||
FunctionInfo{21, D<&IProcessWindingController::PushContext>, "PushContext"},
|
||||
FunctionInfo{22, D<&IProcessWindingController::PopContext>, "PopContext"},
|
||||
FunctionInfo{23, D<&IProcessWindingController::CancelWindingReservation>, "CancelWindingReservation"},
|
||||
FunctionInfo{30, D<&IProcessWindingController::WindAndDoReserved>, "WindAndDoReserved"},
|
||||
FunctionInfo{40, D<&IProcessWindingController::ReserveToStartAndWaitAndUnwindThis>, "ReserveToStartAndWaitAndUnwindThis"},
|
||||
FunctionInfo{41, D<&IProcessWindingController::ReserveToStartAndWait>, "ReserveToStartAndWait"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,62 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* ISelfController::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ISelfController::Exit>, "Exit"},
|
||||
FunctionInfo{1, D<&ISelfController::LockExit>, "LockExit"},
|
||||
FunctionInfo{2, D<&ISelfController::UnlockExit>, "UnlockExit"},
|
||||
FunctionInfo{3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"},
|
||||
FunctionInfo{4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"},
|
||||
FunctionInfo{9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"},
|
||||
FunctionInfo{10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"},
|
||||
FunctionInfo{11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"},
|
||||
FunctionInfo{12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"},
|
||||
FunctionInfo{13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"},
|
||||
FunctionInfo{14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"},
|
||||
FunctionInfo{15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"},
|
||||
FunctionInfo{16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"},
|
||||
FunctionInfo{17, nullptr, "SetControllerFirmwareUpdateSection"},
|
||||
FunctionInfo{18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"},
|
||||
FunctionInfo{19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"},
|
||||
FunctionInfo{20, nullptr, "SetDesirableKeyboardLayout"},
|
||||
FunctionInfo{21, nullptr, "GetScreenShotProgramId"},
|
||||
FunctionInfo{40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"},
|
||||
FunctionInfo{41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"},
|
||||
FunctionInfo{42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"},
|
||||
FunctionInfo{43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"},
|
||||
FunctionInfo{44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"},
|
||||
FunctionInfo{45, nullptr, "SetManagedDisplayLayerSeparationMode"},
|
||||
FunctionInfo{46, nullptr, "SetRecordingLayerCompositionEnabled"},
|
||||
FunctionInfo{50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"},
|
||||
FunctionInfo{51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"},
|
||||
FunctionInfo{60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"},
|
||||
FunctionInfo{61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"},
|
||||
FunctionInfo{62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"},
|
||||
FunctionInfo{63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"},
|
||||
FunctionInfo{64, nullptr, "SetInputDetectionSourceSet"},
|
||||
FunctionInfo{65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"},
|
||||
FunctionInfo{66, nullptr, "GetCurrentIlluminance"},
|
||||
FunctionInfo{67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"},
|
||||
FunctionInfo{68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"},
|
||||
FunctionInfo{69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"},
|
||||
FunctionInfo{70, nullptr, "ReportMultimediaError"},
|
||||
FunctionInfo{71, nullptr, "GetCurrentIlluminanceEx"},
|
||||
FunctionInfo{72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"},
|
||||
FunctionInfo{80, nullptr, "SetWirelessPriorityMode"},
|
||||
FunctionInfo{90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"},
|
||||
FunctionInfo{91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"},
|
||||
FunctionInfo{100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"},
|
||||
FunctionInfo{110, nullptr, "SetApplicationAlbumUserData"},
|
||||
FunctionInfo{120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"},
|
||||
FunctionInfo{130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"},
|
||||
FunctionInfo{230, D<&ISelfController::Unknown230>, "Unknown230"},
|
||||
FunctionInfo{240, D<&ISelfController::Unknown240>, "Unknown240"},
|
||||
FunctionInfo{1000, nullptr, "GetDebugStorageChannel"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
ISelfController::ISelfController(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process)
|
||||
: ServiceFramework{system_, "ISelfController"}, m_process{process}, m_applet{
|
||||
|
||||
@@ -70,61 +70,7 @@ private:
|
||||
Result Unknown230(u32 in_val, Out<u16> out_val);
|
||||
Result Unknown240(u32 in_val);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ISelfController::Exit>, "Exit"},
|
||||
FunctionInfo{1, D<&ISelfController::LockExit>, "LockExit"},
|
||||
FunctionInfo{2, D<&ISelfController::UnlockExit>, "UnlockExit"},
|
||||
FunctionInfo{3, D<&ISelfController::EnterFatalSection>, "EnterFatalSection"},
|
||||
FunctionInfo{4, D<&ISelfController::LeaveFatalSection>, "LeaveFatalSection"},
|
||||
FunctionInfo{9, D<&ISelfController::GetLibraryAppletLaunchableEvent>, "GetLibraryAppletLaunchableEvent"},
|
||||
FunctionInfo{10, D<&ISelfController::SetScreenShotPermission>, "SetScreenShotPermission"},
|
||||
FunctionInfo{11, D<&ISelfController::SetOperationModeChangedNotification>, "SetOperationModeChangedNotification"},
|
||||
FunctionInfo{12, D<&ISelfController::SetPerformanceModeChangedNotification>, "SetPerformanceModeChangedNotification"},
|
||||
FunctionInfo{13, D<&ISelfController::SetFocusHandlingMode>, "SetFocusHandlingMode"},
|
||||
FunctionInfo{14, D<&ISelfController::SetRestartMessageEnabled>, "SetRestartMessageEnabled"},
|
||||
FunctionInfo{15, D<&ISelfController::SetScreenShotAppletIdentityInfo>, "SetScreenShotAppletIdentityInfo"},
|
||||
FunctionInfo{16, D<&ISelfController::SetOutOfFocusSuspendingEnabled>, "SetOutOfFocusSuspendingEnabled"},
|
||||
FunctionInfo{17, nullptr, "SetControllerFirmwareUpdateSection"},
|
||||
FunctionInfo{18, nullptr, "SetRequiresCaptureButtonShortPressedMessage"},
|
||||
FunctionInfo{19, D<&ISelfController::SetAlbumImageOrientation>, "SetAlbumImageOrientation"},
|
||||
FunctionInfo{20, nullptr, "SetDesirableKeyboardLayout"},
|
||||
FunctionInfo{21, nullptr, "GetScreenShotProgramId"},
|
||||
FunctionInfo{40, D<&ISelfController::CreateManagedDisplayLayer>, "CreateManagedDisplayLayer"},
|
||||
FunctionInfo{41, D<&ISelfController::IsSystemBufferSharingEnabled>, "IsSystemBufferSharingEnabled"},
|
||||
FunctionInfo{42, D<&ISelfController::GetSystemSharedLayerHandle>, "GetSystemSharedLayerHandle"},
|
||||
FunctionInfo{43, D<&ISelfController::GetSystemSharedBufferHandle>, "GetSystemSharedBufferHandle"},
|
||||
FunctionInfo{44, D<&ISelfController::CreateManagedDisplaySeparableLayer>, "CreateManagedDisplaySeparableLayer"},
|
||||
FunctionInfo{45, nullptr, "SetManagedDisplayLayerSeparationMode"},
|
||||
FunctionInfo{46, nullptr, "SetRecordingLayerCompositionEnabled"},
|
||||
FunctionInfo{50, D<&ISelfController::SetHandlesRequestToDisplay>, "SetHandlesRequestToDisplay"},
|
||||
FunctionInfo{51, D<&ISelfController::ApproveToDisplay>, "ApproveToDisplay"},
|
||||
FunctionInfo{60, D<&ISelfController::OverrideAutoSleepTimeAndDimmingTime>, "OverrideAutoSleepTimeAndDimmingTime"},
|
||||
FunctionInfo{61, D<&ISelfController::SetMediaPlaybackState>, "SetMediaPlaybackState"},
|
||||
FunctionInfo{62, D<&ISelfController::SetIdleTimeDetectionExtension>, "SetIdleTimeDetectionExtension"},
|
||||
FunctionInfo{63, D<&ISelfController::GetIdleTimeDetectionExtension>, "GetIdleTimeDetectionExtension"},
|
||||
FunctionInfo{64, nullptr, "SetInputDetectionSourceSet"},
|
||||
FunctionInfo{65, D<&ISelfController::ReportUserIsActive>, "ReportUserIsActive"},
|
||||
FunctionInfo{66, nullptr, "GetCurrentIlluminance"},
|
||||
FunctionInfo{67, D<&ISelfController::IsIlluminanceAvailable>, "IsIlluminanceAvailable"},
|
||||
FunctionInfo{68, D<&ISelfController::SetAutoSleepDisabled>, "SetAutoSleepDisabled"},
|
||||
FunctionInfo{69, D<&ISelfController::IsAutoSleepDisabled>, "IsAutoSleepDisabled"},
|
||||
FunctionInfo{70, nullptr, "ReportMultimediaError"},
|
||||
FunctionInfo{71, nullptr, "GetCurrentIlluminanceEx"},
|
||||
FunctionInfo{72, D<&ISelfController::SetInputDetectionPolicy>, "SetInputDetectionPolicy"},
|
||||
FunctionInfo{80, nullptr, "SetWirelessPriorityMode"},
|
||||
FunctionInfo{90, D<&ISelfController::GetAccumulatedSuspendedTickValue>, "GetAccumulatedSuspendedTickValue"},
|
||||
FunctionInfo{91, D<&ISelfController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"},
|
||||
FunctionInfo{100, D<&ISelfController::SetAlbumImageTakenNotificationEnabled>, "SetAlbumImageTakenNotificationEnabled"},
|
||||
FunctionInfo{110, nullptr, "SetApplicationAlbumUserData"},
|
||||
FunctionInfo{120, D<&ISelfController::SaveCurrentScreenshot>, "SaveCurrentScreenshot"},
|
||||
FunctionInfo{130, D<&ISelfController::SetRecordVolumeMuted>, "SetRecordVolumeMuted"},
|
||||
FunctionInfo{230, D<&ISelfController::Unknown230>, "Unknown230"},
|
||||
FunctionInfo{240, D<&ISelfController::Unknown240>, "Unknown240"},
|
||||
FunctionInfo{1000, nullptr, "GetDebugStorageChannel"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
Kernel::KProcess* const m_process;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#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"
|
||||
#include "core/hle/service/am/service/display_controller.h"
|
||||
#include "core/hle/service/am/service/global_state_controller.h"
|
||||
#include "core/hle/service/am/service/home_menu_functions.h"
|
||||
#include "core/hle/service/am/service/library_applet_creator.h"
|
||||
#include "core/hle/service/am/service/process_winding_controller.h"
|
||||
#include "core/hle/service/am/service/self_controller.h"
|
||||
#include "core/hle/service/am/service/system_applet_proxy.h"
|
||||
#include "core/hle/service/am/service/window_controller.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ISystemAppletProxy::ISystemAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "ISystemAppletProxy"},
|
||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
||||
}
|
||||
|
||||
ISystemAppletProxy::~ISystemAppletProxy() = default;
|
||||
|
||||
Result ISystemAppletProxy::GetAudioController(
|
||||
Out<SharedPointer<IAudioController>> out_audio_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_audio_controller = std::make_shared<IAudioController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetDisplayController(
|
||||
Out<SharedPointer<IDisplayController>> out_display_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_display_controller = std::make_shared<IDisplayController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_process_winding_controller = std::make_shared<IProcessWindingController>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetDebugFunctions(
|
||||
Out<SharedPointer<IDebugFunctions>> out_debug_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_debug_functions = std::make_shared<IDebugFunctions>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetWindowController(
|
||||
Out<SharedPointer<IWindowController>> out_window_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_window_controller = std::make_shared<IWindowController>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetSelfController(
|
||||
Out<SharedPointer<ISelfController>> out_self_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_self_controller = std::make_shared<ISelfController>(system, m_applet, m_process);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetCommonStateGetter(
|
||||
Out<SharedPointer<ICommonStateGetter>> out_common_state_getter) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_common_state_getter = std::make_shared<ICommonStateGetter>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_library_applet_creator =
|
||||
std::make_shared<ILibraryAppletCreator>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetApplicationCreator(
|
||||
Out<SharedPointer<IApplicationCreator>> out_application_creator) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_application_creator = std::make_shared<IApplicationCreator>(system, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetAppletCommonFunctions(
|
||||
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_applet_common_functions = std::make_shared<IAppletCommonFunctions>(system, m_applet);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetHomeMenuFunctions(
|
||||
Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_home_menu_functions =
|
||||
std::make_shared<IHomeMenuFunctions>(system, m_applet, m_window_system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result ISystemAppletProxy::GetGlobalStateController(
|
||||
Out<SharedPointer<IGlobalStateController>> out_global_state_controller) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
*out_global_state_controller = std::make_shared<IGlobalStateController>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -1,75 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// 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 {
|
||||
|
||||
struct Applet;
|
||||
class IAppletCommonFunctions;
|
||||
class IApplicationCreator;
|
||||
class IAudioController;
|
||||
class ICommonStateGetter;
|
||||
class IDebugFunctions;
|
||||
class IDisplayController;
|
||||
class IHomeMenuFunctions;
|
||||
class IGlobalStateController;
|
||||
class ILibraryAppletCreator;
|
||||
class IProcessWindingController;
|
||||
class ISelfController;
|
||||
class IWindowController;
|
||||
class WindowSystem;
|
||||
|
||||
class ISystemAppletProxy final : public ServiceFramework<ISystemAppletProxy> {
|
||||
public:
|
||||
explicit ISystemAppletProxy(Core::System& system, std::shared_ptr<Applet> applet,
|
||||
Kernel::KProcess* process, WindowSystem& window_system);
|
||||
~ISystemAppletProxy();
|
||||
|
||||
private:
|
||||
Result GetCommonStateGetter(Out<SharedPointer<ICommonStateGetter>> out_common_state_getter);
|
||||
Result GetSelfController(Out<SharedPointer<ISelfController>> out_self_controller);
|
||||
Result GetWindowController(Out<SharedPointer<IWindowController>> out_window_controller);
|
||||
Result GetAudioController(Out<SharedPointer<IAudioController>> out_audio_controller);
|
||||
Result GetDisplayController(Out<SharedPointer<IDisplayController>> out_display_controller);
|
||||
Result GetProcessWindingController(
|
||||
Out<SharedPointer<IProcessWindingController>> out_process_winding_controller);
|
||||
Result GetDebugFunctions(Out<SharedPointer<IDebugFunctions>> out_debug_functions);
|
||||
Result GetLibraryAppletCreator(
|
||||
Out<SharedPointer<ILibraryAppletCreator>> out_library_applet_creator);
|
||||
Result GetApplicationCreator(Out<SharedPointer<IApplicationCreator>> out_application_creator);
|
||||
Result GetAppletCommonFunctions(
|
||||
Out<SharedPointer<IAppletCommonFunctions>> out_applet_common_functions);
|
||||
Result GetHomeMenuFunctions(Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions);
|
||||
Result GetGlobalStateController(
|
||||
Out<SharedPointer<IGlobalStateController>> out_global_state_controller);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||
FunctionInfo{1, D<&ISystemAppletProxy::GetSelfController>, "GetSelfController"},
|
||||
FunctionInfo{2, D<&ISystemAppletProxy::GetWindowController>, "GetWindowController"},
|
||||
FunctionInfo{3, D<&ISystemAppletProxy::GetAudioController>, "GetAudioController"},
|
||||
FunctionInfo{4, D<&ISystemAppletProxy::GetDisplayController>, "GetDisplayController"},
|
||||
FunctionInfo{10, D<&ISystemAppletProxy::GetProcessWindingController>, "GetProcessWindingController"},
|
||||
FunctionInfo{11, D<&ISystemAppletProxy::GetLibraryAppletCreator>, "GetLibraryAppletCreator"},
|
||||
FunctionInfo{20, D<&ISystemAppletProxy::GetHomeMenuFunctions>, "GetHomeMenuFunctions"},
|
||||
FunctionInfo{21, D<&ISystemAppletProxy::GetGlobalStateController>, "GetGlobalStateController"},
|
||||
FunctionInfo{22, D<&ISystemAppletProxy::GetApplicationCreator>, "GetApplicationCreator"},
|
||||
FunctionInfo{23, D<&ISystemAppletProxy::GetAppletCommonFunctions>, "GetAppletCommonFunctions"},
|
||||
FunctionInfo{1000, D<&ISystemAppletProxy::GetDebugFunctions>, "GetDebugFunctions"}
|
||||
);
|
||||
WindowSystem& m_window_system;
|
||||
Kernel::KProcess* const m_process;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
@@ -9,6 +9,20 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IWindowController::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "CreateWindow"},
|
||||
FunctionInfo{1, D<&IWindowController::GetAppletResourceUserId>, "GetAppletResourceUserId"},
|
||||
FunctionInfo{2, D<&IWindowController::GetAppletResourceUserIdOfCallerApplet>, "GetAppletResourceUserIdOfCallerApplet"},
|
||||
FunctionInfo{10, D<&IWindowController::AcquireForegroundRights>, "AcquireForegroundRights"},
|
||||
FunctionInfo{11, D<&IWindowController::ReleaseForegroundRights>, "ReleaseForegroundRights"},
|
||||
FunctionInfo{12, D<&IWindowController::RejectToChangeIntoBackground>, "RejectToChangeIntoBackground"},
|
||||
FunctionInfo{20, D<&IWindowController::SetAppletWindowVisibility>, "SetAppletWindowVisibility"},
|
||||
FunctionInfo{21, D<&IWindowController::SetAppletGpuTimeSlice>, "SetAppletGpuTimeSlice"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IWindowController::IWindowController(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||
WindowSystem& window_system)
|
||||
: ServiceFramework{system_, "IWindowController"},
|
||||
|
||||
@@ -26,19 +26,7 @@ private:
|
||||
Result SetAppletWindowVisibility(bool visible);
|
||||
Result SetAppletGpuTimeSlice(s64 time_slice);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "CreateWindow"},
|
||||
FunctionInfo{1, D<&IWindowController::GetAppletResourceUserId>, "GetAppletResourceUserId"},
|
||||
FunctionInfo{2, D<&IWindowController::GetAppletResourceUserIdOfCallerApplet>, "GetAppletResourceUserIdOfCallerApplet"},
|
||||
FunctionInfo{10, D<&IWindowController::AcquireForegroundRights>, "AcquireForegroundRights"},
|
||||
FunctionInfo{11, D<&IWindowController::ReleaseForegroundRights>, "ReleaseForegroundRights"},
|
||||
FunctionInfo{12, D<&IWindowController::RejectToChangeIntoBackground>, "RejectToChangeIntoBackground"},
|
||||
FunctionInfo{20, D<&IWindowController::SetAppletWindowVisibility>, "SetAppletWindowVisibility"},
|
||||
FunctionInfo{21, D<&IWindowController::SetAppletGpuTimeSlice>, "SetAppletGpuTimeSlice"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
WindowSystem& m_window_system;
|
||||
const std::shared_ptr<Applet> m_applet;
|
||||
};
|
||||
|
||||
@@ -28,6 +28,34 @@
|
||||
|
||||
namespace Service::AOC {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAddOnContentManager::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "CountAddOnContentByApplicationId"},
|
||||
FunctionInfo{1, nullptr, "ListAddOnContentByApplicationId"},
|
||||
FunctionInfo{2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"},
|
||||
FunctionInfo{3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"},
|
||||
FunctionInfo{4, nullptr, "GetAddOnContentBaseIdByApplicationId"},
|
||||
FunctionInfo{5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"},
|
||||
FunctionInfo{6, nullptr, "PrepareAddOnContentByApplicationId"},
|
||||
FunctionInfo{7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"},
|
||||
FunctionInfo{8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"},
|
||||
FunctionInfo{9, nullptr, "GetAddOnContentLostErrorCode"},
|
||||
FunctionInfo{10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"},
|
||||
FunctionInfo{11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"},
|
||||
FunctionInfo{12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"},
|
||||
FunctionInfo{13, nullptr, "IsAddOnContentMountedForDebug"},
|
||||
FunctionInfo{50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"},
|
||||
FunctionInfo{100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"},
|
||||
FunctionInfo{101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"},
|
||||
FunctionInfo{110, nullptr, "CreateContentsServiceManager"},
|
||||
FunctionInfo{200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"},
|
||||
FunctionInfo{300, nullptr, "SetupHostAddOnContent"},
|
||||
FunctionInfo{301, nullptr, "GetRegisteredAddOnContentPath"},
|
||||
FunctionInfo{302, nullptr, "UpdateCachedList"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) {
|
||||
return FileSys::GetBaseTitleID(title_id) == base;
|
||||
}
|
||||
|
||||
@@ -40,33 +40,7 @@ public:
|
||||
OutInterface<IPurchaseEventManager> out_interface);
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "CountAddOnContentByApplicationId"},
|
||||
FunctionInfo{1, nullptr, "ListAddOnContentByApplicationId"},
|
||||
FunctionInfo{2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"},
|
||||
FunctionInfo{3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"},
|
||||
FunctionInfo{4, nullptr, "GetAddOnContentBaseIdByApplicationId"},
|
||||
FunctionInfo{5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"},
|
||||
FunctionInfo{6, nullptr, "PrepareAddOnContentByApplicationId"},
|
||||
FunctionInfo{7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"},
|
||||
FunctionInfo{8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"},
|
||||
FunctionInfo{9, nullptr, "GetAddOnContentLostErrorCode"},
|
||||
FunctionInfo{10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"},
|
||||
FunctionInfo{11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"},
|
||||
FunctionInfo{12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"},
|
||||
FunctionInfo{13, nullptr, "IsAddOnContentMountedForDebug"},
|
||||
FunctionInfo{50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"},
|
||||
FunctionInfo{100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"},
|
||||
FunctionInfo{101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"},
|
||||
FunctionInfo{110, nullptr, "CreateContentsServiceManager"},
|
||||
FunctionInfo{200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"},
|
||||
FunctionInfo{300, nullptr, "SetupHostAddOnContent"},
|
||||
FunctionInfo{301, nullptr, "GetRegisteredAddOnContentPath"},
|
||||
FunctionInfo{302, nullptr, "UpdateCachedList"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
std::vector<u64> add_on_content;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* aoc_change_event;
|
||||
|
||||
@@ -11,21 +11,20 @@ namespace Service::AOC {
|
||||
|
||||
constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400};
|
||||
|
||||
IPurchaseEventManager::IPurchaseEventManager(Core::System& system_)
|
||||
: ServiceFramework{system_, "IPurchaseEventManager"}, service_context{system,
|
||||
"IPurchaseEventManager"} {
|
||||
// clang-format off
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IPurchaseEventManager::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"},
|
||||
FunctionInfo{1, D<&IPurchaseEventManager::SetDeliveryTarget>, "SetDeliveryTarget"},
|
||||
FunctionInfo{2, D<&IPurchaseEventManager::GetPurchasedEvent>, "GetPurchasedEvent"},
|
||||
FunctionInfo{3, D<&IPurchaseEventManager::PopPurchasedProductInfo>, "PopPurchasedProductInfo"},
|
||||
FunctionInfo{4, D<&IPurchaseEventManager::PopPurchasedProductInfoWithUid>, "PopPurchasedProductInfoWithUid"}
|
||||
);
|
||||
FunctionInfo{0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"},
|
||||
FunctionInfo{1, D<&IPurchaseEventManager::SetDeliveryTarget>, "SetDeliveryTarget"},
|
||||
FunctionInfo{2, D<&IPurchaseEventManager::GetPurchasedEvent>, "GetPurchasedEvent"},
|
||||
FunctionInfo{3, D<&IPurchaseEventManager::PopPurchasedProductInfo>, "PopPurchasedProductInfo"},
|
||||
FunctionInfo{4, D<&IPurchaseEventManager::PopPurchasedProductInfoWithUid>, "PopPurchasedProductInfoWithUid"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IPurchaseEventManager::IPurchaseEventManager(Core::System& system_)
|
||||
: ServiceFramework{system_, "IPurchaseEventManager"}
|
||||
, service_context{system, "IPurchaseEventManager"} {
|
||||
purchased_event = service_context.CreateEvent("IPurchaseEventManager:PurchasedEvent");
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ public:
|
||||
Result PopPurchasedProductInfo();
|
||||
Result PopPurchasedProductInfoWithUid();
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
|
||||
private:
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* purchased_event;
|
||||
|
||||
@@ -11,6 +11,27 @@
|
||||
namespace Service::Audio {
|
||||
using namespace AudioCore::AudioIn;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioIn::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"},
|
||||
FunctionInfo{1, D<&IAudioIn::Start>, "Start"},
|
||||
FunctionInfo{2, D<&IAudioIn::Stop>, "Stop"},
|
||||
FunctionInfo{3, D<&IAudioIn::AppendAudioInBuffer>, "AppendAudioInBuffer"},
|
||||
FunctionInfo{4, D<&IAudioIn::RegisterBufferEvent>, "RegisterBufferEvent"},
|
||||
FunctionInfo{5, D<&IAudioIn::GetReleasedAudioInBuffers>, "GetReleasedAudioInBuffers"},
|
||||
FunctionInfo{6, D<&IAudioIn::ContainsAudioInBuffer>, "ContainsAudioInBuffer"},
|
||||
FunctionInfo{7, D<&IAudioIn::AppendAudioInBuffer>, "AppendUacInBuffer"},
|
||||
FunctionInfo{8, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendAudioInBufferAuto"},
|
||||
FunctionInfo{9, D<&IAudioIn::GetReleasedAudioInBuffersAuto>, "GetReleasedAudioInBuffersAuto"},
|
||||
FunctionInfo{10, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendUacInBufferAuto"},
|
||||
FunctionInfo{11, D<&IAudioIn::GetAudioInBufferCount>, "GetAudioInBufferCount"},
|
||||
FunctionInfo{12, D<&IAudioIn::SetDeviceGain>, "SetDeviceGain"},
|
||||
FunctionInfo{13, D<&IAudioIn::GetDeviceGain>, "GetDeviceGain"},
|
||||
FunctionInfo{14, D<&IAudioIn::FlushAudioInBuffers>, "FlushAudioInBuffers"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioIn::IAudioIn(Core::System& system_, Manager& manager, size_t session_id,
|
||||
const std::string& device_name, const AudioInParameter& in_params,
|
||||
Kernel::KProcess* handle, u64 applet_resource_user_id)
|
||||
|
||||
@@ -43,26 +43,7 @@ public:
|
||||
Result FlushAudioInBuffers(Out<bool> out_flushed);
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"},
|
||||
FunctionInfo{1, D<&IAudioIn::Start>, "Start"},
|
||||
FunctionInfo{2, D<&IAudioIn::Stop>, "Stop"},
|
||||
FunctionInfo{3, D<&IAudioIn::AppendAudioInBuffer>, "AppendAudioInBuffer"},
|
||||
FunctionInfo{4, D<&IAudioIn::RegisterBufferEvent>, "RegisterBufferEvent"},
|
||||
FunctionInfo{5, D<&IAudioIn::GetReleasedAudioInBuffers>, "GetReleasedAudioInBuffers"},
|
||||
FunctionInfo{6, D<&IAudioIn::ContainsAudioInBuffer>, "ContainsAudioInBuffer"},
|
||||
FunctionInfo{7, D<&IAudioIn::AppendAudioInBuffer>, "AppendUacInBuffer"},
|
||||
FunctionInfo{8, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendAudioInBufferAuto"},
|
||||
FunctionInfo{9, D<&IAudioIn::GetReleasedAudioInBuffersAuto>, "GetReleasedAudioInBuffersAuto"},
|
||||
FunctionInfo{10, D<&IAudioIn::AppendAudioInBufferAuto>, "AppendUacInBufferAuto"},
|
||||
FunctionInfo{11, D<&IAudioIn::GetAudioInBufferCount>, "GetAudioInBufferCount"},
|
||||
FunctionInfo{12, D<&IAudioIn::SetDeviceGain>, "SetDeviceGain"},
|
||||
FunctionInfo{13, D<&IAudioIn::GetDeviceGain>, "GetDeviceGain"},
|
||||
FunctionInfo{14, D<&IAudioIn::FlushAudioInBuffers>, "FlushAudioInBuffers"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
Kernel::KProcess* process;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* event;
|
||||
|
||||
@@ -9,6 +9,18 @@
|
||||
namespace Service::Audio {
|
||||
using namespace AudioCore::AudioIn;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioInManager::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"},
|
||||
FunctionInfo{1, D<&IAudioInManager::OpenAudioIn>, "OpenAudioIn"},
|
||||
FunctionInfo{2, D<&IAudioInManager::ListAudioIns>, "ListAudioInsAuto"},
|
||||
FunctionInfo{3, D<&IAudioInManager::OpenAudioIn>, "OpenAudioInAuto"},
|
||||
FunctionInfo{4, D<&IAudioInManager::ListAudioInsAutoFiltered>, "ListAudioInsAutoFiltered"},
|
||||
FunctionInfo{5, D<&IAudioInManager::OpenAudioInProtocolSpecified>, "OpenAudioInProtocolSpecified"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioInManager::IAudioInManager(Core::System& system_)
|
||||
: ServiceFramework{system_, "audin:u"}
|
||||
, impl{std::make_unique<AudioCore::AudioIn::Manager>(system_)}
|
||||
|
||||
@@ -51,17 +51,7 @@ private:
|
||||
AudioCore::AudioIn::AudioInParameter parameter,
|
||||
InCopyHandle<Kernel::KProcess> process_handle, ClientAppletResourceUserId aruid);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"},
|
||||
FunctionInfo{1, D<&IAudioInManager::OpenAudioIn>, "OpenAudioIn"},
|
||||
FunctionInfo{2, D<&IAudioInManager::ListAudioIns>, "ListAudioInsAuto"},
|
||||
FunctionInfo{3, D<&IAudioInManager::OpenAudioIn>, "OpenAudioInAuto"},
|
||||
FunctionInfo{4, D<&IAudioInManager::ListAudioInsAutoFiltered>, "ListAudioInsAutoFiltered"},
|
||||
FunctionInfo{5, D<&IAudioInManager::OpenAudioInProtocolSpecified>, "OpenAudioInProtocolSpecified"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
std::unique_ptr<AudioCore::AudioIn::Manager> impl;
|
||||
};
|
||||
|
||||
|
||||
@@ -15,17 +15,7 @@
|
||||
namespace Service::Audio {
|
||||
using namespace AudioCore::AudioOut;
|
||||
|
||||
IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id,
|
||||
const std::string& device_name, const AudioOutParameter& in_params,
|
||||
Kernel::KProcess* handle, u64 applet_resource_user_id)
|
||||
: ServiceFramework{system_, "IAudioOut"}, service_context{system_, "IAudioOut"},
|
||||
event{service_context.CreateEvent("AudioOutEvent")}, process{handle},
|
||||
impl{std::make_shared<AudioCore::AudioOut::Out>(system_, manager, event, session_id)} {
|
||||
|
||||
// clang-format off
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioOut::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioOut::GetAudioOutState>, "GetAudioOutState"},
|
||||
FunctionInfo{1, D<&IAudioOut::Start>, "Start"},
|
||||
@@ -42,6 +32,15 @@ IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id,
|
||||
FunctionInfo{12, D<&IAudioOut::SetAudioOutVolume>, "SetAudioOutVolume"},
|
||||
FunctionInfo{13, D<&IAudioOut::GetAudioOutVolume>, "GetAudioOutVolume"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioOut::IAudioOut(Core::System& system_, Manager& manager, size_t session_id,
|
||||
const std::string& device_name, const AudioOutParameter& in_params,
|
||||
Kernel::KProcess* handle, u64 applet_resource_user_id)
|
||||
: ServiceFramework{system_, "IAudioOut"}, service_context{system_, "IAudioOut"},
|
||||
event{service_context.CreateEvent("AudioOutEvent")}, process{handle},
|
||||
impl{std::make_shared<AudioCore::AudioOut::Out>(system_, manager, event, session_id)} {
|
||||
|
||||
process->Open(system.Kernel());
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
Result GetAudioOutVolume(Out<f32> out_volume);
|
||||
|
||||
private:
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* event;
|
||||
Kernel::KProcess* process;
|
||||
|
||||
@@ -13,6 +13,16 @@
|
||||
namespace Service::Audio {
|
||||
using namespace AudioCore::AudioOut;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioOutManager::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioOutManager::ListAudioOuts>, "ListAudioOuts"},
|
||||
FunctionInfo{1, D<&IAudioOutManager::OpenAudioOut>, "OpenAudioOut"},
|
||||
FunctionInfo{2, D<&IAudioOutManager::ListAudioOutsAuto>, "ListAudioOutsAuto"},
|
||||
FunctionInfo{3, D<&IAudioOutManager::OpenAudioOutAuto>, "OpenAudioOutAuto"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioOutManager::IAudioOutManager(Core::System& system_)
|
||||
: ServiceFramework{system_, "audout:u"}
|
||||
, impl(system_)
|
||||
|
||||
@@ -43,15 +43,7 @@ private:
|
||||
AudioCore::AudioOut::AudioOutParameter parameter,
|
||||
InCopyHandle<Kernel::KProcess> process_handle, ClientAppletResourceUserId aruid);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioOutManager::ListAudioOuts>, "ListAudioOuts"},
|
||||
FunctionInfo{1, D<&IAudioOutManager::OpenAudioOut>, "OpenAudioOut"},
|
||||
FunctionInfo{2, D<&IAudioOutManager::ListAudioOutsAuto>, "ListAudioOutsAuto"},
|
||||
FunctionInfo{3, D<&IAudioOutManager::OpenAudioOutAuto>, "OpenAudioOutAuto"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
std::optional<AudioCore::AudioOut::Manager> impl;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,26 @@
|
||||
namespace Service::Audio {
|
||||
using namespace AudioCore::Renderer;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioRenderer::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"},
|
||||
FunctionInfo{1, D<&IAudioRenderer::GetSampleCount>, "GetSampleCount"},
|
||||
FunctionInfo{2, D<&IAudioRenderer::GetMixBufferCount>, "GetMixBufferCount"},
|
||||
FunctionInfo{3, D<&IAudioRenderer::GetState>, "GetState"},
|
||||
FunctionInfo{4, D<&IAudioRenderer::RequestUpdate>, "RequestUpdate"},
|
||||
FunctionInfo{5, D<&IAudioRenderer::Start>, "Start"},
|
||||
FunctionInfo{6, D<&IAudioRenderer::Stop>, "Stop"},
|
||||
FunctionInfo{7, D<&IAudioRenderer::QuerySystemEvent>, "QuerySystemEvent"},
|
||||
FunctionInfo{8, D<&IAudioRenderer::SetRenderingTimeLimit>, "SetRenderingTimeLimit"},
|
||||
FunctionInfo{9, D<&IAudioRenderer::GetRenderingTimeLimit>, "GetRenderingTimeLimit"},
|
||||
FunctionInfo{10, D<&IAudioRenderer::RequestUpdateAuto>, "RequestUpdateAuto"}, //3.0.0+
|
||||
FunctionInfo{11, nullptr, "ExecuteAudioRendererRendering"}, //3.0.0+
|
||||
FunctionInfo{12, D<&IAudioRenderer::SetVoiceDropParameter>, "SetVoiceDropParameter"}, //15.0.0+
|
||||
FunctionInfo{13, D<&IAudioRenderer::GetVoiceDropParameter>, "GetVoiceDropParameter"} //15.0.0+
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioRenderer::IAudioRenderer(Core::System& system_, Manager& manager_,
|
||||
AudioCore::AudioRendererParameterInternal& params,
|
||||
Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size,
|
||||
|
||||
@@ -42,25 +42,7 @@ private:
|
||||
Result SetVoiceDropParameter(f32 voice_drop_parameter);
|
||||
Result GetVoiceDropParameter(Out<f32> out_voice_drop_parameter);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"},
|
||||
FunctionInfo{1, D<&IAudioRenderer::GetSampleCount>, "GetSampleCount"},
|
||||
FunctionInfo{2, D<&IAudioRenderer::GetMixBufferCount>, "GetMixBufferCount"},
|
||||
FunctionInfo{3, D<&IAudioRenderer::GetState>, "GetState"},
|
||||
FunctionInfo{4, D<&IAudioRenderer::RequestUpdate>, "RequestUpdate"},
|
||||
FunctionInfo{5, D<&IAudioRenderer::Start>, "Start"},
|
||||
FunctionInfo{6, D<&IAudioRenderer::Stop>, "Stop"},
|
||||
FunctionInfo{7, D<&IAudioRenderer::QuerySystemEvent>, "QuerySystemEvent"},
|
||||
FunctionInfo{8, D<&IAudioRenderer::SetRenderingTimeLimit>, "SetRenderingTimeLimit"},
|
||||
FunctionInfo{9, D<&IAudioRenderer::GetRenderingTimeLimit>, "GetRenderingTimeLimit"},
|
||||
FunctionInfo{10, D<&IAudioRenderer::RequestUpdateAuto>, "RequestUpdateAuto"}, //3.0.0+
|
||||
FunctionInfo{11, nullptr, "ExecuteAudioRendererRendering"}, //3.0.0+
|
||||
FunctionInfo{12, D<&IAudioRenderer::SetVoiceDropParameter>, "SetVoiceDropParameter"}, //15.0.0+
|
||||
FunctionInfo{13, D<&IAudioRenderer::GetVoiceDropParameter>, "GetVoiceDropParameter"}, //15.0.0+
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* rendered_event;
|
||||
AudioCore::Renderer::Manager& manager;
|
||||
|
||||
@@ -18,6 +18,17 @@ namespace Service::Audio {
|
||||
|
||||
using namespace AudioCore::Renderer;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAudioRendererManager::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioRendererManager::OpenAudioRenderer>, "OpenAudioRenderer"},
|
||||
FunctionInfo{1, D<&IAudioRendererManager::GetWorkBufferSize>, "GetWorkBufferSize"},
|
||||
FunctionInfo{2, D<&IAudioRendererManager::GetAudioDeviceService>, "GetAudioDeviceService"},
|
||||
FunctionInfo{3, nullptr, "OpenAudioRendererForManualExecution"},
|
||||
FunctionInfo{4, D<&IAudioRendererManager::GetAudioDeviceServiceWithRevisionInfo>, "GetAudioDeviceServiceWithRevisionInfo"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAudioRendererManager::IAudioRendererManager(Core::System& system_)
|
||||
: ServiceFramework{system_, "audren:u"}
|
||||
, impl(system_)
|
||||
|
||||
@@ -33,16 +33,7 @@ private:
|
||||
Result GetAudioDeviceServiceWithRevisionInfo(Out<SharedPointer<IAudioDevice>> out_audio_device,
|
||||
u32 revision, ClientAppletResourceUserId aruid);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IAudioRendererManager::OpenAudioRenderer>, "OpenAudioRenderer"},
|
||||
FunctionInfo{1, D<&IAudioRendererManager::GetWorkBufferSize>, "GetWorkBufferSize"},
|
||||
FunctionInfo{2, D<&IAudioRendererManager::GetAudioDeviceService>, "GetAudioDeviceService"},
|
||||
FunctionInfo{3, nullptr, "OpenAudioRendererForManualExecution"},
|
||||
FunctionInfo{4, D<&IAudioRendererManager::GetAudioDeviceServiceWithRevisionInfo>, "GetAudioDeviceServiceWithRevisionInfo"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
std::optional<AudioCore::Renderer::Manager> impl;
|
||||
u32 num_audio_devices{0};
|
||||
};
|
||||
|
||||
@@ -8,6 +8,22 @@ namespace Service::Audio {
|
||||
|
||||
using namespace AudioCore::OpusDecoder;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IHardwareOpusDecoder::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IHardwareOpusDecoder::DecodeInterleavedOld>, "DecodeInterleavedOld"},
|
||||
FunctionInfo{1, D<&IHardwareOpusDecoder::SetContext>, "SetContext"},
|
||||
FunctionInfo{2, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamOld>, "DecodeInterleavedForMultiStreamOld"},
|
||||
FunctionInfo{3, D<&IHardwareOpusDecoder::SetContextForMultiStream>, "SetContextForMultiStream"},
|
||||
FunctionInfo{4, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfOld>, "DecodeInterleavedWithPerfOld"},
|
||||
FunctionInfo{5, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfOld>, "DecodeInterleavedForMultiStreamWithPerfOld"},
|
||||
FunctionInfo{6, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfAndResetOld>, "DecodeInterleavedWithPerfAndResetOld"},
|
||||
FunctionInfo{7, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfAndResetOld>, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"},
|
||||
FunctionInfo{8, D<&IHardwareOpusDecoder::DecodeInterleaved>, "DecodeInterleaved"},
|
||||
FunctionInfo{9, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStream>, "DecodeInterleavedForMultiStream"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IHardwareOpusDecoder::IHardwareOpusDecoder(Core::System& system_, HardwareOpus& hardware_opus)
|
||||
: ServiceFramework{system_, "IHardwareOpusDecoder"},
|
||||
impl{std::make_unique<AudioCore::OpusDecoder::OpusDecoder>(system_, hardware_opus)} {
|
||||
|
||||
@@ -55,22 +55,8 @@ private:
|
||||
Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken,
|
||||
InBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> opus_data,
|
||||
bool reset);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IHardwareOpusDecoder::DecodeInterleavedOld>, "DecodeInterleavedOld"},
|
||||
FunctionInfo{1, D<&IHardwareOpusDecoder::SetContext>, "SetContext"},
|
||||
FunctionInfo{2, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamOld>, "DecodeInterleavedForMultiStreamOld"},
|
||||
FunctionInfo{3, D<&IHardwareOpusDecoder::SetContextForMultiStream>, "SetContextForMultiStream"},
|
||||
FunctionInfo{4, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfOld>, "DecodeInterleavedWithPerfOld"},
|
||||
FunctionInfo{5, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfOld>, "DecodeInterleavedForMultiStreamWithPerfOld"},
|
||||
FunctionInfo{6, D<&IHardwareOpusDecoder::DecodeInterleavedWithPerfAndResetOld>, "DecodeInterleavedWithPerfAndResetOld"},
|
||||
FunctionInfo{7, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStreamWithPerfAndResetOld>, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"},
|
||||
FunctionInfo{8, D<&IHardwareOpusDecoder::DecodeInterleaved>, "DecodeInterleaved"},
|
||||
FunctionInfo{9, D<&IHardwareOpusDecoder::DecodeInterleavedForMultiStream>, "DecodeInterleavedForMultiStream"}
|
||||
);
|
||||
std::unique_ptr<AudioCore::OpusDecoder::OpusDecoder> impl;
|
||||
Common::ScratchBuffer<u8> output_data;
|
||||
};
|
||||
|
||||
@@ -9,6 +9,22 @@ namespace Service::Audio {
|
||||
|
||||
using namespace AudioCore::OpusDecoder;
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IHardwareOpusDecoderManager::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoder>, "OpenHardwareOpusDecoder"},
|
||||
FunctionInfo{1, D<&IHardwareOpusDecoderManager::GetWorkBufferSize>, "GetWorkBufferSize"},
|
||||
FunctionInfo{2, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStream>, "OpenOpusDecoderForMultiStream"},
|
||||
FunctionInfo{3, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStream>, "GetWorkBufferSizeForMultiStream"},
|
||||
FunctionInfo{4, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderEx>, "OpenHardwareOpusDecoderEx"},
|
||||
FunctionInfo{5, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeEx>, "GetWorkBufferSizeEx"},
|
||||
FunctionInfo{6, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStreamEx>, "OpenHardwareOpusDecoderForMultiStreamEx"},
|
||||
FunctionInfo{7, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamEx>, "GetWorkBufferSizeForMultiStreamEx"},
|
||||
FunctionInfo{8, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeExEx>, "GetWorkBufferSizeExEx"},
|
||||
FunctionInfo{9, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamExEx>, "GetWorkBufferSizeForMultiStreamExEx"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IHardwareOpusDecoderManager::IHardwareOpusDecoderManager(Core::System& system_)
|
||||
: ServiceFramework{system_, "hwopus"}, system{system_}, impl{system} {
|
||||
}
|
||||
|
||||
@@ -46,21 +46,7 @@ private:
|
||||
Result GetWorkBufferSizeForMultiStreamExEx(
|
||||
Out<u32> out_size, InLargeData<OpusMultiStreamParametersEx, BufferAttr_HipcPointer> params);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoder>, "OpenHardwareOpusDecoder"},
|
||||
FunctionInfo{1, D<&IHardwareOpusDecoderManager::GetWorkBufferSize>, "GetWorkBufferSize"},
|
||||
FunctionInfo{2, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStream>, "OpenOpusDecoderForMultiStream"},
|
||||
FunctionInfo{3, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStream>, "GetWorkBufferSizeForMultiStream"},
|
||||
FunctionInfo{4, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderEx>, "OpenHardwareOpusDecoderEx"},
|
||||
FunctionInfo{5, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeEx>, "GetWorkBufferSizeEx"},
|
||||
FunctionInfo{6, D<&IHardwareOpusDecoderManager::OpenHardwareOpusDecoderForMultiStreamEx>, "OpenHardwareOpusDecoderForMultiStreamEx"},
|
||||
FunctionInfo{7, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamEx>, "GetWorkBufferSizeForMultiStreamEx"},
|
||||
FunctionInfo{8, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeExEx>, "GetWorkBufferSizeExEx"},
|
||||
FunctionInfo{9, D<&IHardwareOpusDecoderManager::GetWorkBufferSizeForMultiStreamExEx>, "GetWorkBufferSizeForMultiStreamExEx"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
Core::System& system;
|
||||
AudioCore::OpusDecoder::OpusDecoderManager impl;
|
||||
};
|
||||
|
||||
@@ -27,6 +27,15 @@ static BcatDigest DigestFile(const FileSys::VirtualFile& file) {
|
||||
return out;
|
||||
}
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IDeliveryCacheDirectoryService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheDirectoryService::Open>, "Open"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheDirectoryService::Read>, "Read"},
|
||||
FunctionInfo{2, D<&IDeliveryCacheDirectoryService::GetCount>, "GetCount"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IDeliveryCacheDirectoryService::IDeliveryCacheDirectoryService(Core::System& system_,
|
||||
FileSys::VirtualDir root_)
|
||||
: ServiceFramework{system_, "IDeliveryCacheDirectoryService"}, root(std::move(root_)) {
|
||||
|
||||
@@ -26,14 +26,7 @@ private:
|
||||
OutArray<DeliveryCacheDirectoryEntry, BufferAttr_HipcMapAlias> out_buffer);
|
||||
Result GetCount(Out<s32> out_count);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheDirectoryService::Open>, "Open"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheDirectoryService::Read>, "Read"},
|
||||
FunctionInfo{2, D<&IDeliveryCacheDirectoryService::GetCount>, "GetCount"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
FileSys::VirtualDir root;
|
||||
FileSys::VirtualDir current_dir;
|
||||
};
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
|
||||
namespace Service::BCAT {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IDeliveryCacheFileService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheFileService::Open>, "Open"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheFileService::Read>, "Read"},
|
||||
FunctionInfo{2, D<&IDeliveryCacheFileService::GetSize>, "GetSize"},
|
||||
FunctionInfo{3, D<&IDeliveryCacheFileService::GetDigest>, "GetDigest"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IDeliveryCacheFileService::IDeliveryCacheFileService(Core::System& system_,
|
||||
FileSys::VirtualDir root_)
|
||||
: ServiceFramework{system_, "IDeliveryCacheFileService"}, root(std::move(root_)) {
|
||||
|
||||
@@ -26,15 +26,7 @@ private:
|
||||
Result GetSize(Out<u64> out_size);
|
||||
Result GetDigest(Out<BcatDigest> out_digest);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheFileService::Open>, "Open"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheFileService::Read>, "Read"},
|
||||
FunctionInfo{2, D<&IDeliveryCacheFileService::GetSize>, "GetSize"},
|
||||
FunctionInfo{3, D<&IDeliveryCacheFileService::GetDigest>, "GetDigest"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
FileSys::VirtualDir root;
|
||||
FileSys::VirtualFile current_file;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
|
||||
namespace Service::BCAT {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IDeliveryCacheProgressService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheProgressService::GetEvent>, "GetEvent"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheProgressService::GetImpl>, "GetImpl"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IDeliveryCacheProgressService::IDeliveryCacheProgressService(Core::System& system_,
|
||||
Kernel::KReadableEvent& event_,
|
||||
const DeliveryCacheProgressImpl& impl_)
|
||||
|
||||
@@ -28,13 +28,7 @@ private:
|
||||
Result GetEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result GetImpl(OutLargeData<DeliveryCacheProgressImpl, BufferAttr_HipcPointer> out_impl);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheProgressService::GetEvent>, "Get"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheProgressService::GetImpl>, "Get"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
Kernel::KReadableEvent& event;
|
||||
const DeliveryCacheProgressImpl& impl;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,15 @@
|
||||
|
||||
namespace Service::BCAT {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IDeliveryCacheStorageService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheStorageService::CreateFileService>, "CreateFileService"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheStorageService::CreateDirectoryService>, "CreateDirectoryService"},
|
||||
FunctionInfo{10, D<&IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory>, "EnumerateDeliveryCacheDirectory"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IDeliveryCacheStorageService::IDeliveryCacheStorageService(Core::System& system_,
|
||||
FileSys::VirtualDir root_)
|
||||
: ServiceFramework{system_, "IDeliveryCacheStorageService"}, root(std::move(root_)) {
|
||||
|
||||
@@ -28,14 +28,7 @@ private:
|
||||
Out<s32> out_directory_count,
|
||||
OutArray<DirectoryName, BufferAttr_HipcMapAlias> out_directories);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IDeliveryCacheStorageService::CreateFileService>, "CreateFileService"},
|
||||
FunctionInfo{1, D<&IDeliveryCacheStorageService::CreateDirectoryService>, "CreateDirectoryService"},
|
||||
FunctionInfo{10, D<&IDeliveryCacheStorageService::EnumerateDeliveryCacheDirectory>, "EnumerateDeliveryCacheDirectory"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
FileSys::VirtualDir root;
|
||||
std::vector<DirectoryName> entries;
|
||||
std::size_t next_read_index = 0;
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
|
||||
namespace Service::News {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* INewlyArrivedEventHolder::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&INewlyArrivedEventHolder::Get>, "Get"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
INewlyArrivedEventHolder::INewlyArrivedEventHolder(Core::System& system_)
|
||||
: ServiceFramework{system_, "INewlyArrivedEventHolder"}
|
||||
, service_context{system_, "INewlyArrivedEventHolder"} {
|
||||
|
||||
@@ -26,12 +26,7 @@ public:
|
||||
private:
|
||||
Result Get(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&INewlyArrivedEventHolder::Get>, "Get"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
Kernel::KEvent* arrived_event;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
};
|
||||
|
||||
@@ -24,6 +24,17 @@ std::string_view ToStringView(std::span<const char> buf) {
|
||||
|
||||
} // namespace
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* INewsDataService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&INewsDataService::Open>, "Open"},
|
||||
FunctionInfo{1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"},
|
||||
FunctionInfo{2, D<&INewsDataService::Read>, "Read"},
|
||||
FunctionInfo{3, D<&INewsDataService::GetSize>, "GetSize"},
|
||||
FunctionInfo{1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
INewsDataService::INewsDataService(Core::System& system_)
|
||||
: ServiceFramework{system_, "INewsDataService"} {
|
||||
}
|
||||
|
||||
@@ -31,16 +31,7 @@ private:
|
||||
Result Read(Out<u64> out_size, s64 offset, OutBuffer<BufferAttr_HipcMapAlias> out_buffer);
|
||||
Result GetSize(Out<s64> out_size);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&INewsDataService::Open>, "Open"},
|
||||
FunctionInfo{1, D<&INewsDataService::OpenWithNewsRecordV1>, "OpenWithNewsRecordV1"},
|
||||
FunctionInfo{2, D<&INewsDataService::Read>, "Read"},
|
||||
FunctionInfo{3, D<&INewsDataService::GetSize>, "GetSize"},
|
||||
FunctionInfo{1001, D<&INewsDataService::OpenWithNewsRecord>, "OpenWithNewsRecord"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
std::vector<u8> opened_payload;
|
||||
};
|
||||
|
||||
|
||||
@@ -45,6 +45,19 @@ bool UpdateField(NewsRecord& rec, std::string_view column, s32 value, bool addit
|
||||
|
||||
} // namespace
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* INewsDatabaseService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&INewsDatabaseService::GetListV1>, "GetListV1"},
|
||||
FunctionInfo{1, D<&INewsDatabaseService::Count>, "Count"},
|
||||
FunctionInfo{2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"},
|
||||
FunctionInfo{3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"},
|
||||
FunctionInfo{4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"},
|
||||
FunctionInfo{5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"},
|
||||
FunctionInfo{1000, D<&INewsDatabaseService::GetList>, "GetList"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
INewsDatabaseService::INewsDatabaseService(Core::System& system_)
|
||||
: ServiceFramework{system_, "INewsDatabaseService"} {
|
||||
}
|
||||
|
||||
@@ -50,18 +50,7 @@ private:
|
||||
InBuffer<BufferAttr_HipcPointer> order_by_phrase,
|
||||
s32 offset);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&INewsDatabaseService::GetListV1>, "GetListV1"},
|
||||
FunctionInfo{1, D<&INewsDatabaseService::Count>, "Count"},
|
||||
FunctionInfo{2, D<&INewsDatabaseService::CountWithKey>, "CountWithKey"},
|
||||
FunctionInfo{3, D<&INewsDatabaseService::UpdateIntegerValue>, "UpdateIntegerValue"},
|
||||
FunctionInfo{4, D<&INewsDatabaseService::UpdateIntegerValueWithAddition>, "UpdateIntegerValueWithAddition"},
|
||||
FunctionInfo{5, D<&INewsDatabaseService::UpdateStringValue>, "UpdateStringValue"},
|
||||
FunctionInfo{1000, D<&INewsDatabaseService::GetList>, "GetList"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
};
|
||||
|
||||
} // namespace Service::News
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
|
||||
namespace Service::News {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IOverwriteEventHolder::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IOverwriteEventHolder::Get>, "Get"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IOverwriteEventHolder::IOverwriteEventHolder(Core::System& system_)
|
||||
: ServiceFramework{system_, "IOverwriteEventHolder"}
|
||||
, service_context{system_, "IOverwriteEventHolder"} {
|
||||
|
||||
@@ -26,12 +26,7 @@ public:
|
||||
private:
|
||||
Result Get(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IOverwriteEventHolder::Get>, "Get"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
Kernel::KEvent* overwrite_event;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
};
|
||||
|
||||
@@ -11,6 +11,17 @@
|
||||
|
||||
namespace Service::News {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IServiceCreator::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IServiceCreator::CreateNewsService>, "CreateNewsService"},
|
||||
FunctionInfo{1, D<&IServiceCreator::CreateNewlyArrivedEventHolder>, "CreateNewlyArrivedEventHolder"},
|
||||
FunctionInfo{2, D<&IServiceCreator::CreateNewsDataService>, "CreateNewsDataService"},
|
||||
FunctionInfo{3, D<&IServiceCreator::CreateNewsDatabaseService>, "CreateNewsDatabaseService"},
|
||||
FunctionInfo{4, D<&IServiceCreator::CreateOverwriteEventHolder>, "CreateOverwriteEventHolder"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IServiceCreator::IServiceCreator(Core::System& system_, u32 permissions_, const char* name_)
|
||||
: ServiceFramework{system_, name_}, permissions{permissions_} {
|
||||
}
|
||||
|
||||
@@ -29,16 +29,7 @@ private:
|
||||
Result CreateNewsDatabaseService(OutInterface<INewsDatabaseService> out_interface);
|
||||
Result CreateOverwriteEventHolder(OutInterface<IOverwriteEventHolder> out_interface);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IServiceCreator::CreateNewsService>, "CreateNewsService"},
|
||||
FunctionInfo{1, D<&IServiceCreator::CreateNewlyArrivedEventHolder>, "CreateNewlyArrivedEventHolder"},
|
||||
FunctionInfo{2, D<&IServiceCreator::CreateNewsDataService>, "CreateNewsDataService"},
|
||||
FunctionInfo{3, D<&IServiceCreator::CreateNewsDatabaseService>, "CreateNewsDatabaseService"},
|
||||
FunctionInfo{4, D<&IServiceCreator::CreateOverwriteEventHolder>, "CreateOverwriteEventHolder"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
u32 permissions;
|
||||
};
|
||||
|
||||
|
||||
@@ -13,6 +13,17 @@
|
||||
|
||||
namespace Service::BCAT {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IServiceCreator::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IServiceCreator::CreateBcatService>, "CreateBcatService"},
|
||||
FunctionInfo{1, D<&IServiceCreator::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"},
|
||||
FunctionInfo{2, D<&IServiceCreator::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"},
|
||||
FunctionInfo{3, nullptr, "CreateDeliveryCacheProgressService"},
|
||||
FunctionInfo{4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
std::unique_ptr<BcatBackend> CreateBackendFromSettings([[maybe_unused]] Core::System& system,
|
||||
DirectoryGetter getter) {
|
||||
return std::make_unique<NullBcatBackend>(std::move(getter));
|
||||
|
||||
@@ -33,16 +33,7 @@ private:
|
||||
Result CreateDeliveryCacheStorageServiceWithApplicationId(
|
||||
u64 application_id, OutInterface<IDeliveryCacheStorageService> out_interface);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, D<&IServiceCreator::CreateBcatService>, "CreateBcatService"},
|
||||
FunctionInfo{1, D<&IServiceCreator::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"},
|
||||
FunctionInfo{2, D<&IServiceCreator::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"},
|
||||
FunctionInfo{3, nullptr, "CreateDeliveryCacheProgressService"},
|
||||
FunctionInfo{4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"}
|
||||
);
|
||||
FunctionInfoBase const* FindRequest(u32 key) override;
|
||||
std::unique_ptr<BcatBackend> backend;
|
||||
Service::FileSystem::FileSystemController& fsc;
|
||||
};
|
||||
|
||||
@@ -6,15 +6,319 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/logging.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/set/system_settings_server.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
#include "core/hle/service/btm/btm.h"
|
||||
#include "core/hle/service/btm/btm_debug.h"
|
||||
#include "core/hle/service/btm/btm_system.h"
|
||||
#include "core/hle/service/btm/btm_user.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Kernel {
|
||||
class KEvent;
|
||||
class KReadableEvent;
|
||||
} // namespace Kernel
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::Set {
|
||||
class ISystemSettingsServer;
|
||||
}
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
class IBtmSystemCore final : public ServiceFramework<IBtmSystemCore> {
|
||||
public:
|
||||
explicit IBtmSystemCore(Core::System& system_)
|
||||
: ServiceFramework{system_, "IBtmSystemCore"}, service_context{system_, "IBtmSystemCore"} {
|
||||
radio_event = service_context.CreateEvent("IBtmSystemCore:RadioEvent");
|
||||
audio_device_connection_event = service_context.CreateEvent("IBtmSystemCore:AudioDeviceConnectionEvent");
|
||||
m_set_sys = system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true);
|
||||
}
|
||||
|
||||
~IBtmSystemCore() override {
|
||||
service_context.CloseEvent(radio_event);
|
||||
service_context.CloseEvent(audio_device_connection_event);
|
||||
}
|
||||
|
||||
Result StartGamepadPairing() {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CancelGamepadPairing() {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result EnableRadio() {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
R_RETURN(m_set_sys->SetBluetoothEnableFlag(true));
|
||||
}
|
||||
Result DisableRadio() {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
R_RETURN(m_set_sys->SetBluetoothEnableFlag(false));
|
||||
}
|
||||
|
||||
Result IsRadioEnabled(Out<bool> out_is_enabled) {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
R_RETURN(m_set_sys->GetBluetoothEnableFlag(out_is_enabled));
|
||||
}
|
||||
|
||||
Result AcquireRadioEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &radio_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetDiscoveredAudioDevice(OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out<s32> out_total) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AcquireAudioDeviceConnectionEvent(
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_event = &audio_device_connection_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetConnectedAudioDevices(
|
||||
Out<s32> out_count, OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_count = 0;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result GetPairedAudioDevices(
|
||||
Out<s32> out_count, OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_count = 0;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmSystemCore::StartGamepadPairing>, "StartGamepadPairing"},
|
||||
FunctionInfo{1, C<&IBtmSystemCore::CancelGamepadPairing>, "CancelGamepadPairing"},
|
||||
FunctionInfo{2, nullptr, "ClearGamepadPairingDatabase"},
|
||||
FunctionInfo{3, nullptr, "GetPairedGamepadCount"},
|
||||
FunctionInfo{4, C<&IBtmSystemCore::EnableRadio>, "EnableRadio"},
|
||||
FunctionInfo{5, C<&IBtmSystemCore::DisableRadio>, "DisableRadio"},
|
||||
FunctionInfo{6, C<&IBtmSystemCore::IsRadioEnabled>, "IsRadioEnabled"},
|
||||
FunctionInfo{7, C<&IBtmSystemCore::AcquireRadioEvent>, "AcquireRadioEvent"},
|
||||
FunctionInfo{8, nullptr, "AcquireGamepadPairingEvent"},
|
||||
FunctionInfo{9, nullptr, "IsGamepadPairingStarted"},
|
||||
FunctionInfo{10, nullptr, "StartAudioDeviceDiscovery"},
|
||||
FunctionInfo{11, nullptr, "StopAudioDeviceDiscovery"},
|
||||
FunctionInfo{12, nullptr, "IsDiscoveryingAudioDevice"},
|
||||
FunctionInfo{13, C<&IBtmSystemCore::GetDiscoveredAudioDevice>, "GetDiscoveredAudioDevice"},
|
||||
FunctionInfo{14, C<&IBtmSystemCore::AcquireAudioDeviceConnectionEvent>, "AcquireAudioDeviceConnectionEvent"},
|
||||
FunctionInfo{15, nullptr, "ConnectAudioDevice"},
|
||||
FunctionInfo{16, nullptr, "IsConnectingAudioDevice"},
|
||||
FunctionInfo{17, C<&IBtmSystemCore::GetConnectedAudioDevices>, "GetConnectedAudioDevices"},
|
||||
FunctionInfo{18, nullptr, "DisconnectAudioDevice"},
|
||||
FunctionInfo{19, nullptr, "AcquirePairedAudioDeviceInfoChangedEvent"},
|
||||
FunctionInfo{20, C<&IBtmSystemCore::GetPairedAudioDevices>, "GetPairedAudioDevices"},
|
||||
FunctionInfo{21, nullptr, "RemoveAudioDevicePairing"},
|
||||
FunctionInfo{22, C<&IBtmSystemCore::RequestAudioDeviceConnectionRejection>, "RequestAudioDeviceConnectionRejection"},
|
||||
FunctionInfo{23, C<&IBtmSystemCore::CancelAudioDeviceConnectionRejection>, "CancelAudioDeviceConnectionRejection"}
|
||||
);
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* radio_event;
|
||||
Kernel::KEvent* audio_device_connection_event;
|
||||
std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys;
|
||||
};
|
||||
|
||||
class IBtmSystem final : public ServiceFramework<IBtmSystem> {
|
||||
public:
|
||||
explicit IBtmSystem(Core::System& system_) : ServiceFramework{system_, "btm:sys"} {}
|
||||
~IBtmSystem() override = default;
|
||||
|
||||
Result GetCore(OutInterface<IBtmSystemCore> out_interface) {
|
||||
LOG_WARNING(Service_BTM, "called");
|
||||
|
||||
*out_interface = std::make_shared<IBtmSystemCore>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmSystem::GetCore>, "GetCore"}
|
||||
);
|
||||
};
|
||||
|
||||
class IBtmUserCore final : public ServiceFramework<IBtmUserCore> {
|
||||
public:
|
||||
explicit IBtmUserCore(Core::System& system_)
|
||||
: ServiceFramework{system_, "IBtmUserCore"}, service_context{system_, "IBtmUserCore"} {
|
||||
scan_event = service_context.CreateEvent("IBtmUserCore:ScanEvent");
|
||||
connection_event = service_context.CreateEvent("IBtmUserCore:ConnectionEvent");
|
||||
service_discovery_event = service_context.CreateEvent("IBtmUserCore:DiscoveryEvent");
|
||||
config_event = service_context.CreateEvent("IBtmUserCore:ConfigEvent");
|
||||
}
|
||||
|
||||
~IBtmUserCore() override {
|
||||
service_context.CloseEvent(scan_event);
|
||||
service_context.CloseEvent(connection_event);
|
||||
service_context.CloseEvent(service_discovery_event);
|
||||
service_context.CloseEvent(config_event);
|
||||
}
|
||||
|
||||
Result AcquireBleScanEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &scan_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AcquireBleConnectionEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &connection_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AcquireBleServiceDiscoveryEvent(
|
||||
Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &service_discovery_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result AcquireBleMtuConfigEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &config_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmUserCore::AcquireBleScanEvent>, "AcquireBleScanEvent"},
|
||||
FunctionInfo{1, nullptr, "GetBleScanFilterParameter"},
|
||||
FunctionInfo{2, nullptr, "GetBleScanFilterParameter2"},
|
||||
FunctionInfo{3, nullptr, "StartBleScanForGeneral"},
|
||||
FunctionInfo{4, nullptr, "StopBleScanForGeneral"},
|
||||
FunctionInfo{5, nullptr, "GetBleScanResultsForGeneral"},
|
||||
FunctionInfo{6, nullptr, "StartBleScanForPaired"},
|
||||
FunctionInfo{7, nullptr, "StopBleScanForPaired"},
|
||||
FunctionInfo{8, nullptr, "StartBleScanForSmartDevice"},
|
||||
FunctionInfo{9, nullptr, "StopBleScanForSmartDevice"},
|
||||
FunctionInfo{10, nullptr, "GetBleScanResultsForSmartDevice"},
|
||||
FunctionInfo{17, C<&IBtmUserCore::AcquireBleConnectionEvent>, "AcquireBleConnectionEvent"},
|
||||
FunctionInfo{18, nullptr, "BleConnect"},
|
||||
FunctionInfo{19, nullptr, "BleDisconnect"},
|
||||
FunctionInfo{20, nullptr, "BleGetConnectionState"},
|
||||
FunctionInfo{21, nullptr, "AcquireBlePairingEvent"},
|
||||
FunctionInfo{22, nullptr, "BlePairDevice"},
|
||||
FunctionInfo{23, nullptr, "BleUnPairDevice"},
|
||||
FunctionInfo{24, nullptr, "BleUnPairDevice2"},
|
||||
FunctionInfo{25, nullptr, "BleGetPairedDevices"},
|
||||
FunctionInfo{26, C<&IBtmUserCore::AcquireBleServiceDiscoveryEvent>, "AcquireBleServiceDiscoveryEvent"},
|
||||
FunctionInfo{27, nullptr, "GetGattServices"},
|
||||
FunctionInfo{28, nullptr, "GetGattService"},
|
||||
FunctionInfo{29, nullptr, "GetGattIncludedServices"},
|
||||
FunctionInfo{30, nullptr, "GetBelongingGattService"},
|
||||
FunctionInfo{31, nullptr, "GetGattCharacteristics"},
|
||||
FunctionInfo{32, nullptr, "GetGattDescriptors"},
|
||||
FunctionInfo{33, C<&IBtmUserCore::AcquireBleMtuConfigEvent>, "AcquireBleMtuConfigEvent"},
|
||||
FunctionInfo{34, nullptr, "ConfigureBleMtu"},
|
||||
FunctionInfo{35, nullptr, "GetBleMtu"},
|
||||
FunctionInfo{36, nullptr, "RegisterBleGattDataPath"},
|
||||
FunctionInfo{37, nullptr, "UnregisterBleGattDataPath"}
|
||||
);
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* scan_event;
|
||||
Kernel::KEvent* connection_event;
|
||||
Kernel::KEvent* service_discovery_event;
|
||||
Kernel::KEvent* config_event;
|
||||
};
|
||||
|
||||
class IBtmUser final : public ServiceFramework<IBtmUser> {
|
||||
public:
|
||||
explicit IBtmUser(Core::System& system_) : ServiceFramework{system_, "btm:u"} {}
|
||||
~IBtmUser() override = default;
|
||||
|
||||
Result GetCore(OutInterface<IBtmUserCore> out_interface) {
|
||||
LOG_WARNING(Service_BTM, "called");
|
||||
|
||||
*out_interface = std::make_shared<IBtmUserCore>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmUser::GetCore>, "GetCore"}
|
||||
);
|
||||
};
|
||||
|
||||
class IBtmDebug final : public ServiceFramework<IBtmDebug> {
|
||||
public:
|
||||
explicit IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} {}
|
||||
~IBtmDebug() override = default;
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "AcquireDiscoveryEvent"},
|
||||
FunctionInfo{1, nullptr, "StartDiscovery"},
|
||||
FunctionInfo{2, nullptr, "CancelDiscovery"},
|
||||
FunctionInfo{3, nullptr, "GetDeviceProperty"},
|
||||
FunctionInfo{4, nullptr, "CreateBond"},
|
||||
FunctionInfo{5, nullptr, "CancelBond"},
|
||||
FunctionInfo{6, nullptr, "SetTsiMode"},
|
||||
FunctionInfo{7, nullptr, "GeneralTest"},
|
||||
FunctionInfo{8, nullptr, "HidConnect"},
|
||||
FunctionInfo{9, nullptr, "GeneralGet"}, //5.0.0+
|
||||
FunctionInfo{10, nullptr, "GetGattClientDisconnectionReason"}, //5.0.0+
|
||||
FunctionInfo{11, nullptr, "GetBleConnectionParameter"}, //5.1.0+
|
||||
FunctionInfo{12, nullptr, "GetBleConnectionParameterRequest"}, //5.1.0+
|
||||
FunctionInfo{13, nullptr, "GetDiscoveredDevice"}, //12.0.0+
|
||||
FunctionInfo{14, nullptr, "SleepAwakeLoopTest"}, //15.0.0+
|
||||
FunctionInfo{15, nullptr, "SleepTest"}, //15.0.0+
|
||||
FunctionInfo{16, nullptr, "MinimumAwakeTest"}, //15.0.0+
|
||||
FunctionInfo{17, nullptr, "ForceEnableBtm"} //15.0.0+
|
||||
);
|
||||
};
|
||||
|
||||
class IBtm final : public ServiceFramework<IBtm> {
|
||||
public:
|
||||
explicit IBtm(Core::System& system_) : ServiceFramework{system_, "btm"} {}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "core/hle/service/btm/btm_debug.h"
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
IBtmDebug::IBtmDebug(Core::System& system_) : ServiceFramework{system_, "btm:dbg"} {
|
||||
}
|
||||
|
||||
IBtmDebug::~IBtmDebug() = default;
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,45 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
class IBtmDebug final : public ServiceFramework<IBtmDebug> {
|
||||
public:
|
||||
explicit IBtmDebug(Core::System& system_);
|
||||
~IBtmDebug() override;
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "AcquireDiscoveryEvent"},
|
||||
FunctionInfo{1, nullptr, "StartDiscovery"},
|
||||
FunctionInfo{2, nullptr, "CancelDiscovery"},
|
||||
FunctionInfo{3, nullptr, "GetDeviceProperty"},
|
||||
FunctionInfo{4, nullptr, "CreateBond"},
|
||||
FunctionInfo{5, nullptr, "CancelBond"},
|
||||
FunctionInfo{6, nullptr, "SetTsiMode"},
|
||||
FunctionInfo{7, nullptr, "GeneralTest"},
|
||||
FunctionInfo{8, nullptr, "HidConnect"},
|
||||
FunctionInfo{9, nullptr, "GeneralGet"}, //5.0.0+
|
||||
FunctionInfo{10, nullptr, "GetGattClientDisconnectionReason"}, //5.0.0+
|
||||
FunctionInfo{11, nullptr, "GetBleConnectionParameter"}, //5.1.0+
|
||||
FunctionInfo{12, nullptr, "GetBleConnectionParameterRequest"}, //5.1.0+
|
||||
FunctionInfo{13, nullptr, "GetDiscoveredDevice"}, //12.0.0+
|
||||
FunctionInfo{14, nullptr, "SleepAwakeLoopTest"}, //15.0.0+
|
||||
FunctionInfo{15, nullptr, "SleepTest"}, //15.0.0+
|
||||
FunctionInfo{16, nullptr, "MinimumAwakeTest"}, //15.0.0+
|
||||
FunctionInfo{17, nullptr, "ForceEnableBtm"}, //15.0.0+
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,27 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "common/logging.h"
|
||||
#include "core/hle/service/btm/btm_system.h"
|
||||
#include "core/hle/service/btm/btm_system_core.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
IBtmSystem::IBtmSystem(Core::System& system_) : ServiceFramework{system_, "btm:sys"} {
|
||||
}
|
||||
|
||||
IBtmSystem::~IBtmSystem() = default;
|
||||
|
||||
Result IBtmSystem::GetCore(OutInterface<IBtmSystemCore> out_interface) {
|
||||
LOG_WARNING(Service_BTM, "called");
|
||||
|
||||
*out_interface = std::make_shared<IBtmSystemCore>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,32 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::BTM {
|
||||
class IBtmSystemCore;
|
||||
|
||||
class IBtmSystem final : public ServiceFramework<IBtmSystem> {
|
||||
public:
|
||||
explicit IBtmSystem(Core::System& system_);
|
||||
~IBtmSystem() override;
|
||||
|
||||
private:
|
||||
Result GetCore(OutInterface<IBtmSystemCore> out_interface);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmSystem::GetCore>, "GetCore"}
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,102 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "common/logging.h"
|
||||
#include "core/hle/service/btm/btm_system_core.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
#include "core/hle/service/set/system_settings_server.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
IBtmSystemCore::IBtmSystemCore(Core::System& system_)
|
||||
: ServiceFramework{system_, "IBtmSystemCore"}, service_context{system_, "IBtmSystemCore"} {
|
||||
radio_event = service_context.CreateEvent("IBtmSystemCore::RadioEvent");
|
||||
audio_device_connection_event = service_context.CreateEvent("IBtmSystemCore::AudioDeviceConnectionEvent");
|
||||
m_set_sys = system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true);
|
||||
}
|
||||
|
||||
IBtmSystemCore::~IBtmSystemCore() {
|
||||
service_context.CloseEvent(radio_event);
|
||||
service_context.CloseEvent(audio_device_connection_event);
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::StartGamepadPairing() {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::CancelGamepadPairing() {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::EnableRadio() {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
R_RETURN(m_set_sys->SetBluetoothEnableFlag(true));
|
||||
}
|
||||
Result IBtmSystemCore::DisableRadio() {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
R_RETURN(m_set_sys->SetBluetoothEnableFlag(false));
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::IsRadioEnabled(Out<bool> out_is_enabled) {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
R_RETURN(m_set_sys->GetBluetoothEnableFlag(out_is_enabled));
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::AcquireRadioEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &radio_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::GetDiscoveredAudioDevice(OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out<s32> out_total) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::AcquireAudioDeviceConnectionEvent(
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_event = &audio_device_connection_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::GetConnectedAudioDevices(
|
||||
Out<s32> out_count, OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_count = 0;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::GetPairedAudioDevices(
|
||||
Out<s32> out_count, OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_count = 0;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmSystemCore::CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called, applet_resource_user_id={}", aruid.pid);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,90 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Kernel {
|
||||
class KEvent;
|
||||
class KReadableEvent;
|
||||
} // namespace Kernel
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::Set {
|
||||
class ISystemSettingsServer;
|
||||
}
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
class IBtmSystemCore final : public ServiceFramework<IBtmSystemCore> {
|
||||
public:
|
||||
explicit IBtmSystemCore(Core::System& system_);
|
||||
~IBtmSystemCore() override;
|
||||
|
||||
private:
|
||||
Result StartGamepadPairing();
|
||||
Result CancelGamepadPairing();
|
||||
Result EnableRadio();
|
||||
Result DisableRadio();
|
||||
Result IsRadioEnabled(Out<bool> out_is_enabled);
|
||||
|
||||
Result AcquireRadioEvent(Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result GetDiscoveredAudioDevice(OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices, s32 count, Out<s32> out_total);
|
||||
Result AcquireAudioDeviceConnectionEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
|
||||
Result GetConnectedAudioDevices(
|
||||
Out<s32> out_count,
|
||||
OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices);
|
||||
|
||||
Result GetPairedAudioDevices(
|
||||
Out<s32> out_count,
|
||||
OutArray<std::array<u8, 0xFF>, BufferAttr_HipcPointer> out_audio_devices);
|
||||
|
||||
Result RequestAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid);
|
||||
Result CancelAudioDeviceConnectionRejection(ClientAppletResourceUserId aruid);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmSystemCore::StartGamepadPairing>, "StartGamepadPairing"},
|
||||
FunctionInfo{1, C<&IBtmSystemCore::CancelGamepadPairing>, "CancelGamepadPairing"},
|
||||
FunctionInfo{2, nullptr, "ClearGamepadPairingDatabase"},
|
||||
FunctionInfo{3, nullptr, "GetPairedGamepadCount"},
|
||||
FunctionInfo{4, C<&IBtmSystemCore::EnableRadio>, "EnableRadio"},
|
||||
FunctionInfo{5, C<&IBtmSystemCore::DisableRadio>, "DisableRadio"},
|
||||
FunctionInfo{6, C<&IBtmSystemCore::IsRadioEnabled>, "IsRadioEnabled"},
|
||||
FunctionInfo{7, C<&IBtmSystemCore::AcquireRadioEvent>, "AcquireRadioEvent"},
|
||||
FunctionInfo{8, nullptr, "AcquireGamepadPairingEvent"},
|
||||
FunctionInfo{9, nullptr, "IsGamepadPairingStarted"},
|
||||
FunctionInfo{10, nullptr, "StartAudioDeviceDiscovery"},
|
||||
FunctionInfo{11, nullptr, "StopAudioDeviceDiscovery"},
|
||||
FunctionInfo{12, nullptr, "IsDiscoveryingAudioDevice"},
|
||||
FunctionInfo{13, C<&IBtmSystemCore::GetDiscoveredAudioDevice>, "GetDiscoveredAudioDevice"},
|
||||
FunctionInfo{14, C<&IBtmSystemCore::AcquireAudioDeviceConnectionEvent>, "AcquireAudioDeviceConnectionEvent"},
|
||||
FunctionInfo{15, nullptr, "ConnectAudioDevice"},
|
||||
FunctionInfo{16, nullptr, "IsConnectingAudioDevice"},
|
||||
FunctionInfo{17, C<&IBtmSystemCore::GetConnectedAudioDevices>, "GetConnectedAudioDevices"},
|
||||
FunctionInfo{18, nullptr, "DisconnectAudioDevice"},
|
||||
FunctionInfo{19, nullptr, "AcquirePairedAudioDeviceInfoChangedEvent"},
|
||||
FunctionInfo{20, C<&IBtmSystemCore::GetPairedAudioDevices>, "GetPairedAudioDevices"},
|
||||
FunctionInfo{21, nullptr, "RemoveAudioDevicePairing"},
|
||||
FunctionInfo{22, C<&IBtmSystemCore::RequestAudioDeviceConnectionRejection>, "RequestAudioDeviceConnectionRejection"},
|
||||
FunctionInfo{23, C<&IBtmSystemCore::CancelAudioDeviceConnectionRejection>, "CancelAudioDeviceConnectionRejection"}
|
||||
);
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* radio_event;
|
||||
Kernel::KEvent* audio_device_connection_event;
|
||||
std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys;
|
||||
};
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,26 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "common/logging.h"
|
||||
#include "core/hle/service/btm/btm_user.h"
|
||||
#include "core/hle/service/btm/btm_user_core.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
IBtmUser::IBtmUser(Core::System& system_) : ServiceFramework{system_, "btm:u"} {
|
||||
}
|
||||
|
||||
IBtmUser::~IBtmUser() = default;
|
||||
|
||||
Result IBtmUser::GetCore(OutInterface<IBtmUserCore> out_interface) {
|
||||
LOG_WARNING(Service_BTM, "called");
|
||||
|
||||
*out_interface = std::make_shared<IBtmUserCore>(system);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,32 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::BTM {
|
||||
class IBtmUserCore;
|
||||
|
||||
class IBtmUser final : public ServiceFramework<IBtmUser> {
|
||||
public:
|
||||
explicit IBtmUser(Core::System& system_);
|
||||
~IBtmUser() override;
|
||||
|
||||
private:
|
||||
Result GetCore(OutInterface<IBtmUserCore> out_interface);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmUser::GetCore>, "GetCore"}
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,68 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/logging.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/btm/btm_user_core.h"
|
||||
#include "core/hle/service/cmif_serialization.h"
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
IBtmUserCore::IBtmUserCore(Core::System& system_)
|
||||
: ServiceFramework{system_, "IBtmUserCore"}, service_context{system_, "IBtmUserCore"} {
|
||||
scan_event = service_context.CreateEvent("IBtmUserCore:ScanEvent");
|
||||
connection_event = service_context.CreateEvent("IBtmUserCore:ConnectionEvent");
|
||||
service_discovery_event = service_context.CreateEvent("IBtmUserCore:DiscoveryEvent");
|
||||
config_event = service_context.CreateEvent("IBtmUserCore:ConfigEvent");
|
||||
}
|
||||
|
||||
IBtmUserCore::~IBtmUserCore() {
|
||||
service_context.CloseEvent(scan_event);
|
||||
service_context.CloseEvent(connection_event);
|
||||
service_context.CloseEvent(service_discovery_event);
|
||||
service_context.CloseEvent(config_event);
|
||||
}
|
||||
|
||||
Result IBtmUserCore::AcquireBleScanEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &scan_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmUserCore::AcquireBleConnectionEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &connection_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmUserCore::AcquireBleServiceDiscoveryEvent(
|
||||
Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &service_discovery_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result IBtmUserCore::AcquireBleMtuConfigEvent(Out<bool> out_is_valid,
|
||||
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
*out_is_valid = true;
|
||||
*out_event = &config_event->GetReadableEvent();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -1,76 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/cmif_types.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Kernel {
|
||||
class KEvent;
|
||||
class KReadableEvent;
|
||||
} // namespace Kernel
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::BTM {
|
||||
|
||||
class IBtmUserCore final : public ServiceFramework<IBtmUserCore> {
|
||||
public:
|
||||
explicit IBtmUserCore(Core::System& system_);
|
||||
~IBtmUserCore() override;
|
||||
|
||||
private:
|
||||
Result AcquireBleScanEvent(Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result AcquireBleConnectionEvent(Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result AcquireBleServiceDiscoveryEvent(Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
Result AcquireBleMtuConfigEvent(Out<bool> out_is_valid, OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||
|
||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, C<&IBtmUserCore::AcquireBleScanEvent>, "AcquireBleScanEvent"},
|
||||
FunctionInfo{1, nullptr, "GetBleScanFilterParameter"},
|
||||
FunctionInfo{2, nullptr, "GetBleScanFilterParameter2"},
|
||||
FunctionInfo{3, nullptr, "StartBleScanForGeneral"},
|
||||
FunctionInfo{4, nullptr, "StopBleScanForGeneral"},
|
||||
FunctionInfo{5, nullptr, "GetBleScanResultsForGeneral"},
|
||||
FunctionInfo{6, nullptr, "StartBleScanForPaired"},
|
||||
FunctionInfo{7, nullptr, "StopBleScanForPaired"},
|
||||
FunctionInfo{8, nullptr, "StartBleScanForSmartDevice"},
|
||||
FunctionInfo{9, nullptr, "StopBleScanForSmartDevice"},
|
||||
FunctionInfo{10, nullptr, "GetBleScanResultsForSmartDevice"},
|
||||
FunctionInfo{17, C<&IBtmUserCore::AcquireBleConnectionEvent>, "AcquireBleConnectionEvent"},
|
||||
FunctionInfo{18, nullptr, "BleConnect"},
|
||||
FunctionInfo{19, nullptr, "BleDisconnect"},
|
||||
FunctionInfo{20, nullptr, "BleGetConnectionState"},
|
||||
FunctionInfo{21, nullptr, "AcquireBlePairingEvent"},
|
||||
FunctionInfo{22, nullptr, "BlePairDevice"},
|
||||
FunctionInfo{23, nullptr, "BleUnPairDevice"},
|
||||
FunctionInfo{24, nullptr, "BleUnPairDevice2"},
|
||||
FunctionInfo{25, nullptr, "BleGetPairedDevices"},
|
||||
FunctionInfo{26, C<&IBtmUserCore::AcquireBleServiceDiscoveryEvent>, "AcquireBleServiceDiscoveryEvent"},
|
||||
FunctionInfo{27, nullptr, "GetGattServices"},
|
||||
FunctionInfo{28, nullptr, "GetGattService"},
|
||||
FunctionInfo{29, nullptr, "GetGattIncludedServices"},
|
||||
FunctionInfo{30, nullptr, "GetBelongingGattService"},
|
||||
FunctionInfo{31, nullptr, "GetGattCharacteristics"},
|
||||
FunctionInfo{32, nullptr, "GetGattDescriptors"},
|
||||
FunctionInfo{33, C<&IBtmUserCore::AcquireBleMtuConfigEvent>, "AcquireBleMtuConfigEvent"},
|
||||
FunctionInfo{34, nullptr, "ConfigureBleMtu"},
|
||||
FunctionInfo{35, nullptr, "GetBleMtu"},
|
||||
FunctionInfo{36, nullptr, "RegisterBleGattDataPath"},
|
||||
FunctionInfo{37, nullptr, "UnregisterBleGattDataPath"}
|
||||
);
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
Kernel::KEvent* scan_event;
|
||||
Kernel::KEvent* connection_event;
|
||||
Kernel::KEvent* service_discovery_event;
|
||||
Kernel::KEvent* config_event;
|
||||
};
|
||||
|
||||
} // namespace Service::BTM
|
||||
@@ -13,6 +13,52 @@
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
ServiceFrameworkBase::FunctionInfoBase const* IAlbumAccessorService::FindRequest(u32 key) {
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "GetAlbumFileCount"},
|
||||
FunctionInfo{1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"},
|
||||
FunctionInfo{2, nullptr, "LoadAlbumFile"},
|
||||
FunctionInfo{3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"},
|
||||
FunctionInfo{4, nullptr, "StorageCopyAlbumFile"},
|
||||
FunctionInfo{5, C<&IAlbumAccessorService::IsAlbumMounted>, "IsAlbumMounted"},
|
||||
FunctionInfo{6, nullptr, "GetAlbumUsage"},
|
||||
FunctionInfo{7, nullptr, "GetAlbumFileSize"},
|
||||
FunctionInfo{8, nullptr, "LoadAlbumFileThumbnail"},
|
||||
FunctionInfo{9, nullptr, "LoadAlbumScreenShotImage"},
|
||||
FunctionInfo{10, nullptr, "LoadAlbumScreenShotThumbnailImage"},
|
||||
FunctionInfo{11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"},
|
||||
FunctionInfo{12, nullptr, "LoadAlbumScreenShotImageEx"},
|
||||
FunctionInfo{13, nullptr, "LoadAlbumScreenShotThumbnailImageEx"},
|
||||
FunctionInfo{14, nullptr, "LoadAlbumScreenShotImageEx0"},
|
||||
FunctionInfo{15, nullptr, "GetAlbumUsage3"},
|
||||
FunctionInfo{16, nullptr, "GetAlbumMountResult"},
|
||||
FunctionInfo{17, nullptr, "GetAlbumUsage16"},
|
||||
FunctionInfo{18, C<&IAlbumAccessorService::Unknown18>, "Unknown18"},
|
||||
FunctionInfo{19, nullptr, "Unknown19"},
|
||||
FunctionInfo{100, nullptr, "GetAlbumFileCountEx0"},
|
||||
FunctionInfo{101, C<&IAlbumAccessorService::GetAlbumFileListEx0>, "GetAlbumFileListEx0"},
|
||||
FunctionInfo{202, nullptr, "SaveEditedScreenShot"},
|
||||
FunctionInfo{301, nullptr, "GetLastThumbnail"},
|
||||
FunctionInfo{302, nullptr, "GetLastOverlayMovieThumbnail"},
|
||||
FunctionInfo{401, C<&IAlbumAccessorService::GetAutoSavingStorage>, "GetAutoSavingStorage"},
|
||||
FunctionInfo{501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"},
|
||||
FunctionInfo{1001, nullptr, "LoadAlbumScreenShotThumbnailImageEx0"},
|
||||
FunctionInfo{1002, C<&IAlbumAccessorService::LoadAlbumScreenShotImageEx1>, "LoadAlbumScreenShotImageEx1"},
|
||||
FunctionInfo{1003, C<&IAlbumAccessorService::LoadAlbumScreenShotThumbnailImageEx1>, "LoadAlbumScreenShotThumbnailImageEx1"},
|
||||
FunctionInfo{8001, nullptr, "ForceAlbumUnmounted"},
|
||||
FunctionInfo{8002, nullptr, "ResetAlbumMountStatus"},
|
||||
FunctionInfo{8011, nullptr, "RefreshAlbumCache"},
|
||||
FunctionInfo{8012, nullptr, "GetAlbumCache"},
|
||||
FunctionInfo{8013, nullptr, "GetAlbumCacheEx"},
|
||||
FunctionInfo{8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"},
|
||||
FunctionInfo{10011, nullptr, "SetInternalErrorConversionEnabled"},
|
||||
FunctionInfo{50000, nullptr, "LoadMakerNoteInfoForDebug"},
|
||||
FunctionInfo{50011, C<&IAlbumAccessorService::GetAlbumAccessResultForDebug>, "GetAlbumAccessResultForDebug"},
|
||||
FunctionInfo{60002, nullptr, "OpenAccessorSession"}
|
||||
);
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
|
||||
IAlbumAccessorService::IAlbumAccessorService(Core::System& system_,
|
||||
std::shared_ptr<AlbumManager> album_manager)
|
||||
: ServiceFramework{system_, "caps:a"}, manager{album_manager} {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user