wut  v1.7.0
Wii U Toolchain
erreula_cpp.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include <coreinit/filesystem.h>
4 #include <nn/result.h>
5 #include <padscore/kpad.h>
6 #include <vpad/input.h>
7 #include <string.h>
8 
18 #ifdef __cplusplus
19 
20 namespace nn
21 {
22 namespace erreula
23 {
24 
25 enum class ControllerType
26 {
27  WiiRemote0 = 0,
28  WiiRemote1 = 1,
29  WiiRemote2 = 2,
30  WiiRemote3 = 3,
31  DrcGamepad = 4,
32 };
33 
34 enum class ErrorType
35 {
36  Code = 0,
37  Message = 1,
38  Message1Button = 2,
39  Message2Button = 3,
40 };
41 
42 enum class LangType
43 {
44  Japanese = 0,
45  English = 1,
46  French = 2,
47  German = 3,
48  Italian = 4,
49  Spanish = 5,
51  Korean = 7,
52  Dutch = 8,
53  Portuguese = 9,
54  Russian = 10,
55  TraditionalChinese = 11,
56  Invalid = 12,
57 };
58 
59 enum class RegionType
60 {
61  Japan = 0,
62  USA = 1,
63  Europe = 2,
64  China = 3,
65  Korea = 4,
66  Taiwan = 5,
67 };
68 
69 enum class ResultType
70 {
71  None = 0,
72 
74  Exited = 1,
75 
76  // TODO: More result types
77 };
78 
79 enum class RenderTarget
80 {
82  Tv = 0,
83 
85  Drc = 1,
86 
88  Both = 2,
89 };
90 
91 enum class State
92 {
94  Hidden = 0,
95 
97  FadeIn = 1,
98 
100  Visible = 2,
101 
103  FadeOut = 3,
104 };
105 
106 struct ErrorArg
107 {
112  unknown0x0C(0),
113  errorCode(0),
114  unknown0x14(1),
115  errorMessage(nullptr),
116  button1Label(nullptr),
117  button2Label(nullptr),
118  errorTitle(nullptr),
119  unknown0x28(true)
120  {
121  }
122 
126  uint32_t unknown0x0C;
127  int32_t errorCode;
128  uint32_t unknown0x14;
129  const char16_t *errorMessage;
130  const char16_t *button1Label;
131  const char16_t *button2Label;
132  const char16_t *errorTitle;
134  WUT_PADDING_BYTES(3);
135 };
136 WUT_CHECK_OFFSET(ErrorArg, 0x00, errorType);
137 WUT_CHECK_OFFSET(ErrorArg, 0x04, renderTarget);
138 WUT_CHECK_OFFSET(ErrorArg, 0x08, controllerType);
139 WUT_CHECK_OFFSET(ErrorArg, 0x0C, unknown0x0C);
140 WUT_CHECK_OFFSET(ErrorArg, 0x10, errorCode);
141 WUT_CHECK_OFFSET(ErrorArg, 0x14, unknown0x14);
142 WUT_CHECK_OFFSET(ErrorArg, 0x18, errorMessage);
143 WUT_CHECK_OFFSET(ErrorArg, 0x1C, button1Label);
144 WUT_CHECK_OFFSET(ErrorArg, 0x20, button2Label);
145 WUT_CHECK_OFFSET(ErrorArg, 0x24, errorTitle);
146 WUT_CHECK_OFFSET(ErrorArg, 0x28, unknown0x28);
147 WUT_CHECK_SIZE(ErrorArg, 0x2C);
148 
149 
150 struct AppearArg
151 {
153 };
154 WUT_CHECK_OFFSET(AppearArg, 0x00, errorArg);
155 WUT_CHECK_SIZE(AppearArg, 0x2C);
156 
158 struct CreateArg
159 {
161  workMemory(nullptr),
163  language(LangType::English),
164  fsClient(nullptr)
165  {
166  }
167 
168  void *workMemory;
172 };
173 WUT_CHECK_OFFSET(CreateArg, 0x00, workMemory);
174 WUT_CHECK_OFFSET(CreateArg, 0x04, region);
175 WUT_CHECK_OFFSET(CreateArg, 0x08, language);
176 WUT_CHECK_OFFSET(CreateArg, 0x0C, fsClient);
177 WUT_CHECK_SIZE(CreateArg, 0x10);
178 
179 
181 {
183  {
184  memset(this, 0, sizeof(*this));
185  }
186 
187  const VPADStatus *vpad;
188  const KPADStatus *kpad[4];
189 };
190 WUT_CHECK_OFFSET(ControllerInfo, 0x00, vpad);
191 WUT_CHECK_OFFSET(ControllerInfo, 0x04, kpad);
192 WUT_CHECK_SIZE(ControllerInfo, 0x14);
193 
195 {
197  unknown0x00(1)
198  {
199  }
200 
201  uint32_t unknown0x00;
202 };
203 WUT_CHECK_OFFSET(HomeNixSignArg, 0x00, unknown0x00);
204 WUT_CHECK_SIZE(HomeNixSignArg, 0x04);
205 
206 void
208 
209 void
211 
212 void
213 Calc(const ControllerInfo &controllerInfo);
214 
215 void
216 ChangeLangError(LangType languageType);
217 
218 bool
219 Create(const CreateArg &args);
220 
221 void
223 
224 void
226 
227 void
229 
230 void
232 
233 void
235 
236 int32_t
238 
241 
242 int32_t
244 
245 State
247 
248 uint32_t
250 
251 bool
253 
254 bool
256 
257 bool
259 
260 bool
262 
263 bool
265 
266 bool
267 Jump(const char *buffer, uint32_t bufferSize);
268 
269 void
270 PlayAppearSE(bool playAppearSoundEffect);
271 
272 void
274 
275 } // namespace erreula
276 } // namespace nn
277 
278 #endif // ifdef __cplusplus
279 
A structure containing the Wii Remote data.
Definition: kpad.h:76
int32_t GetResultCode()
bool IsSelectCursorActive()
bool IsAppearHomeNixSign()
void DrawDRC()
bool Jump(const char *buffer, uint32_t bufferSize)
@ Both
Render to both TV and Gamepad.
@ Tv
Render only to TV.
@ Drc
Render only to DRC gamepad.
void DisappearErrorViewer()
@ FadeIn
The error viewer is drawing the fade-in animation.
@ Hidden
The error viewer is completely hidden.
@ Visible
The error viewer is done drawing the fade in animation and completely visible.
@ FadeOut
The error viewer is drawing the fade-out animation.
State GetStateErrorViewer()
void AppearHomeNixSign(const HomeNixSignArg &arg)
bool Create(const CreateArg &args)
void AppearErrorViewer(const AppearArg &arg)
void Calc(const ControllerInfo &controllerInfo)
void SetControllerRemo(ControllerType controller)
void ChangeLangError(LangType languageType)
void PlayAppearSE(bool playAppearSoundEffect)
uint32_t GetWorkMemorySize()
void DrawTV()
@ Exited
The user exited the error viewer.
int32_t GetSelectButtonNumError()
bool IsDecideSelectLeftButtonError()
void DisappearHomeNixSign()
ResultType GetResultType()
void Destroy()
bool IsDecideSelectButtonError()
bool IsDecideSelectRightButtonError()
Definition: ac_cpp.h:15
const VPADStatus * vpad
Definition: erreula_cpp.h:187
const KPADStatus * kpad[4]
Definition: erreula_cpp.h:188
Configuration options for the error.
Definition: erreula_cpp.h:159
const char16_t * button1Label
Definition: erreula_cpp.h:130
const char16_t * button2Label
Definition: erreula_cpp.h:131
const char16_t * errorTitle
Definition: erreula_cpp.h:132
ControllerType controllerType
Definition: erreula_cpp.h:125
RenderTarget renderTarget
Definition: erreula_cpp.h:124
const char16_t * errorMessage
Definition: erreula_cpp.h:129