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