From aeb9254da7bc5af7e92ede2c2c963672c5c3a6c3 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 26 Jan 2023 13:16:47 +0100 Subject: [PATCH] Block screenshots for some games that cause issues --- src/function_patcher.cpp | 2 +- src/retain_vars.cpp | 3 ++- src/retain_vars.hpp | 3 ++- src/utils/utils.cpp | 15 ++++++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/function_patcher.cpp b/src/function_patcher.cpp index 1e11a9b..764f6c7 100644 --- a/src/function_patcher.cpp +++ b/src/function_patcher.cpp @@ -30,7 +30,7 @@ void NotAvailableCallback(NotificationModuleHandle handle, void *context) { void RequestScreenshot() { NotificationModuleStatus err; - if (!OSIsHomeButtonMenuEnabled()) { + if (gBlockScreenshots || !OSIsHomeButtonMenuEnabled()) { if (!gNotAvailableNotificationDisplayed) { if ((err = NotificationModule_AddErrorNotificationWithCallback("Screenshots not available at the moment.", NotAvailableCallback, diff --git a/src/retain_vars.cpp b/src/retain_vars.cpp index 3cb0750..1e9bdc3 100644 --- a/src/retain_vars.cpp +++ b/src/retain_vars.cpp @@ -23,4 +23,5 @@ NMColor COLOR_RED = {237, 28, 36, 255}; int32_t gThreadPriorityIncrease = 1; -bool gBlockDRCScreenshots = false; \ No newline at end of file +bool gBlockDRCScreenshots = false; +bool gBlockScreenshots = false; diff --git a/src/retain_vars.hpp b/src/retain_vars.hpp index b4a2eb5..e3d55d4 100644 --- a/src/retain_vars.hpp +++ b/src/retain_vars.hpp @@ -26,4 +26,5 @@ extern NMColor COLOR_RED; extern int32_t gThreadPriorityIncrease; -extern bool gBlockDRCScreenshots; \ No newline at end of file +extern bool gBlockDRCScreenshots; +extern bool gBlockScreenshots; diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index 934d72f..36c29b5 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -97,4 +97,17 @@ void ApplyGameSpecificPatches() { } else { gThreadPriorityIncrease = 1; } -} \ No newline at end of file + + // Some titles will softlock when trying to take screenshots, let's block them for now. + if (titleID == 0x0005000010110100L || // NANO ASSAULT NEO USA + titleID == 0x0005000010110600L || // NANO ASSAULT NEO EUR + titleID == 0x0005000010136400L || // NANO ASSAULT NEO JPN + titleID == 0x000500001010FA00L || // The Cave USA + titleID == 0x000500001012B500L || // The Cave EUR + titleID == 0x0005000010135600L // The Cave JPN + ) { + gBlockScreenshots = true; + } else { + gBlockScreenshots = false; + } +}