From de15ac956640b6c494da7e3ed3c47efc77cd0406 Mon Sep 17 00:00:00 2001 From: fangrong Date: Tue, 29 Oct 2024 13:57:24 +0800 Subject: [PATCH] apt: Added aptClearHomePressRejected func --- libctru/include/3ds/services/apt.h | 3 +++ libctru/source/services/apt.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/libctru/include/3ds/services/apt.h b/libctru/include/3ds/services/apt.h index 4e9de7e..9af2eb7 100644 --- a/libctru/include/3ds/services/apt.h +++ b/libctru/include/3ds/services/apt.h @@ -175,6 +175,9 @@ bool aptShouldJumpToHome(void); /// Returns true if there is an incoming HOME button press rejected by the policy set by \ref aptSetHomeAllowed (use this to show a "no HOME allowed" icon). bool aptCheckHomePressRejected(void); +/// Clear the incoming HOME button press rejected flag. +void aptClearHomePressRejected(void); + /// \deprecated Alias for \ref aptCheckHomePressRejected. static inline CTR_DEPRECATED bool aptIsHomePressed(void) { diff --git a/libctru/source/services/apt.c b/libctru/source/services/apt.c index 93743de..42e2daf 100644 --- a/libctru/source/services/apt.c +++ b/libctru/source/services/apt.c @@ -308,6 +308,12 @@ bool aptCheckHomePressRejected(void) return false; } +void aptClearHomePressRejected(void) +{ + if (aptFlags & FLAG_HOMEREJECTED) + aptFlags &= ~FLAG_HOMEREJECTED; +} + static void aptClearJumpToHome(void) { aptHomeButtonState = 0;