1 /*---------------------------------------------------------------------------*
2 
3   Copyright 2010-2014 Nintendo.  All rights reserved.
4 
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law.  They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 // sciEnum.h
14 //
15 // Declares enums
16 
17 #ifndef _CAFE_SCI_ENUM_H_
18 #define _CAFE_SCI_ENUM_H_
19 
20 #include <stddef.h>
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif // __cplusplus
26 
27 /// \brief Status of API
28 ///
29 typedef enum _SCIStatus
30 {
31     SCI_STATUS_SUCCESS            =  1,   ///< Success
32     SCI_STATUS_FAIL               =  0,   ///< Fail
33     SCI_STATUS_READ_ERROR         = -1,   ///< Error reading system file
34     SCI_STATUS_WRITE_ERROR        = -2,   ///< Error writing system file
35     SCI_STATUS_FILE_NOT_FOUND     = -3,   ///< File is not found
36     SCI_STATUS_ITEM_NOT_FOUND     = -4,   ///< Item is not found in system file
37     SCI_STATUS_ACCOUNT_NOT_FOUND  = -5,   ///< Passed account is not found
38     SCI_STATUS_INVALID_SIZE       = -6,   ///< Passed buffer size is invalid
39     SCI_STATUS_INVALID_PARAM      = -7,   ///< Passed parameter is invalid
40     SCI_STATUS_COMPAT_ERROR       = -8,   ///< Error happens at transition to compat mode
41     SCI_STATUS_FATAL_ERROR        = -255, ///< Fatal internal error
42 } SCIStatus;
43 
44 /// \brief Boolean
45 ///
46 typedef u8 SCIBoolean;
47 #define SCI_FALSE     FALSE
48 #define SCI_TRUE      TRUE
49 #define SCI_DISABLE   SCI_FALSE
50 #define SCI_ENABLE    SCI_TRUE
51 #define SCI_INVALID   SCI_FALSE
52 #define SCI_VALID     SCI_TRUE
53 #define SCI_ALLOWED   SCI_FALSE
54 #define SCI_FORBIDDEN SCI_TRUE
55 
56 /// \brief Platform Region
57 ///
58 typedef enum SCIPlatformRegion
59 {
60     SCI_PLATFORM_REGION_JPN       = 0x00000001, ///< Japan
61     SCI_PLATFORM_REGION_USA       = 0x00000002, ///< United States of America
62     SCI_PLATFORM_REGION_EUR       = 0x00000004, ///< Europa
63     SCI_PLATFORM_REGION_AUS       = 0x00000008, ///< Australia (Obsolete)
64     SCI_PLATFORM_REGION_CHN       = 0x00000010, ///< China
65     SCI_PLATFORM_REGION_KOR       = 0x00000020, ///< Korea
66     SCI_PLATFORM_REGION_TWN       = 0x00000040, ///< Taiwn
67     SCI_PLATFORM_REGION_FIRST     = SCI_PLATFORM_REGION_JPN,
68     SCI_PLATFORM_REGION_LAST      = SCI_PLATFORM_REGION_TWN,
69     SCI_PLATFORM_REGION_INVALID   = 0x00000000  ///< Invalid platform region
70 } SCIPlatformRegion;
71 
72 /// \brief Languages
73 ///
74 typedef enum _SCICafeLanguage
75 {
76     SCI_CAFE_LANGUAGE_JAPANESE    = 0,  ///< Japanese
77     SCI_CAFE_LANGUAGE_ENGLISH     = 1,  ///< English
78     SCI_CAFE_LANGUAGE_FRENCH      = 2,  ///< French
79     SCI_CAFE_LANGUAGE_GERMAN      = 3,  ///< German
80     SCI_CAFE_LANGUAGE_ITALIAN     = 4,  ///< Italian
81     SCI_CAFE_LANGUAGE_SPANISH     = 5,  ///< Spanish
82     SCI_CAFE_LANGUAGE_CHINESE     = 6,  ///< Chinese
83     SCI_CAFE_LANGUAGE_KOREAN      = 7,  ///< Korean
84     SCI_CAFE_LANGUAGE_DUTCH       = 8,  ///< Dutch
85     SCI_CAFE_LANGUAGE_PORTUGUESE  = 9,  ///< Portuguese
86     SCI_CAFE_LANGUAGE_RUSSIAN     = 10, ///< Russian
87     SCI_CAFE_LANGUAGE_TAIWANESE   = 11, ///< Taiwanese
88     SCI_CAFE_LANGUAGE_FIRST       = SCI_CAFE_LANGUAGE_JAPANESE,
89     SCI_CAFE_LANGUAGE_LAST        = SCI_CAFE_LANGUAGE_TAIWANESE,
90     SCI_CAFE_LANGUAGE_INVALID     = 255 ///< Invalid language setting
91 } SCICafeLanguage;
92 
93 /// \brief Devices
94 ///
95 typedef enum _SCIDeviceType
96 {
97     SCI_DEVICE_TYPE_DISC    = 0,  ///< Disc
98     SCI_DEVICE_TYPE_NAND    = 1,  ///< Nand
99     SCI_DEVICE_TYPE_USB     = 2,  ///< USB Stroage
100     SCI_DEVICE_TYPE_INVALID = 255 ///< Invalid device type
101 } SCIDeviceType;
102 
103 /// \brief Restriction Level
104 ///
105 typedef u8 SCIRestrictionLevel;
106 #define    SCI_RESTRICTION_LEVEL_0 0  ///< No restriction
107 #define    SCI_RESTRICTION_LEVEL_1 1  ///< Part of restriction
108 #define    SCI_RESTRICTION_LEVEL_2 2  ///< Full restriction
109 
110 /// \brief Parent Pin length
111 ///
112 /// includes '\0'
113 ///
114 #define SCI_PARENT_PIN_LENGTH          (4 + 1)
115 
116 /// \brief Max number of coutry.
117 ///
118 #define SCI_CAFE_COUNTRY_MAX           (255)
119 
120 /// \brief Max size of coutry name.
121 ///
122 /// includes '\0'.
123 ///
124 #define SCI_CAFE_COUNTRY_NAME_SIZE_MAX (192)
125 
126 /// \brief Max size of area name.
127 ///
128 /// includes '\0'.
129 ///
130 #define SCI_CAFE_AREA_NAME_SIZE_MAX     (192)
131 
132 /// \brief Structure holding area info with name as utf-8 string
133 ///
134 typedef struct _SCICafeAreaInfo
135 {
136     char    name[SCI_CAFE_AREA_NAME_SIZE_MAX];
137     u16     latitude;
138     u16     longitude;
139 } SCICafeAreaInfo;
140 
141 /// \brief Structure holding area info with name as utf-16 string
142 ///
143 typedef struct _SCICafeAreaInfoUtf16
144 {
145     wchar_t name[SCI_CAFE_AREA_NAME_SIZE_MAX / 3];
146     u16     latitude;
147     u16     longitude;
148 } SCICafeAreaInfoUtf16;
149 
150 /// \brief Maximum number of titles that does not appere in quick start menu.
151 ///
152 #define SCI_CAFFINE_INVISIBLE_TITLE_MAX (64)
153 
154 /// \brief Maximum number of error logs.
155 ///
156 #define SCI_MAX_ERRORLOG_IDX     100
157 
158 /// \brief Index of latest error log.
159 ///
160 #define SCI_LAST_ERRORLOG_IDX   0
161 
162 /// \brief Maximum size of an error log.
163 ///
164 #define SCI_MAX_ERRORLOG_SIZE    (32*1024)
165 
166 #ifdef __cplusplus
167 }
168 #endif // __cplusplus
169 
170 #endif // _CAFE_SCI_ENUM_H_
171