From 4084408562b22f0e43bbe3cb9ffdb98b39fe13eb Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Sat, 2 Sep 2017 23:07:47 -0400 Subject: [PATCH] Fix arm11 dabort when switching apps through home menu, START no longer reboots in some cases --- source/main.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/source/main.c b/source/main.c index 4b4eba7..99fdc20 100644 --- a/source/main.c +++ b/source/main.c @@ -35,7 +35,19 @@ int init_services(void) cfguInit(); ptmuInit(); open_archives(); - return 0; + bool homebrew = true; + if (!envIsHomebrew()) + { + homebrew = false; + } else { + s64 out; + svcGetSystemInfo(&out, 0x10000, 0); + if (out) + { + homebrew = false; + } + } + return homebrew; } int exit_services(void) @@ -48,7 +60,7 @@ int exit_services(void) int main(void) { - init_services(); + bool homebrew = init_services(); init_screens(); int theme_count = 0; @@ -87,7 +99,11 @@ int main(void) if (kDown & KEY_START) { - APT_HardwareResetAsync(); + if (homebrew) + APT_HardwareResetAsync(); + else { + srvPublishToSubscriber(0x202, 0); + } } else if (kDown & KEY_L) { @@ -235,4 +251,8 @@ int main(void) previously_selected = selected_theme; } } + exit_screens(); + exit_services(); + + return 0; }