Last active
November 3, 2020 08:42
-
-
Save oreo639/ac02969bc5071c3df8a457c169c40095 to your computer and use it in GitHub Desktop.
Example code for home menu blocking. (Outdated)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <3ds.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
gfxInitDefault(); | |
consoleInit(GFX_TOP, NULL); | |
printf("Home button blocking demo.\n"); | |
printf("Press A to block/unblock the home button.\n"); | |
printf("Press START to exit.\n"); | |
while (aptMainLoop()) | |
{ | |
hidScanInput(); | |
u32 kDown = hidKeysDown(); | |
if (kDown & KEY_START) | |
break; | |
if (kDown & KEY_A) | |
{ | |
aptSetHomeAllowed(!aptIsHomeAllowed()); | |
printf("Home button is now %s.\n", aptIsHomeAllowed() ? "unblocked" : "blocked"); | |
} | |
if (aptHomeIsPressed()) | |
printf("Home Button was pressed.\n"); | |
// Flush and swap framebuffers | |
gfxFlushBuffers(); | |
gfxSwapBuffers(); | |
gspWaitForVBlank(); | |
} | |
gfxExit(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment