From 2cdfc7640cee54dd3090b22e14c26e318144cf29 Mon Sep 17 00:00:00 2001 From: Dima Date: Sat, 12 Nov 2022 13:17:07 +0300 Subject: [PATCH] Stub GetPreviousProgramIndex --- .../services/am/controller/IApplicationFunctions.cpp | 5 +++++ .../services/am/controller/IApplicationFunctions.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp index c7417a95..5c66bf85 100644 --- a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp +++ b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.cpp @@ -146,6 +146,11 @@ namespace skyline::service::am { return {}; } + Result IApplicationFunctions::GetPreviousProgramIndex(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(previousProgramIndex); + return {}; + } + Result IApplicationFunctions::GetGpuErrorDetectedSystemEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { auto handle{state.process->InsertItem(gpuErrorEvent)}; Logger::Debug("GPU Error Event Handle: 0x{:X}", handle); diff --git a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h index 5859349e..55cc068e 100644 --- a/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h +++ b/app/src/main/cpp/skyline/services/am/controller/IApplicationFunctions.h @@ -21,6 +21,7 @@ namespace skyline::service::am { private: std::shared_ptr gpuErrorEvent; //!< The event signalled on GPU errors std::shared_ptr friendInvitationStorageChannelEvent; //!< The event signalled on friend invitations + i32 previousProgramIndex{-1}; //!< There was no previous title public: IApplicationFunctions(const DeviceState &state, ServiceManager &manager); @@ -96,6 +97,12 @@ namespace skyline::service::am { */ Result SetApplicationCopyrightVisibility(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Gets the ProgramIndex of the Application which launched this title + * @url https://switchbrew.org/wiki/Applet_Manager_services#GetPreviousProgramIndex + */ + Result GetPreviousProgramIndex(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Obtains a handle to the system GPU error KEvent * @url https://switchbrew.org/wiki/Applet_Manager_services#GetGpuErrorDetectedSystemEvent @@ -122,6 +129,7 @@ namespace skyline::service::am { SFUNC(0x64, IApplicationFunctions, InitializeApplicationCopyrightFrameBuffer), SFUNC(0x65, IApplicationFunctions, SetApplicationCopyrightImage), SFUNC(0x66, IApplicationFunctions, SetApplicationCopyrightVisibility), + SFUNC(0x7B, IApplicationFunctions, GetPreviousProgramIndex), SFUNC(0x82, IApplicationFunctions, GetGpuErrorDetectedSystemEvent), SFUNC(0x8C, IApplicationFunctions, GetFriendInvitationStorageChannelEvent), SFUNC(0x8D, IApplicationFunctions, TryPopFromFriendInvitationStorageChannel)