Skip to content

Commit

Permalink
coreinit: add "MCP_DEVICE_TYPE_AUTO"
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Aug 10, 2024
1 parent bbfedee commit 373bfc0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions include/coreinit/mcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ typedef enum MCPAppType

typedef enum MCPDeviceType
{
MCP_DEVICE_TYPE_AUTO = 1, /* returns result for ODD, MLC and USB */
MCP_DEVICE_TYPE_ODD = 2,
MCP_DEVICE_TYPE_MLC = 3,
MCP_DEVICE_TYPE_USB = 4,
/* any value >= 5 is MCP_DEVICE_TYPE_AUTO */
} MCPDeviceType;

typedef enum MCPDeviceFlags
Expand Down Expand Up @@ -310,7 +312,7 @@ MCP_TitleListByUniqueId(int32_t handle,

MCPError
MCP_TitleListByDevice(int32_t handle,
const char *device,
const char *deviceName,
uint32_t *outTitleCount,
MCPTitleListType *titleList,
uint32_t titleListSizeBytes);
Expand All @@ -324,7 +326,7 @@ MCP_TitleListByDeviceType(int32_t handle,
MCPError
MCP_TitleListByAppAndDevice(int32_t handle,
MCPAppType appType,
const char *device,
const char *deviceName,
uint32_t *outTitleCount,
MCPTitleListType *titleList,
uint32_t titleListSizeBytes);
Expand Down Expand Up @@ -380,6 +382,21 @@ MCP_ChangeEcoSettings(int32_t handle,
uint32_t maxOnTime,
uint16_t defaultOffTime);

static inline const char*
MCP_GetDeviceNameByDeviceType(MCPDeviceType deviceType) {
switch (deviceType) {
case MCP_DEVICE_TYPE_AUTO:
return "auto";
case MCP_DEVICE_TYPE_ODD:
return "odd";
case MCP_DEVICE_TYPE_MLC:
return "mlc";
case MCP_DEVICE_TYPE_USB:
return "usb";
}
return "auto";
}

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 373bfc0

Please sign in to comment.