libctru/examples/get_system_language/source/main.c

47 lines
795 B
C
Raw Normal View History

#include <stdio.h>
#include <string.h>
#include <3ds.h>
int main(int argc, char** argv)
{
// Initialize services
2015-01-03 01:06:22 +01:00
gfxInitDefault();
2015-11-11 21:13:31 +01:00
cfguInit();
u8 language = 0;
2014-12-26 02:46:38 +01:00
Result res;
// Init console for text output
consoleInit(GFX_BOTTOM, NULL);
// Read the language field from the config savegame.
res = CFGU_GetSystemLanguage(&language);
// Print return value and language code
printf(" Result: 0x%x\n", (int)res);
printf("Language code: %d", (int)language);
// Main loop
while (aptMainLoop())
{
hidScanInput();
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
break; // break in order to return to hbmenu
// Flush and swap framebuffers
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
}
// Exit services
2015-11-11 21:13:31 +01:00
cfguExit();
gfxExit();
return 0;
}