wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
mcp.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef int32_t MCPError;
15
16typedef struct MCPDevice MCPDevice;
24
25typedef enum MCPAppType
26{
29 MCP_APP_TYPE_BOOT1 = 0x10000009,
43 MCP_APP_TYPE_GAME = 0x80000000,
57 MCP_APP_TYPE_ESHOP = 0xD0000017,
63
64typedef enum MCPDeviceType
65{
66 MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
70 /* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
72
80
86
96
104
105struct WUT_PACKED MCPDevice
106{
107 char type[8];
108 char unk0x08[128];
109 char filesystem[8];
110 char path[0x27F];
112 uint32_t uid;
113 uint32_t index;
114};
115WUT_CHECK_OFFSET(MCPDevice, 0x00, type);
116WUT_CHECK_OFFSET(MCPDevice, 0x08, unk0x08);
117WUT_CHECK_OFFSET(MCPDevice, 0x88, filesystem);
118WUT_CHECK_OFFSET(MCPDevice, 0x90, path);
119WUT_CHECK_OFFSET(MCPDevice, 0x30F, flags);
120WUT_CHECK_OFFSET(MCPDevice, 0x313, uid);
121WUT_CHECK_OFFSET(MCPDevice, 0x317, index);
122WUT_CHECK_SIZE(MCPDevice, 0x31B);
123
125{
126 WUT_UNKNOWN_BYTES(0x27F);
127};
128WUT_CHECK_SIZE(MCPInstallInfo, 0x27F);
129
130struct WUT_PACKED MCPInstallProgress
131{
132 uint32_t inProgress;
133 uint64_t tid;
134 uint64_t sizeTotal;
135 uint64_t sizeProgress;
138};
139WUT_CHECK_OFFSET(MCPInstallProgress, 0x00, inProgress);
140WUT_CHECK_OFFSET(MCPInstallProgress, 0x04, tid);
141WUT_CHECK_OFFSET(MCPInstallProgress, 0x0C, sizeTotal);
142WUT_CHECK_OFFSET(MCPInstallProgress, 0x14, sizeProgress);
143WUT_CHECK_OFFSET(MCPInstallProgress, 0x1C, contentsTotal);
144WUT_CHECK_OFFSET(MCPInstallProgress, 0x20, contentsProgress);
145WUT_CHECK_SIZE(MCPInstallProgress, 0x24);
146
148{
149 WUT_UNKNOWN_BYTES(0x27F);
150};
151WUT_CHECK_SIZE(MCPInstallTitleInfo, 0x27F);
152
153struct WUT_PACKED MCPSysProdSettings
154{
157 WUT_PADDING_BYTES(2);
159 WUT_UNKNOWN_BYTES(4);
160 char ntsc_pal[5];
161
163 char wifi_5ghz_country_code[4];
164
167
168 char code_id[8];
169 char serial_id[12];
170 WUT_UNKNOWN_BYTES(4);
171 char model_number[16];
172 uint32_t version;
173};
174WUT_CHECK_OFFSET(MCPSysProdSettings, 0x00, product_area);
175WUT_CHECK_OFFSET(MCPSysProdSettings, 0x04, eeprom_version);
176WUT_CHECK_OFFSET(MCPSysProdSettings, 0x08, game_region);
177WUT_CHECK_OFFSET(MCPSysProdSettings, 0x10, ntsc_pal);
178WUT_CHECK_OFFSET(MCPSysProdSettings, 0x15, wifi_5ghz_country_code);
179WUT_CHECK_OFFSET(MCPSysProdSettings, 0x19, wifi_5ghz_country_code_revision);
180WUT_CHECK_OFFSET(MCPSysProdSettings, 0x1A, code_id);
181WUT_CHECK_OFFSET(MCPSysProdSettings, 0x22, serial_id);
182WUT_CHECK_OFFSET(MCPSysProdSettings, 0x32, model_number);
183WUT_CHECK_OFFSET(MCPSysProdSettings, 0x42, version);
184WUT_CHECK_SIZE(MCPSysProdSettings, 0x46);
185
187{
188 uint32_t major;
189 uint32_t minor;
190 uint32_t patch;
191 char region;
192};
193WUT_CHECK_OFFSET(MCPSystemVersion, 0x00, major);
194WUT_CHECK_OFFSET(MCPSystemVersion, 0x04, minor);
195WUT_CHECK_OFFSET(MCPSystemVersion, 0x08, patch);
196WUT_CHECK_OFFSET(MCPSystemVersion, 0x0C, region);
197WUT_CHECK_SIZE(MCPSystemVersion, 0x10);
198
199struct WUT_PACKED MCPTitleListType
200{
201 uint64_t titleId;
202 uint32_t groupId;
203 char path[56];
205 uint16_t titleVersion;
206 uint64_t osVersion;
207 uint32_t sdkVersion;
208 char indexedDevice[10];
209 uint8_t unk0x60;
210};
211WUT_CHECK_OFFSET(MCPTitleListType, 0x00, titleId);
212WUT_CHECK_OFFSET(MCPTitleListType, 0x08, groupId);
213WUT_CHECK_OFFSET(MCPTitleListType, 0x0C, path);
214WUT_CHECK_OFFSET(MCPTitleListType, 0x44, appType);
215WUT_CHECK_OFFSET(MCPTitleListType, 0x48, titleVersion);
216WUT_CHECK_OFFSET(MCPTitleListType, 0x4A, osVersion);
217WUT_CHECK_OFFSET(MCPTitleListType, 0x52, sdkVersion);
218WUT_CHECK_OFFSET(MCPTitleListType, 0x56, indexedDevice);
219WUT_CHECK_OFFSET(MCPTitleListType, 0x60, unk0x60);
220WUT_CHECK_SIZE(MCPTitleListType, 0x61);
221
224
226MCP_Close(int handle);
227
229MCP_DeviceList(int handle,
230 int *numDevices,
231 MCPDevice *outDeviceList,
232 uint32_t deviceListSizeInBytes);
233
236 int *numDevices,
237 MCPDevice *outDeviceList,
238 uint32_t deviceListSizeInBytes);
239
241MCP_GetOwnTitleInfo(int32_t handle,
242 MCPTitleListType *titleInfo);
243
246 MCPSysProdSettings *settings);
247
249MCP_GetSystemVersion(int32_t handle,
250 MCPSystemVersion *systemVersion);
251
253MCP_GetTitleId(int32_t handle,
254 uint64_t *outTitleId);
255
257MCP_GetTitleInfo(int32_t handle,
258 uint64_t titleId,
259 MCPTitleListType *titleInfo);
260
263 MCPInstallTarget device);
264
267 MCPInstallTarget *deviceOut);
268
271 int usb);
272
275 const char *path,
276 MCPInstallInfo *out);
277
280 const char *path,
282
285 MCPInstallProgress *installProgressOut);
286
289
291MCP_TitleCount(int32_t handle);
292
294MCP_TitleList(int32_t handle,
295 uint32_t *outTitleCount,
296 MCPTitleListType *titleList,
297 uint32_t titleListSizeBytes);
298
301 MCPAppType appType,
302 uint32_t *outTitleCount,
303 MCPTitleListType *titleList,
304 uint32_t titleListSizeBytes);
305
308 uint32_t uniqueId,
309 uint32_t *outTitleCount,
310 MCPTitleListType *titleList,
311 uint32_t titleListSizeBytes);
312
315 const char *deviceName,
316 uint32_t *outTitleCount,
317 MCPTitleListType *titleList,
318 uint32_t titleListSizeBytes);
319
322 MCPDeviceType deviceType,
323 uint32_t *outTitleCount,
324 MCPTitleListType *titleList,
325 uint32_t titleListSizeBytes);
328 MCPAppType appType,
329 const char *deviceName,
330 uint32_t *outTitleCount,
331 MCPTitleListType *titleList,
332 uint32_t titleListSizeBytes);
333
336 MCPAppType appType,
337 MCPDeviceType deviceType,
338 uint32_t *outTitleCount,
339 MCPTitleListType *titleList,
340 uint32_t titleListSizeBytes);
341
344 uint32_t uniqueId,
345 const char *indexedDevice,
346 uint8_t unk0x60,
347 MCPAppType appType,
348 uint32_t *outTitleCount,
349 MCPTitleListType *titleList,
350 uint32_t titleListSizeBytes);
351
354 const char *path,
356
358MCP_CompatLoadAVFile(int32_t handle,
359 void *ptr,
360 uint32_t *size,
361 MCPCompatAVFile file);
362
372
381 uint32_t enable,
382 uint32_t maxOnTime,
383 uint16_t defaultOffTime);
384
385static inline const char*
387 switch (deviceType) {
389 return "auto";
391 return "odd";
393 return "mlc";
395 return "usb";
396 }
397 return "auto";
398}
399
400#ifdef __cplusplus
401}
402#endif
403
uint64_t titleId
Definition mcp.h:201
uint32_t sdkVersion
Definition mcp.h:207
char region
Definition mcp.h:191
uint64_t osVersion
Definition mcp.h:206
uint8_t wifi_5ghz_country_code_revision
5ghz_country_code_revision in xml
Definition mcp.h:166
uint8_t unk0x60
Definition mcp.h:209
uint32_t contentsTotal
Definition mcp.h:136
uint16_t titleVersion
Definition mcp.h:205
uint32_t uid
Definition mcp.h:112
uint32_t inProgress
Definition mcp.h:132
uint32_t patch
Definition mcp.h:190
uint32_t minor
Definition mcp.h:189
MCPRegion product_area
Definition mcp.h:155
uint32_t index
Definition mcp.h:113
MCPDeviceFlags flags
Definition mcp.h:111
MCPRegion game_region
Definition mcp.h:158
uint32_t major
Definition mcp.h:188
uint32_t version
Definition mcp.h:172
MCPAppType appType
Definition mcp.h:204
uint64_t sizeTotal
Definition mcp.h:134
uint64_t tid
Definition mcp.h:133
uint64_t sizeProgress
Definition mcp.h:135
uint32_t groupId
Definition mcp.h:202
uint16_t eeprom_version
Definition mcp.h:156
uint32_t contentsProgress
Definition mcp.h:137
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:74
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)
static const char * MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType)
Definition mcp.h:386
MCPError MCP_ChangeEcoSettings(int32_t handle, uint32_t enable, uint32_t maxOnTime, uint16_t defaultOffTime)
Sets values to /storage_slc/sys/config/eco.xml.
MCPError MCP_CompatLoadAVFile(int32_t handle, void *ptr, uint32_t *size, MCPCompatAVFile file)
MCPCompatAVFile
Definition mcp.h:98
MCPError MCP_TitleCount(int32_t handle)
MCPRegion
Definition mcp.h:88
MCPError MCP_GetTitleInfo(int32_t handle, uint64_t titleId, MCPTitleListType *titleInfo)
MCPDeviceType
Definition mcp.h:65
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:82
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_TitleListByDevice(int32_t handle, const char *deviceName, 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_TitleListByAppAndDevice(int32_t handle, MCPAppType appType, const char *deviceName, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPError MCP_InstallGetInfo(int handle, const char *path, MCPInstallInfo *out)
@ MCP_DEVICE_FLAG_UNK_1
Definition mcp.h:75
@ MCP_DEVICE_FLAG_UNK_2
Definition mcp.h:76
@ MCP_DEVICE_FLAG_UNK_8
Definition mcp.h:78
@ MCP_DEVICE_FLAG_UNK_4
Definition mcp.h:77
@ MCP_COMPAT_AV_FILE_DEINT
Deinterlacer parameters.
Definition mcp.h:102
@ MCP_COMPAT_AV_FILE_DMCU
DMCU firmware.
Definition mcp.h:100
@ MCP_REGION_EUROPE
Definition mcp.h:91
@ MCP_REGION_USA
Definition mcp.h:90
@ MCP_REGION_TAIWAN
Definition mcp.h:94
@ MCP_REGION_CHINA
Definition mcp.h:92
@ MCP_REGION_KOREA
Definition mcp.h:93
@ MCP_REGION_JAPAN
Definition mcp.h:89
@ MCP_DEVICE_TYPE_MLC
Definition mcp.h:68
@ MCP_DEVICE_TYPE_AUTO
Definition mcp.h:66
@ MCP_DEVICE_TYPE_ODD
Definition mcp.h:67
@ MCP_DEVICE_TYPE_USB
Definition mcp.h:69
@ 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:83
@ MCP_INSTALL_TARGET_USB
Definition mcp.h:84