Add basic MCP coreinit imports

This commit is contained in:
shinyquagsire23 2016-08-01 15:16:36 -07:00
parent e8067e8754
commit e43e86aeda
2 changed files with 95 additions and 0 deletions

83
include/coreinit/mcp.h Normal file
View File

@ -0,0 +1,83 @@
#pragma once
#include <wut.h>
/**
* \defgroup coreinit_mcp MCP IOS Calls
* \ingroup coreinit
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef enum MCPInstallTarget
{
MCP_INSTALL_TARGET_MLC = 0,
MCP_INSTALL_TARGET_USB = 1,
} MCPInstallTarget;
typedef struct MCPInstallProgress MCPInstallProgress;
typedef struct MCPInstallInfo MCPInstallInfo;
typedef struct MCPInstallTitleInfo MCPInstallTitleInfo;
struct __attribute__((__packed__)) MCPInstallProgress
{
u32 inProgress;
u64 tid;
u64 sizeTotal;
u64 sizeProgress;
u32 contentsTotal;
u32 contentsProgress;
};
CHECK_OFFSET(MCPInstallProgress, 0x04, tid);
CHECK_OFFSET(MCPInstallProgress, 0x20, contentsProgress);
CHECK_SIZE(MCPInstallProgress, 0x24);
struct MCPInstallInfo
{
UNKNOWN(0x27F);
};
CHECK_SIZE(MCPInstallInfo, 0x27F);
struct MCPInstallTitleInfo
{
UNKNOWN(0x27F);
};
CHECK_SIZE(MCPInstallTitleInfo, 0x27F);
int
MCP_Open();
int
MCP_Close(int handle);
int
MCP_InstallSetTargetDevice(int handle, MCPInstallTarget device);
int
MCP_InstallGetTargetDevice(int handle, MCPInstallTarget *deviceOut);
int
MCP_InstallSetTargetUsb(int handle, int usb);
int
MCP_InstallGetInfo(int handle, char *path, MCPInstallInfo *out);
int
MCP_InstallTitleAsync(int handle, char *path, MCPInstallTitleInfo *out);
int
MCP_InstallGetProgress(int handle, MCPInstallProgress *installProgressOut);
int
MCP_InstallTitleAbort(int handle);
int
MCP_UninstallTitleAsync(int handle, char *path, MCPInstallTitleInfo *out);
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -186,6 +186,18 @@ EXPORT(MEMAdjustFrmHeap);
EXPORT(MEMResizeForMBlockFrmHeap);
EXPORT(MEMGetAllocatableSizeForFrmHeapEx);
// coreinit/mcp.h
EXPORT(MCP_Open);
EXPORT(MCP_Close);
EXPORT(MCP_InstallSetTargetDevice);
EXPORT(MCP_InstallGetTargetDevice);
EXPORT(MCP_InstallSetTargetUsb);
EXPORT(MCP_InstallGetInfo);
EXPORT(MCP_InstallTitleAsync);
EXPORT(MCP_InstallGetProgress);
EXPORT(MCP_InstallTitleAbort);
EXPORT(MCP_DeleteTitleAsync);
// coreinit/memheap.h
EXPORT(MEMDumpHeap);
EXPORT(MEMFindContainHeap);