2014-11-27 04:12:20 +01:00
|
|
|
#include <3ds.h>
|
2015-07-07 23:46:08 +02:00
|
|
|
#include <stdio.h>
|
2014-11-27 04:12:20 +01:00
|
|
|
|
2015-07-07 23:46:08 +02:00
|
|
|
static bool allowed = false;
|
|
|
|
|
|
|
|
// If you define this function, you can monitor/debug APT events
|
|
|
|
void _aptDebug(int a, int b)
|
2014-11-27 04:12:20 +01:00
|
|
|
{
|
2015-07-07 23:46:08 +02:00
|
|
|
if (allowed)
|
|
|
|
printf("_aptDebug(%d,%x)\n", a, b);
|
|
|
|
}
|
2014-11-27 04:12:20 +01:00
|
|
|
|
2015-07-07 23:46:08 +02:00
|
|
|
int main()
|
|
|
|
{
|
2015-01-03 01:06:22 +01:00
|
|
|
gfxInitDefault();
|
2015-07-07 23:46:08 +02:00
|
|
|
consoleInit(GFX_TOP, NULL);
|
|
|
|
allowed = true;
|
2014-11-27 04:12:20 +01:00
|
|
|
|
2015-07-07 23:46:08 +02:00
|
|
|
printf("Press B to launch applet\n");
|
2014-11-27 04:12:20 +01:00
|
|
|
|
|
|
|
// Main loop
|
|
|
|
while (aptMainLoop())
|
|
|
|
{
|
|
|
|
gspWaitForVBlank();
|
2015-07-07 23:46:08 +02:00
|
|
|
gfxSwapBuffers();
|
2014-11-27 04:12:20 +01:00
|
|
|
hidScanInput();
|
|
|
|
|
|
|
|
u32 kDown = hidKeysDown();
|
|
|
|
if (kDown & KEY_START)
|
|
|
|
break; // break in order to return to hbmenu
|
|
|
|
|
|
|
|
gfxFlushBuffers();
|
2015-07-07 23:46:08 +02:00
|
|
|
|
|
|
|
// Launch the extrapad library applet when button B is pressed.
|
|
|
|
if (kDown & KEY_B)
|
|
|
|
{
|
|
|
|
Result rc = APT_LaunchLibraryApplet(APPID_EXTRAPAD, 0, NULL, 0);
|
|
|
|
if (rc) printf("APT_LaunchLibraryApplet: %08lX\n", rc);
|
|
|
|
}
|
2014-11-27 04:12:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Exit services
|
|
|
|
gfxExit();
|
|
|
|
return 0;
|
|
|
|
}
|