#include <cafe/sci.h>

typedef struct _SCICafeAreaInfo
    char    name[SCI_CAFE_AREA_NAME_SIZE_MAX];
    u16     latitude; // 0x0000-0x4000 are assigned to 0-90 degrees north latitude.
                      // 0xC000-0xFFFF are assigned to 90-0.005 degrees south latitude.
    u16     longitude; // 0x0000-0x7FFF are assigned to 0-179.995 degrees east longitude.
                       // 0x8000-0xFFFF are assigned to 180-0.005 degrees west longitude.
} SCICafeAreaInfo;

SCIStatus SCIGetAreaInfo(SCICafeAreaInfo *areaInfo, u32 simpleAddressId,
                         SCICafeLanguage type);


areaInfo Buffer to get SCICafeAreaInfo.
simpleAddressId The ID of simple address information. Its size is 32-bits. The country code is stored in the top 8 bits and the area code is stored in next 8 bits. The lower 16 bits are a reserved area. It can be obtained from the account library.
type Language type for string.

Return Values

SCI_STATUS_SUCCESS Successfully done.
SCI_STATUS_FAIL Failed to get string.
SCI_STATUS_INVALID_SIZE Invalid size of buffer.
SCI_STATUS_INVALID_PARAM Invalid input parameter.
SCI_STATUS_READ_ERROR Error reading database file.
SCI_STATUS_FILE_NOT_FOUND Database file is not found.
SCI_STATUS_ITEM_NOT_FOUND Item is not found in database.


Gets the area info as UTF-8 from the wiiu_country database.

The spec of area code ID is as follows.

Area code ID State Behavior
0 Area not selected Point at the top entry of Area information data (country information).
1 Area none (all countries) Point at the top entry of Area information data (country information).
2+ Each Area Point at the entry of each Area information data.

How to obtain the latitude and longitude of a country

Specify the upper 8 bits of simpleAddressId (32-bits) for Country Code ID; specify 0 or 1 for the next 8-bit Area Code ID. Fill the reserved area with 0 to obtain the latitude and longitude of the country.

Do Not Call From

Multiple threads This function is not thread-safe.

See Also


Revision History

2013/12/09 Added spec of area code ID.
2013/05/08 Automated cleanup pass.
2012/09/28 Initial version.