Simplified reading the system language by adding a wrapper. Print only once in the get_system_language example.
This commit is contained in:
parent
5524e700b4
commit
bb5c4a6ca8
@ -17,9 +17,11 @@ int main(int argc, char** argv)
|
|||||||
consoleInit(GFX_BOTTOM, NULL);
|
consoleInit(GFX_BOTTOM, NULL);
|
||||||
|
|
||||||
// Read the language field from the config savegame.
|
// Read the language field from the config savegame.
|
||||||
// See here for more block IDs:
|
res = CFGU_GetSystemLanguage(&language);
|
||||||
// http://3dbrew.org/wiki/Config_Savegame#Configuration_blocks
|
|
||||||
res = CFGU_GetConfigInfoBlk2(1, 0xA0002, &language);
|
// Print return value and language code
|
||||||
|
printf(" Result: 0x%x\n", (int)res);
|
||||||
|
printf("Language code: %d", (int)language);
|
||||||
|
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
@ -27,10 +29,6 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
hidScanInput();
|
hidScanInput();
|
||||||
|
|
||||||
// Print return value and language code
|
|
||||||
printf("\x1b[0;0Hresult: 0x%x", (int)res);
|
|
||||||
printf("\x1b[1;0HLanguage code: %d", (int)language);
|
|
||||||
|
|
||||||
u32 kDown = hidKeysDown();
|
u32 kDown = hidKeysDown();
|
||||||
if (kDown & KEY_START)
|
if (kDown & KEY_START)
|
||||||
break; // break in order to return to hbmenu
|
break; // break in order to return to hbmenu
|
||||||
|
@ -9,3 +9,4 @@ Result CFGU_GetModelNintendo2DS(u8* value);
|
|||||||
Result CFGU_GetCountryCodeString(u16 code, u16* string);
|
Result CFGU_GetCountryCodeString(u16 code, u16* string);
|
||||||
Result CFGU_GetCountryCodeID(u16 string, u16* code);
|
Result CFGU_GetCountryCodeID(u16 string, u16* code);
|
||||||
Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData);
|
Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData);
|
||||||
|
Result CFGU_GetSystemLanguage(u8* language);
|
||||||
|
@ -91,6 +91,8 @@ Result CFGU_GetCountryCodeID(u16 string, u16* code)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See here for block IDs:
|
||||||
|
// http://3dbrew.org/wiki/Config_Savegame#Configuration_blocks
|
||||||
Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData)
|
Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
@ -106,3 +108,8 @@ Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData)
|
|||||||
|
|
||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result CFGU_GetSystemLanguage(u8* language)
|
||||||
|
{
|
||||||
|
return CFGU_GetConfigInfoBlk2(1, 0xA0002, language);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user