2014-11-10 17:34:11 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <3ds.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2015-01-03 01:06:22 +01:00
|
|
|
gfxInitDefault(); // Init graphic stuff
|
2014-11-10 17:34:11 +01:00
|
|
|
|
|
|
|
|
2014-11-20 14:58:24 +01:00
|
|
|
// We need these 2 buffers for APT_DoAppJump() later. They can be smaller too
|
2014-11-10 17:34:11 +01:00
|
|
|
u8 buf0[0x300];
|
|
|
|
u8 buf1[0x20];
|
|
|
|
|
|
|
|
|
2014-11-20 14:58:24 +01:00
|
|
|
// Loop as long as the status is not exit
|
2014-11-10 17:34:11 +01:00
|
|
|
while(aptMainLoop())
|
|
|
|
{
|
2014-11-20 14:58:24 +01:00
|
|
|
// Scan hid shared memory for input events
|
2014-11-10 17:34:11 +01:00
|
|
|
hidScanInput();
|
|
|
|
|
2014-11-20 14:58:24 +01:00
|
|
|
if(hidKeysDown() & KEY_A) // If the A button got pressed, start the app launch
|
2014-11-10 17:34:11 +01:00
|
|
|
{
|
2014-11-20 14:58:24 +01:00
|
|
|
// Clear both buffers
|
2014-11-10 17:34:11 +01:00
|
|
|
memset(buf0, 0, 0x300);
|
|
|
|
memset(buf1, 0, 0x20);
|
|
|
|
|
2014-11-20 14:58:24 +01:00
|
|
|
// Open an APT session so we can talk to the APT service
|
2014-11-10 17:34:11 +01:00
|
|
|
aptOpenSession();
|
2014-11-20 14:58:24 +01:00
|
|
|
// Prepare for the app launch
|
|
|
|
APT_PrepareToDoAppJump(NULL, 0, 0x0004001000022400LL, 0); // *EUR* camera app title ID
|
|
|
|
// Tell APT to trigger the app launch and set the status of this app to exit
|
|
|
|
APT_DoAppJump(NULL, 0x300 /* size of buf0 */, 0x20 /* size of buf1 */, buf0, buf1);
|
|
|
|
// Close the APT session because we don't need APT anymore
|
2014-11-10 17:34:11 +01:00
|
|
|
aptCloseSession();
|
|
|
|
}
|
|
|
|
|
2014-11-20 14:58:24 +01:00
|
|
|
// Flush + swap framebuffers and wait for VBlank. Not really needed in this example
|
2014-11-10 17:34:11 +01:00
|
|
|
gfxFlushBuffers();
|
|
|
|
gfxSwapBuffers();
|
|
|
|
gspWaitForVBlank();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gfxExit();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|