1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: cfg_UserInfo.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_CFG_CTR_CFG_USER_INFO_H_ 17 #define NN_CFG_CTR_CFG_USER_INFO_H_ 18 19 #include <nn/fnd.h> 20 #include <nn/cfg/CTR/cfg_CountryCode.h> 21 22 namespace nn { 23 namespace cfg { 24 namespace CTR { 25 26 /*---------------------------------------------------------------------------* 27 * User information 28 *---------------------------------------------------------------------------*/ 29 /* Please see man pages for details 30 31 */ 32 const u8 CFG_USER_NAME_LENGTH = 11; 33 34 /* Please see man pages for details 35 36 37 38 39 40 41 42 */ 43 struct UserName 44 { 45 wchar_t userName[CFG_USER_NAME_LENGTH]; // 46 bool isNgUserName; // 47 NN_PADDING1; 48 }; 49 50 /* Please see man pages for details 51 52 */ 53 struct Birthday 54 { 55 s8 month; // 56 s8 day; // 57 }; 58 59 60 /*---------------------------------------------------------------------------* 61 * Simple address information 62 *---------------------------------------------------------------------------*/ 63 /* Please see man pages for details 64 65 */ 66 const u8 CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT = 24; 67 /* Please see man pages for details 68 69 */ 70 const u8 CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT = 16; 71 /* Please see man pages for details 72 73 */ 74 const u32 CFG_SIMPLE_ADDRESS_ID_COUNTRY_MASK = 0xffU << CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT; 75 /* Please see man pages for details 76 77 */ 78 const u32 CFG_SIMPLE_ADDRESS_ID_REGION_MASK = 0xffU << CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; 79 /* Please see man pages for details 80 81 */ 82 const u32 CFG_SIMPLE_ADDRESS_ID_RESERVED_MASK = 0x0000ffff; 83 84 /* Please see man pages for details 85 86 */ 87 const u32 CFG_SIMPLE_ADDRESS_ID_NOT_DEFINED = 0xffffffff; 88 /* Please see man pages for details 89 90 */ 91 const u32 CFG_SIMPLE_ADDRESS_ID_COUNTRY_UNDEFINED = 0x00U << CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT; 92 /* Please see man pages for details 93 94 */ 95 const u32 CFG_SIMPLE_ADDRESS_ID_COUNTRY_UNDEFINED2 = 0xffU << CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT; 96 /* Please see man pages for details 97 98 */ 99 const u32 CFG_SIMPLE_ADDRESS_ID_REGION_UNDEFINED = 0x00U << CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; 100 /* Please see man pages for details 101 102 */ 103 const u32 CFG_SIMPLE_ADDRESS_ID_REGION_UNDEFINED2 = 0xffU << CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; 104 105 /* Please see man pages for details 106 107 */ 108 const u8 CFG_SIMPLE_ADDRESS_NUM_LANGUAGES = 16; 109 /* Please see man pages for details 110 111 */ 112 const u8 CFG_SIMPLE_ADDRESS_NAME_LENGTH = 64; 113 114 /* Please see man pages for details 115 116 */ 117 const u32 CFG_SIMPLE_ADDRESS_WORKMEMORY_SIZE = 256 * 1024; 118 119 120 /* Please see man pages for details 121 122 123 124 125 126 127 */ 128 struct SimpleAddress 129 { 130 u32 id; // 131 wchar_t countryName[CFG_SIMPLE_ADDRESS_NUM_LANGUAGES][CFG_SIMPLE_ADDRESS_NAME_LENGTH]; // 132 wchar_t regionName [CFG_SIMPLE_ADDRESS_NUM_LANGUAGES][CFG_SIMPLE_ADDRESS_NAME_LENGTH]; // 133 u16 latitude; // 134 u16 longitude; // 135 }; 136 137 /* Please see man pages for details 138 139 */ 140 struct SimpleAddressId 141 { 142 u32 id; // 143 144 /* Please see man pages for details 145 146 147 */ GetCountryCodeSimpleAddressId148 CfgCountryCode GetCountryCode(void) const 149 { 150 return static_cast<CfgCountryCode>((id & CFG_SIMPLE_ADDRESS_ID_COUNTRY_MASK) >> CFG_SIMPLE_ADDRESS_ID_COUNTRY_SHIFT); 151 } 152 153 /* Please see man pages for details 154 155 156 */ GetRegionCodeSimpleAddressId157 u8 GetRegionCode(void) const 158 { 159 return (id & CFG_SIMPLE_ADDRESS_ID_REGION_MASK) >> CFG_SIMPLE_ADDRESS_ID_REGION_SHIFT; 160 } 161 }; 162 163 } // end of namespace CTR 164 } // end of namespace cfg 165 } // end of namespace nn 166 167 #endif // NN_CFG_CTR_CFG_USER_INFO_H_ 168