wut  1.0.0-beta9
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;
23 
24 typedef enum MCPAppType
25 {
27 } MCPAppType;
28 
29 typedef enum MCPInstallTarget
30 {
34 
35 typedef enum MCPRegion
36 {
43 } MCPRegion;
44 
45 struct MCPDevice
46 {
47  char name[0x31B];
48 };
49 WUT_CHECK_SIZE(MCPDevice, 0x31B);
50 
52 {
54 };
55 WUT_CHECK_SIZE(MCPDeviceList, 0x6360);
56 
58 {
59  WUT_UNKNOWN_BYTES(0x27F);
60 };
61 WUT_CHECK_SIZE(MCPInstallInfo, 0x27F);
62 
63 struct WUT_PACKED MCPInstallProgress
64 {
65  uint32_t inProgress;
66  uint64_t tid;
67  uint64_t sizeTotal;
68  uint64_t sizeProgress;
69  uint32_t contentsTotal;
70  uint32_t contentsProgress;
71 };
72 WUT_CHECK_OFFSET(MCPInstallProgress, 0x00, inProgress);
73 WUT_CHECK_OFFSET(MCPInstallProgress, 0x04, tid);
74 WUT_CHECK_OFFSET(MCPInstallProgress, 0x0C, sizeTotal);
75 WUT_CHECK_OFFSET(MCPInstallProgress, 0x14, sizeProgress);
76 WUT_CHECK_OFFSET(MCPInstallProgress, 0x1C, contentsTotal);
77 WUT_CHECK_OFFSET(MCPInstallProgress, 0x20, contentsProgress);
78 WUT_CHECK_SIZE(MCPInstallProgress, 0x24);
79 
81 {
82  WUT_UNKNOWN_BYTES(0x27F);
83 };
84 WUT_CHECK_SIZE(MCPInstallTitleInfo, 0x27F);
85 
86 struct WUT_PACKED MCPSysProdSettings
87 {
89  uint16_t eeprom_version;
90  WUT_PADDING_BYTES(2);
92  WUT_UNKNOWN_BYTES(4);
93  char ntsc_pal[5];
94 
96  char wifi_5ghz_country_code[4];
97 
100 
101  char code_id[8];
102  char serial_id[12];
103  WUT_UNKNOWN_BYTES(4);
104  char model_number[16];
105  uint32_t version;
106 };
107 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x00, product_area);
108 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x04, eeprom_version);
109 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x08, game_region);
110 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x10, ntsc_pal);
111 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x15, wifi_5ghz_country_code);
112 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x19, wifi_5ghz_country_code_revision);
113 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x1A, code_id);
114 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x22, serial_id);
115 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x32, model_number);
116 WUT_CHECK_OFFSET(MCPSysProdSettings, 0x42, version);
117 WUT_CHECK_SIZE(MCPSysProdSettings, 0x46);
118 
119 struct WUT_PACKED MCPTitleListType
120 {
121  uint64_t titleId;
122  WUT_UNKNOWN_BYTES(4);
123  char path[56];
125  WUT_UNKNOWN_BYTES(0x54 - 0x48);
126  uint8_t device;
127  WUT_UNKNOWN_BYTES(1);
128  char indexedDevice[10];
129  uint8_t unk0x60;
130 };
131 WUT_CHECK_OFFSET(MCPTitleListType, 0x00, titleId);
132 WUT_CHECK_OFFSET(MCPTitleListType, 0x0C, path);
133 WUT_CHECK_OFFSET(MCPTitleListType, 0x44, appType);
134 WUT_CHECK_OFFSET(MCPTitleListType, 0x54, device);
135 WUT_CHECK_OFFSET(MCPTitleListType, 0x56, indexedDevice);
136 WUT_CHECK_OFFSET(MCPTitleListType, 0x60, unk0x60);
137 WUT_CHECK_SIZE(MCPTitleListType, 0x61);
138 
139 MCPError
140 MCP_Open();
141 
142 MCPError
143 MCP_Close(int handle);
144 
145 MCPError
146 MCP_DeviceList(int handle,
147  int *numDevices,
148  MCPDeviceList *outDevices,
149  uint32_t outBufferSize);
150 
151 MCPError
152 MCP_FullDeviceList(int handle,
153  int *numDevices,
154  MCPDeviceList *outDevices,
155  uint32_t outBufferSize);
156 
157 MCPError
158 MCP_GetOwnTitleInfo(int32_t handle,
159  MCPTitleListType *titleInfo);
160 
161 MCPError
162 MCP_GetSysProdSettings(int32_t handle,
163  MCPSysProdSettings *settings);
164 
165 MCPError
166 MCP_GetTitleId(int32_t handle,
167  uint64_t *outTitleId);
168 
169 MCPError
170 MCP_GetTitleInfo(int32_t handle,
171  uint64_t titleId,
172  MCPTitleListType *titleInfo);
173 
174 MCPError
175 MCP_InstallSetTargetDevice(int handle,
176  MCPInstallTarget device);
177 
178 MCPError
179 MCP_InstallGetTargetDevice(int handle,
180  MCPInstallTarget *deviceOut);
181 
182 MCPError
183 MCP_InstallSetTargetUsb(int handle,
184  int usb);
185 
186 MCPError
187 MCP_InstallGetInfo(int handle,
188  char *path,
189  MCPInstallInfo *out);
190 
191 MCPError
192 MCP_InstallTitleAsync(int handle,
193  char *path,
194  MCPInstallTitleInfo *out);
195 
196 MCPError
197 MCP_InstallGetProgress(int handle,
198  MCPInstallProgress *installProgressOut);
199 
200 MCPError
201 MCP_InstallTitleAbort(int handle);
202 
203 MCPError
204 MCP_TitleCount(int32_t handle);
205 
206 MCPError
207 MCP_TitleList(int32_t handle,
208  uint32_t *outTitleCount,
209  MCPTitleListType *titleList,
210  uint32_t titleListSizeBytes);
211 
212 MCPError
213 MCP_TitleListByAppType(int32_t handle,
214  MCPAppType appType,
215  uint32_t *outTitleCount,
216  MCPTitleListType *titleList,
217  uint32_t titleListSizeBytes);
218 
219 MCPError
220 MCP_TitleListByUniqueId(int32_t handle,
221  uint32_t uniqueId,
222  uint32_t *outTitleCount,
223  MCPTitleListType *titleList,
224  uint32_t titleListSizeBytes);
225 
226 MCPError
228  uint32_t uniqueId,
229  const char *indexedDevice,
230  uint8_t unk0x60,
231  MCPAppType appType,
232  uint32_t *outTitleCount,
233  MCPTitleListType *titleList,
234  uint32_t titleListSizeBytes);
235 
236 MCPError
237 MCP_UninstallTitleAsync(int handle,
238  char *path,
239  MCPInstallTitleInfo *out);
240 
241 #ifdef __cplusplus
242 }
243 #endif
244 
MCPDeviceList
Definition: mcp.h:51
MCPSysProdSettings
Definition: mcp.h:86
MCPTitleListType::titleId
uint64_t titleId
Definition: mcp.h:121
MCPTitleListType::device
uint8_t device
Definition: mcp.h:126
MCP_GetTitleInfo
MCPError MCP_GetTitleInfo(int32_t handle, uint64_t titleId, MCPTitleListType *titleInfo)
MCP_REGION_EUROPE
@ MCP_REGION_EUROPE
Definition: mcp.h:39
MCP_INSTALL_TARGET_USB
@ MCP_INSTALL_TARGET_USB
Definition: mcp.h:32
MCP_TitleListByUniqueIdAndIndexedDeviceAndAppType
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)
MCPInstallProgress::contentsTotal
uint32_t contentsTotal
Definition: mcp.h:69
MCPTitleListType::unk0x60
uint8_t unk0x60
Definition: mcp.h:129
MCP_REGION_JAPAN
@ MCP_REGION_JAPAN
Definition: mcp.h:37
MCP_Open
MCPError MCP_Open()
MCPInstallProgress
Definition: mcp.h:63
MCPRegion
MCPRegion
Definition: mcp.h:35
MCP_DeviceList
MCPError MCP_DeviceList(int handle, int *numDevices, MCPDeviceList *outDevices, uint32_t outBufferSize)
MCP_InstallGetProgress
MCPError MCP_InstallGetProgress(int handle, MCPInstallProgress *installProgressOut)
MCP_InstallTitleAsync
MCPError MCP_InstallTitleAsync(int handle, char *path, MCPInstallTitleInfo *out)
MCP_INSTALL_TARGET_MLC
@ MCP_INSTALL_TARGET_MLC
Definition: mcp.h:31
MCPAppType
MCPAppType
Definition: mcp.h:24
MCP_REGION_CHINA
@ MCP_REGION_CHINA
Definition: mcp.h:40
MCPInstallProgress::sizeProgress
uint64_t sizeProgress
Definition: mcp.h:68
MCPDeviceList::devices
MCPDevice devices[32]
Definition: mcp.h:53
MCP_InstallSetTargetDevice
MCPError MCP_InstallSetTargetDevice(int handle, MCPInstallTarget device)
MCPSysProdSettings::wifi_5ghz_country_code_revision
uint8_t wifi_5ghz_country_code_revision
5ghz_country_code_revision in xml
Definition: mcp.h:99
wut.h
MCPInstallTarget
MCPInstallTarget
Definition: mcp.h:29
MCP_UninstallTitleAsync
MCPError MCP_UninstallTitleAsync(int handle, char *path, MCPInstallTitleInfo *out)
MCPInstallInfo
Definition: mcp.h:57
MCP_GetTitleId
MCPError MCP_GetTitleId(int32_t handle, uint64_t *outTitleId)
MCPSysProdSettings::game_region
MCPRegion game_region
Definition: mcp.h:91
MCP_APP_TYPE_UNKNOWN_0x0800000E
@ MCP_APP_TYPE_UNKNOWN_0x0800000E
Definition: mcp.h:26
MCPSysProdSettings::eeprom_version
uint16_t eeprom_version
Definition: mcp.h:89
MCPInstallTitleInfo
Definition: mcp.h:80
MCP_InstallTitleAbort
MCPError MCP_InstallTitleAbort(int handle)
MCP_REGION_KOREA
@ MCP_REGION_KOREA
Definition: mcp.h:41
MCPInstallProgress::tid
uint64_t tid
Definition: mcp.h:66
MCPError
int32_t MCPError
Definition: mcp.h:14
MCP_GetOwnTitleInfo
MCPError MCP_GetOwnTitleInfo(int32_t handle, MCPTitleListType *titleInfo)
MCPTitleListType::appType
MCPAppType appType
Definition: mcp.h:124
MCP_TitleListByAppType
MCPError MCP_TitleListByAppType(int32_t handle, MCPAppType appType, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCP_FullDeviceList
MCPError MCP_FullDeviceList(int handle, int *numDevices, MCPDeviceList *outDevices, uint32_t outBufferSize)
MCP_InstallSetTargetUsb
MCPError MCP_InstallSetTargetUsb(int handle, int usb)
MCPDevice::name
char name[0x31B]
Definition: mcp.h:47
MCP_Close
MCPError MCP_Close(int handle)
MCPSysProdSettings::product_area
MCPRegion product_area
Definition: mcp.h:88
MCPSysProdSettings::version
uint32_t version
Definition: mcp.h:105
MCP_InstallGetInfo
MCPError MCP_InstallGetInfo(int handle, char *path, MCPInstallInfo *out)
MCP_TitleList
MCPError MCP_TitleList(int32_t handle, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCPInstallProgress::contentsProgress
uint32_t contentsProgress
Definition: mcp.h:70
MCP_TitleListByUniqueId
MCPError MCP_TitleListByUniqueId(int32_t handle, uint32_t uniqueId, uint32_t *outTitleCount, MCPTitleListType *titleList, uint32_t titleListSizeBytes)
MCP_REGION_USA
@ MCP_REGION_USA
Definition: mcp.h:38
MCPInstallProgress::sizeTotal
uint64_t sizeTotal
Definition: mcp.h:67
MCPDevice
Definition: mcp.h:45
MCP_TitleCount
MCPError MCP_TitleCount(int32_t handle)
MCP_InstallGetTargetDevice
MCPError MCP_InstallGetTargetDevice(int handle, MCPInstallTarget *deviceOut)
MCPInstallProgress::inProgress
uint32_t inProgress
Definition: mcp.h:65
MCP_REGION_TAIWAN
@ MCP_REGION_TAIWAN
Definition: mcp.h:42
MCPTitleListType
Definition: mcp.h:119
MCP_GetSysProdSettings
MCPError MCP_GetSysProdSettings(int32_t handle, MCPSysProdSettings *settings)