From 17f1036ca4d005c6b4f9c159349bddee30856748 Mon Sep 17 00:00:00 2001 From: Michael Theall Date: Wed, 10 Aug 2016 23:08:08 -0500 Subject: [PATCH] Only Home button can exit cia --- source/main.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/source/main.c b/source/main.c index 46c76ea..2b5e7ce 100644 --- a/source/main.c +++ b/source/main.c @@ -35,6 +35,7 @@ loop(loop_status_t (*callback)(void)) #endif } +#ifdef _3DS /*! wait until the B button is pressed * * @returns loop status @@ -42,7 +43,6 @@ loop(loop_status_t (*callback)(void)) static loop_status_t wait_for_b(void) { -#ifdef _3DS /* update button state */ hidScanInput(); @@ -52,10 +52,8 @@ wait_for_b(void) /* B was not pressed */ return LOOP_CONTINUE; -#else - return LOOP_EXIT; -#endif } +#endif /*! entry point * @@ -97,10 +95,22 @@ main(int argc, status = LOOP_EXIT; } - console_print("Press B to exit\n"); - loop(wait_for_b); - #ifdef _3DS + u64 id; + APT_GetProgramID(&id); + + if(id != 0x000400000BEEF500) + { + console_print("Press B to exit\n"); + loop(wait_for_b); + } + else + { + console_print("Press the Home Button to exit\n"); + while(aptMainLoop()) + console_render(); + } + /* deinitialize 3DS services */ gfxExit(); acExit();