Skip to content

Instantly share code, notes, and snippets.

@oreo639
Last active November 3, 2020 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oreo639/ac02969bc5071c3df8a457c169c40095 to your computer and use it in GitHub Desktop.
Save oreo639/ac02969bc5071c3df8a457c169c40095 to your computer and use it in GitHub Desktop.
Example code for home menu blocking. (Outdated)
#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