/*---------------------------------------------------------------------------* Project: Horizon File: cfg_UserInfo.h Copyright (C) 2009-2012 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 27772 $ *---------------------------------------------------------------------------*/ #ifndef NN_CFG_CTR_CFG_USER_INFO_H_ #define NN_CFG_CTR_CFG_USER_INFO_H_ #include #include #include namespace nn { namespace cfg { namespace CTR { /*---------------------------------------------------------------------------* * User Information *---------------------------------------------------------------------------*/ /*! @brief Specifies the maximum string length of the user name. (Including the terminator.) */ const u8 CFG_USER_NAME_LENGTH = 11; /*! @brief Stores the user name. User names obtained from the nn::cfg::CTR::GetUserName function are guaranteed to be NULL terminated. The isNgUserName member variable stores the result of checking the user name from System Settings. The name is checked in Japanese for the Japanese region, in U.S. English and the system language for the North American region, and in U.K. English and the system language for the European region. */ struct UserName { wchar_t userName[CFG_USER_NAME_LENGTH]; //!< The user name. bool isNgUserName; //!< Indicates whether the user name contains profanity. This has a value of true when the string contains profanity. NN_PADDING1; }; /*! @brief Stores a birthday. */ struct Birthday { s8 month; //!< Stores the birthday month (1-12). s8 day; //!< Stores the birthday day (1-31). }; /*---------------------------------------------------------------------------* * Simple Address Information *---------------------------------------------------------------------------*/ /*! @brief Specifies the country code storage location in a SimpleAddress ID. */ const u8 CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT = 24; /*! @brief Specifies the region code storage location in a SimpleAddress ID. */ const u8 CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT = 16; /*! @brief Specifies the country code mask for a SimpleAddress ID. */ const u32 CFG_SIMPLE_ADDRESS_ID_COUNTRY_MASK = 0xffU << CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT; /*! @brief Specifies the region code mask for a SimpleAddress ID. */ const u32 CFG_SIMPLE_ADDRESS_ID_REGION_MASK = 0xffU << CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; /*! @brief Specifies the reserved area mask for a SimpleAddress ID. */ const u32 CFG_SIMPLE_ADDRESS_ID_RESERVED_MASK = 0x0000ffff; /*! @brief Specifies an undefined ID for SimpleAddress. */ const u32 CFG_SIMPLE_ADDRESS_ID_NOT_DEFINED = 0xffffffff; /*! @brief Specifies an undefined country code for SimpleAddress. */ const u32 CFG_SIMPLE_ADDRESS_ID_COUNTRY_UNDEFINED = 0x00U << CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT; /*! @brief Specifies an undefined country code for SimpleAddress. */ const u32 CFG_SIMPLE_ADDRESS_ID_COUNTRY_UNDEFINED2 = 0xffU << CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT; /*! @brief Specifies an undefined region code for SimpleAddress. */ const u32 CFG_SIMPLE_ADDRESS_ID_REGION_UNDEFINED = 0x00U << CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; /*! @brief Specifies an undefined region code for SimpleAddress. */ const u32 CFG_SIMPLE_ADDRESS_ID_REGION_UNDEFINED2 = 0xffU << CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; /*! @brief Specifies the number of languages for the country/region name in simple address information. */ const u8 CFG_SIMPLE_ADDRESS_NUM_LANGUAGES = 16; /*! @brief Specifies the maximum length of country/region names in simple address information. */ const u8 CFG_SIMPLE_ADDRESS_NAME_LENGTH = 64; /*! @brief Specifies the size of memory required to get simple address information. */ const u32 CFG_SIMPLE_ADDRESS_WORKMEMORY_SIZE = 256 * 1024; /*! @brief Stores the user's simple address information configured in the System Settings. The size of this structure is at least 4 KB. Be careful not to exhaust the stack if the user's simple address information is placed in the stack. The country and region names in the simple address information retrieved from the nn::cfg::CTR::GetSimpleAddress function are guaranteed to be NULL terminated. */ struct SimpleAddress { u32 id; //!< Simple address information ID. The country code is stored in the upper 8 bits, and the region code is stored in the following 8 bits. The lower 16 bits are reserved. wchar_t countryName[CFG_SIMPLE_ADDRESS_NUM_LANGUAGES][CFG_SIMPLE_ADDRESS_NAME_LENGTH]; //!< Stores country names in each language. wchar_t regionName [CFG_SIMPLE_ADDRESS_NUM_LANGUAGES][CFG_SIMPLE_ADDRESS_NAME_LENGTH]; //!< Stores region names in each language (such as the names of states or prefectures). If a region is not selected, stores "—." If regions cannot be selected for the specified country setting, stores the country name. u16 latitude; //!< The latitude. Values in the range from 0x0000 through 0x4000 represent the range from 0 through +90 degrees. Values from 0xC000 through 0xFFFF represent the range from -90 through -0.005 degrees. Positive angles indicate the northern hemisphere; negative angles indicate the southern hemisphere. u16 longitude; //!< The longitude. Values from 0x0000 through 0x7FFF represent the range from 0 through +179.995 degrees. Values from 0x8000 through 0xFFFF represent the range from -180 through -0.005 degrees. Positive angles indicate the eastern hemisphere; negative angles indicate the western hemisphere. }; /*! @brief Stores the ID in simple address information. */ struct SimpleAddressId { u32 id; //!< Simple address information ID. /*! @brief Gets only the country code part of the simple address information ID. @return Returns the country code. */ CfgCountryCode GetCountryCode(void) const { return static_cast((id & CFG_SIMPLE_ADDRESS_ID_COUNTRY_MASK) >> CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT); } /*! @brief Gets only the region code part of the simple address information ID. @return Returns the region code. */ u8 GetRegionCode(void) const { return (id & CFG_SIMPLE_ADDRESS_ID_REGION_MASK) >> CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; } }; } // end of namespace CTR } // end of namespace cfg } // end of namespace nn #endif // NN_CFG_CTR_CFG_USER_INFO_H_