wut  v1.5.0
Wii U Toolchain
mcp.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef int32_t MCPError;
15 
16 typedef struct MCPDevice MCPDevice;
17 typedef struct MCPDeviceList MCPDeviceList;
18 typedef struct MCPInstallInfo MCPInstallInfo;
22 typedef struct MCPSystemVersion MCPSystemVersion;
23 typedef struct MCPTitleListType MCPTitleListType;
24 
25 typedef enum MCPAppType
26 {
28  MCP_APP_TYPE_GAME_DLC = 0x0800000E,
29  MCP_APP_TYPE_BOOT1 = 0x10000009,
43  MCP_APP_TYPE_GAME = 0x80000000,
44  MCP_APP_TYPE_GAME_WII = 0x8000002E,
51  MCP_APP_TYPE_EMANUAL = 0xD0000003,
52  MCP_APP_TYPE_HOME_MENU = 0xD0000004,
54  MCP_APP_TYPE_BROWSER = 0xD0000006,
56  MCP_APP_TYPE_MIIVERSE = 0xD0000016,
57  MCP_APP_TYPE_ESHOP = 0xD0000017,
63 
64 typedef enum MCPDeviceType
65 {
70 
71 typedef enum MCPDeviceFlags
72 {
78 
79 typedef enum MCPInstallTarget
80 {
84 
85 typedef enum MCPRegion
86 {
94 
95 typedef enum MCPCompatAVFile
96 {
102 
103 struct WUT_PACKED MCPDevice
104 {
105  char type[8];
106  char unk0x08[128];
107  char filesystem[8];
108  char path[0x27F];
110  uint32_t uid;
111  uint32_t index;
112 };
113 WUT_CHECK_OFFSET(MCPDevice, 0x00, type);
114 WUT_CHECK_OFFSET(MCPDevice, 0x08, unk0x08);
115 WUT_CHECK_OFFSET(MCPDevice, 0x88, filesystem);
116 WUT_CHECK_OFFSET(MCPDevice, 0x90, path);
117 WUT_CHECK_OFFSET(MCPDevice, 0x30F, flags);
118 WUT_CHECK_OFFSET(MCPDevice, 0x313, uid);
119 WUT_CHECK_OFFSET(MCPDevice, 0x317, index);
120 WUT_CHECK_SIZE(MCPDevice, 0x31B);
121 
123 {
124  WUT_UNKNOWN_BYTES(0x27F);
125 };
126 WUT_CHECK_SIZE(MCPInstallInfo, 0x27F);
127 
128 struct WUT_PACKED MCPInstallProgress
129 {
130  uint32_t inProgress;
131  uint64_t tid;
132  uint64_t sizeTotal;
133  uint64_t sizeProgress;
134  uint32_t contentsTotal;
136 };
137 WUT_CHECK_OFFSET(MCPInstallProgress, 0x00, inProgress);
138 WUT_CHECK_OFFSET(MCPInstallProgress, 0x04, tid);
139 WUT_CHECK_OFFSET(MCPInstallProgress, 0x0C, sizeTotal);
140 WUT_CHECK_OFFSET(MCPInstallProgress, 0x14, sizeProgress);
141 WUT_CHECK_OFFSET(MCPInstallProgress, 0x1C, contentsTotal);
142 WUT_CHECK_OFFSET(MCPInstallProgress, 0x20, contentsProgress);
143 WUT_CHECK_SIZE(MCPInstallProgress, 0x24);
144 
146 {
147  WUT_UNKNOWN_BYTES(0x27F);
148 };
149 WUT_CHECK_SIZE(MCPInstallTitleInfo, 0x27F);
150 
151 struct WUT_PACKED MCPSysProdSettings
152 {
154  uint16_t eeprom_version;
155  WUT_PADDING_BYTES(2);
157  WUT_UNKNOWN_BYTES(4);
158  char ntsc_pal[5];
159 
161  char wifi_5ghz_country_code[4];
162 
165 
166  char code_id[8];
167  char serial_id[12];
168  WUT_UNKNOWN_BYTES(4);
169  char model_number[16];
170  uint32_t version;
171 };
172 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x00, product_area);
173 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x04, eeprom_version);
174 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x08, game_region);
175 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x10, ntsc_pal);
176 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x15, wifi_5ghz_country_code);
177 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x19, wifi_5ghz_country_code_revision);
178 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x1A, code_id);
179 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x22, serial_id);
180 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x32, model_number);
181 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x42, version);
182 WUT_CHECK_SIZE(MCPSysProdSettings, 0x46);
183 
185 {
186  uint32_t major;
187  uint32_t minor;
188  uint32_t patch;
189  char region;
190 };
191 WUT_CHECK_OFFSET(MCPSystemVersion, 0x00, major);
192 WUT_CHECK_OFFSET(MCPSystemVersion, 0x04, minor);
193 WUT_CHECK_OFFSET(MCPSystemVersion, 0x08, patch);
194 WUT_CHECK_OFFSET(MCPSystemVersion, 0x0C, region);
195 WUT_CHECK_SIZE(MCPSystemVersion, 0x10);
196 
197 struct WUT_PACKED MCPTitleListType
198 {
199  uint64_t titleId;
200  uint32_t groupId;
201  char path[56];
203  uint16_t titleVersion;
204  uint64_t osVersion;
205  uint32_t sdkVersion;
206  char indexedDevice[10];
207  uint8_t unk0x60;
208 };
209 WUT_CHECK_OFFSET(MCPTitleListType, 0x00, titleId);
210 WUT_CHECK_OFFSET(MCPTitleListType, 0x08, groupId);
211 WUT_CHECK_OFFSET(MCPTitleListType, 0x0C, path);
212 WUT_CHECK_OFFSET(MCPTitleListType, 0x44, appType);
213 WUT_CHECK_OFFSET(MCPTitleListType, 0x48, titleVersion);
214 WUT_CHECK_OFFSET(MCPTitleListType, 0x4A, osVersion);
215 WUT_CHECK_OFFSET(MCPTitleListType, 0x52, sdkVersion);
216 WUT_CHECK_OFFSET(MCPTitleListType, 0x56, indexedDevice);
217 WUT_CHECK_OFFSET(MCPTitleListType, 0x60, unk0x60);
218 WUT_CHECK_SIZE(MCPTitleListType, 0x61);
219 
220 MCPError
222 
223 MCPError
224 MCP_Close(int handle);
225 
226 MCPError
227 MCP_DeviceList(int handle,
228  int *numDevices,
229  MCPDevice *outDeviceList,
230  uint32_t deviceListSizeInBytes);
231 
232 MCPError
234  int *numDevices,
235  MCPDevice *outDeviceList,
236  uint32_t deviceListSizeInBytes);
237 
238 MCPError
239 MCP_GetOwnTitleInfo(int32_t handle,
240  MCPTitleListType *titleInfo);
241 
242 MCPError
243 MCP_GetSysProdSettings(int32_t handle,
244  MCPSysProdSettings *settings);
245 
246 MCPError
247 MCP_GetSystemVersion(int32_t handle,
248  MCPSystemVersion *systemVersion);
249 
250 MCPError
251 MCP_GetTitleId(int32_t handle,
252  uint64_t *outTitleId);
253 
254 MCPError
255 MCP_GetTitleInfo(int32_t handle,
256  uint64_t titleId,
257  MCPTitleListType *titleInfo);
258 
259 MCPError
261  MCPInstallTarget device);
262 
263 MCPError
265  MCPInstallTarget *deviceOut);
266 
267 MCPError
269  int usb);
270 
271 MCPError
273  const char *path,
274  MCPInstallInfo *out);
275 
276 MCPError
278  const char *path,
279  MCPInstallTitleInfo *out);
280 
281 MCPError
283  MCPInstallProgress *installProgressOut);
284 
285 MCPError
287 
288 MCPError
289 MCP_TitleCount(int32_t handle);
290 
291 MCPError
292 MCP_TitleList(int32_t handle,
293  uint32_t *outTitleCount,
294  MCPTitleListType *titleList,
295  uint32_t titleListSizeBytes);
296 
297 MCPError
298 MCP_TitleListByAppType(int32_t handle,
299  MCPAppType appType,
300  uint32_t *outTitleCount,
301  MCPTitleListType *titleList,
302  uint32_t titleListSizeBytes);
303 
304 MCPError
305 MCP_TitleListByUniqueId(int32_t handle,
306  uint32_t uniqueId,
307  uint32_t *outTitleCount,
308  MCPTitleListType *titleList,
309  uint32_t titleListSizeBytes);
310 
311 MCPError
312 MCP_TitleListByDevice(int32_t handle,
313  const char *device,
314  uint32_t *outTitleCount,
315  MCPTitleListType *titleList,
316  uint32_t titleListSizeBytes);
317 
318 MCPError
320  MCPDeviceType deviceType,
321  uint32_t *outTitleCount,
322  MCPTitleListType *titleList,
323  uint32_t titleListSizeBytes);
324 MCPError
326  MCPAppType appType,
327  const char *device,
328  uint32_t *outTitleCount,
329  MCPTitleListType *titleList,
330  uint32_t titleListSizeBytes);
331 
332 MCPError
334  MCPAppType appType,
335  MCPDeviceType deviceType,
336  uint32_t *outTitleCount,
337  MCPTitleListType *titleList,
338  uint32_t titleListSizeBytes);
339 
340 MCPError
342  uint32_t uniqueId,
343  const char *indexedDevice,
344  uint8_t unk0x60,
345  MCPAppType appType,
346  uint32_t *outTitleCount,
347  MCPTitleListType *titleList,
348  uint32_t titleListSizeBytes);
349 
350 MCPError
351 MCP_UninstallTitleAsync(int32_t handle,
352  const char *path,
353  MCPInstallTitleInfo *out);
354 
355 MCPError
356 MCP_CompatLoadAVFile(int32_t handle,
357  void *ptr,
358  uint32_t *size,
359  MCPCompatAVFile file);
360 
368 MCPError
370 
371 #ifdef __cplusplus
372 }
373 #endif
374 
uint64_t titleId
Definition: mcp.h:199
uint32_t sdkVersion
Definition: mcp.h:205
char region
Definition: mcp.h:189
uint64_t osVersion
Definition: mcp.h:204
uint8_t wifi_5ghz_country_code_revision
5ghz_country_code_revision in xml
Definition: mcp.h:164
uint8_t unk0x60
Definition: mcp.h:207
uint32_t contentsTotal
Definition: mcp.h:134
uint16_t titleVersion
Definition: mcp.h:203
uint32_t uid
Definition: mcp.h:110
uint32_t inProgress
Definition: mcp.h:130
uint32_t patch
Definition: mcp.h:188
uint32_t minor
Definition: mcp.h:187
MCPRegion product_area
Definition: mcp.h:153
uint32_t index
Definition: mcp.h:111
MCPDeviceFlags flags
Definition: mcp.h:109
MCPRegion game_region
Definition: mcp.h:155
uint32_t major
Definition: mcp.h:186
uint32_t version
Definition: mcp.h:170
MCPAppType appType
Definition: mcp.h:202
uint64_t sizeTotal
Definition: mcp.h:132
uint64_t tid
Definition: mcp.h:131
uint64_t sizeProgress
Definition: mcp.h:133
uint32_t groupId
Definition: mcp.h:200
uint16_t eeprom_version
Definition: mcp.h:154
uint32_t contentsProgress
Definition: mcp.h:135
MCPError MCP_GetSystemVersion(int32_t handle, MCPSystemVersion *systemVersion)
MCPError MCP_InstallGetTargetDevice(int handle, MCPInstallTarget *deviceOut)
MCPError MCP_TitleListByDeviceType(int32_t handle, MCPDeviceType deviceType, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_GetOwnTitleInfo(int32_t handle, MCPTitleListType *titleInfo)
MCPDeviceFlags
Definition: mcp.h:72
MCPError MCP_TitleListByUniqueIdAndIndexedDeviceAndAppType(int32_t handle, uint32_t uniqueId, const char *indexedDevice, uint8_t unk0x60, MCPAppType appType, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_CompatLoadAVFile(int32_t handle, void *ptr, uint32_t *size, MCPCompatAVFile file)
MCPCompatAVFile
Definition: mcp.h:96
MCPError MCP_TitleListByDevice(int32_t handle, const char *device, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_TitleCount(int32_t handle)
MCPRegion
Definition: mcp.h:86
MCPError MCP_GetTitleInfo(int32_t handle, uint64_t titleId, MCPTitleListType *titleInfo)
MCPDeviceType
Definition: mcp.h:65
MCPError MCP_TitleListByAppAndDevice(int32_t handle, MCPAppType appType, const char *device, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_InstallSetTargetDevice(int handle, MCPInstallTarget device)
MCPError MCP_UninstallTitleAsync(int32_t handle, const char *path, MCPInstallTitleInfo *out)
MCPAppType
Definition: mcp.h:26
MCPInstallTarget
Definition: mcp.h:80
MCPError MCP_TitleListByAppAndDeviceType(int32_t handle, MCPAppType appType, MCPDeviceType deviceType, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_GetSysProdSettings(int32_t handle, MCPSysProdSettings *settings)
MCPError MCP_InstallSetTargetUsb(int handle, int usb)
MCPError MCP_FullDeviceList(int handle, int *numDevices, MCPDevice *outDeviceList, uint32_t deviceListSizeInBytes)
MCPError MCP_GetTitleId(int32_t handle, uint64_t *outTitleId)
struct MCPDeviceList MCPDeviceList
Definition: mcp.h:17
MCPError MCP_InstallGetProgress(int handle, MCPInstallProgress *installProgressOut)
MCPError MCP_Open()
MCPError MCP_InstallTitleAbort(int handle)
MCPError MCP_TriggerCrashLogCollection(int32_t handle)
Saves the current Cafe log to the SLC logs directory.
MCPError MCP_TitleListByUniqueId(int32_t handle, uint32_t uniqueId, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_InstallTitleAsync(int handle, const char *path, MCPInstallTitleInfo *out)
MCPError MCP_Close(int handle)
int32_t MCPError
Definition: mcp.h:14
MCPError MCP_TitleList(int32_t handle, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_TitleListByAppType(int32_t handle, MCPAppType appType, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_DeviceList(int handle, int *numDevices, MCPDevice *outDeviceList, uint32_t deviceListSizeInBytes)
MCPError MCP_InstallGetInfo(int handle, const char *path, MCPInstallInfo *out)
@ MCP_DEVICE_FLAG_UNK_1
Definition: mcp.h:73
@ MCP_DEVICE_FLAG_UNK_2
Definition: mcp.h:74
@ MCP_DEVICE_FLAG_UNK_8
Definition: mcp.h:76
@ MCP_DEVICE_FLAG_UNK_4
Definition: mcp.h:75
@ MCP_COMPAT_AV_FILE_DEINT
Deinterlacer parameters.
Definition: mcp.h:100
@ MCP_COMPAT_AV_FILE_DMCU
DMCU firmware.
Definition: mcp.h:98
@ MCP_REGION_EUROPE
Definition: mcp.h:89
@ MCP_REGION_USA
Definition: mcp.h:88
@ MCP_REGION_TAIWAN
Definition: mcp.h:92
@ MCP_REGION_CHINA
Definition: mcp.h:90
@ MCP_REGION_KOREA
Definition: mcp.h:91
@ MCP_REGION_JAPAN
Definition: mcp.h:87
@ MCP_DEVICE_TYPE_MLC
Definition: mcp.h:67
@ MCP_DEVICE_TYPE_ODD
Definition: mcp.h:66
@ MCP_DEVICE_TYPE_USB
Definition: mcp.h:68
@ MCP_APP_TYPE_BOOT1
Definition: mcp.h:29
@ MCP_APP_TYPE_GAME_DLC
Definition: mcp.h:28
@ MCP_APP_TYPE_GAME_WII
Definition: mcp.h:44
@ MCP_APP_TYPE_SYSTEM_VERSION
Definition: mcp.h:34
@ MCP_APP_TYPE_SYSTEM_SETTINGS
Definition: mcp.h:49
@ MCP_APP_TYPE_SYSTEM_UPDATER
Definition: mcp.h:46
@ MCP_APP_TYPE_MIIVERSE_POST
Definition: mcp.h:55
@ MCP_APP_TYPE_MCP_TITLE_LIST
Definition: mcp.h:42
@ MCP_APP_TYPE_DRC_FIRMWARE
Definition: mcp.h:32
@ MCP_APP_TYPE_WAGONU_MIGRATION_LIST
Definition: mcp.h:40
@ MCP_APP_TYPE_SYSTEM_LIBRARIES
Definition: mcp.h:30
@ MCP_APP_TYPE_ESHOP
Definition: mcp.h:57
@ MCP_APP_TYPE_AMIIBO_SETTINGS
Definition: mcp.h:61
@ MCP_APP_TYPE_EXCEPTIONS_DATA
Definition: mcp.h:36
@ MCP_APP_TYPE_PATCH_MAP_DATA
Definition: mcp.h:39
@ MCP_APP_TYPE_AOC_OVERLAY
Definition: mcp.h:60
@ MCP_APP_TYPE_DRC_LANGUAGE
Definition: mcp.h:35
@ MCP_APP_TYPE_ERROR_DISPLAY
Definition: mcp.h:53
@ MCP_APP_TYPE_SYSTEM_MENU
Definition: mcp.h:45
@ MCP_APP_TYPE_CAFFEINE_TITLE_LIST
Definition: mcp.h:41
@ MCP_APP_TYPE_EMANUAL
Definition: mcp.h:51
@ MCP_APP_TYPE_GAME
Definition: mcp.h:43
@ MCP_APP_TYPE_DOWNLOAD_MANAGEMENT
Definition: mcp.h:59
@ MCP_APP_TYPE_HOME_MENU
Definition: mcp.h:52
@ MCP_APP_TYPE_CERT_STORE
Definition: mcp.h:38
@ MCP_APP_TYPE_MIIVERSE
Definition: mcp.h:56
@ MCP_APP_TYPE_ECO_PROCESS
Definition: mcp.h:50
@ MCP_APP_TYPE_BLUETOOTH_FIRMWARE
Definition: mcp.h:31
@ MCP_APP_TYPE_GAME_UPDATE
Definition: mcp.h:27
@ MCP_APP_TYPE_DRH_FIRMWARE
Definition: mcp.h:33
@ MCP_APP_TYPE_ACCOUNT_APPS
Definition: mcp.h:48
@ MCP_APP_TYPE_FRIEND_LIST
Definition: mcp.h:58
@ MCP_APP_TYPE_BROWSER
Definition: mcp.h:54
@ MCP_APP_TYPE_SYSTEM_APPS
Definition: mcp.h:47
@ MCP_APP_TYPE_SHARED_DATA
Definition: mcp.h:37
@ MCP_INSTALL_TARGET_MLC
Definition: mcp.h:81
@ MCP_INSTALL_TARGET_USB
Definition: mcp.h:82
Definition: mcp.h:104