libctru  v2.3.1
app_launch/source/main.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <3ds.h>
int main()
{
printf("APT chainload example\n");
printf("Press A to chainload to EUR camera app\n");
printf("Press START to exit\n");
while (aptMainLoop())
{
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
break;
if (kDown & KEY_A) // If the A button got pressed, start the app launch
{
aptSetChainloader(0x0004001000022400LL, 0); // *EUR* camera app title ID
break;
}
}
return 0;
}
Central 3DS header.
bool aptMainLoop(void)
Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every f...
void aptSetChainloader(u64 programID, u8 mediatype)
Configures the chainloader to launch a specific application.
PrintConsole * consoleInit(gfxScreen_t screen, PrintConsole *console)
Initialise the console.
void gfxSwapBuffers(void)
Updates the configuration of both screens.
void gfxInitDefault(void)
Initializes the LCD framebuffers with default parameters This is equivalent to calling:
@ GFX_TOP
Top screen.
Definition: gfx.h:26
void gfxExit(void)
Deinitializes and frees the LCD framebuffers.
#define gspWaitForVBlank()
Waits for VBlank.
Definition: gspgpu.h:151
@ KEY_START
Start.
Definition: hid.h:15
@ KEY_A
A.
Definition: hid.h:12
u32 hidKeysDown(void)
Returns a bitmask of newly pressed buttons, this frame.
void hidScanInput(void)
Scans HID for input data.
uint32_t u32
32-bit unsigned integer
Definition: types.h:23