Add miiSelectorInit

This commit is contained in:
Oreo639 2019-04-14 16:57:17 -07:00
parent 1bcad200b6
commit 0139890679
2 changed files with 23 additions and 5 deletions

View File

@ -79,6 +79,12 @@ enum
MIISELECTOR_GUESTSTART = BIT(3), ///< Start on guest page MIISELECTOR_GUESTSTART = BIT(3), ///< Start on guest page
}; };
/**
* @brief Initialize Mii selector config
* @param conf Pointer to Miiselector config.
*/
void miiSelectorInit(MiiSelectorConf *conf);
/** /**
* @brief Launch the Mii selector library applet * @brief Launch the Mii selector library applet
* *
@ -107,7 +113,7 @@ void miiSelectorSetOptions(MiiSelectorConf *conf, u32 options);
* @brief Specifies which guest Miis will be selectable * @brief Specifies which guest Miis will be selectable
* *
* @param conf Pointer to miiSelector configuration * @param conf Pointer to miiSelector configuration
* @param index Index of the guest Mii that will be whitelisted. * @param index Index of the guest Miis that will be whitelisted.
* @ref MIISELECTOR_GUESTMII_SLOTS can be used to whitelist all the guest Miis. * @ref MIISELECTOR_GUESTMII_SLOTS can be used to whitelist all the guest Miis.
*/ */
void miiSelectorWhitelistGuestMii(MiiSelectorConf *conf, u32 index); void miiSelectorWhitelistGuestMii(MiiSelectorConf *conf, u32 index);
@ -116,7 +122,7 @@ void miiSelectorWhitelistGuestMii(MiiSelectorConf *conf, u32 index);
* @brief Specifies which guest Miis will be unselectable * @brief Specifies which guest Miis will be unselectable
* *
* @param conf Pointer to miiSelector configuration * @param conf Pointer to miiSelector configuration
* @param index Index of the guest Mii that will be blacklisted. * @param index Index of the guest Miis that will be blacklisted.
* @ref MIISELECTOR_GUESTMII_SLOTS can be used to blacklist all the guest Miis. * @ref MIISELECTOR_GUESTMII_SLOTS can be used to blacklist all the guest Miis.
*/ */
void miiSelectorBlacklistGuestMii(MiiSelectorConf *conf, u32 index); void miiSelectorBlacklistGuestMii(MiiSelectorConf *conf, u32 index);
@ -125,7 +131,7 @@ void miiSelectorBlacklistGuestMii(MiiSelectorConf *conf, u32 index);
* @brief Specifies which user Miis will be selectable * @brief Specifies which user Miis will be selectable
* *
* @param conf Pointer to miiSelector configuration * @param conf Pointer to miiSelector configuration
* @param index Index of the user Mii that will be whitelisted. * @param index Index of the user Miis that will be whitelisted.
* @ref MIISELECTOR_USERMII_SLOTS can be used to whitlist all the user Miis * @ref MIISELECTOR_USERMII_SLOTS can be used to whitlist all the user Miis
*/ */
void miiSelectorWhitelistUserMii(MiiSelectorConf *conf, u32 index); void miiSelectorWhitelistUserMii(MiiSelectorConf *conf, u32 index);
@ -134,7 +140,7 @@ void miiSelectorWhitelistUserMii(MiiSelectorConf *conf, u32 index);
* @brief Specifies which user Miis will be selectable * @brief Specifies which user Miis will be selectable
* *
* @param conf Pointer to miiSelector configuration * @param conf Pointer to miiSelector configuration
* @param index Index of the user Mii that will be blacklisted. * @param index Index of the user Miis that will be blacklisted.
* @ref MIISELECTOR_USERMII_SLOTS can be used to blacklist all the user Miis * @ref MIISELECTOR_USERMII_SLOTS can be used to blacklist all the user Miis
*/ */
void miiSelectorBlacklistUserMii(MiiSelectorConf *conf, u32 index); void miiSelectorBlacklistUserMii(MiiSelectorConf *conf, u32 index);
@ -144,7 +150,8 @@ void miiSelectorBlacklistUserMii(MiiSelectorConf *conf, u32 index);
* *
* @param conf Pointer to miiSelector configuration * @param conf Pointer to miiSelector configuration
* @param index Indexed number of the Mii that the cursor will start on. * @param index Indexed number of the Mii that the cursor will start on.
* If there is no mii with that index, the the cursor will start at index 0. * If there is no mii with that index, the the cursor will start at the Mii
* with the index 0 (the personal Mii).
*/ */
void miiSelectorSetInitalIndex(MiiSelectorConf *conf, u32 index); void miiSelectorSetInitalIndex(MiiSelectorConf *conf, u32 index);

View File

@ -7,6 +7,17 @@
#include <string.h> // for memcpy #include <string.h> // for memcpy
void miiSelectorInit(MiiSelectorConf *conf)
{
memset(conf, 0, sizeof(*conf));
for (int i = 0; i < MIISELECTOR_GUESTMII_SLOTS; i ++)
conf->mii_guest_whitelist[i] = 1;
for (int i = 0; i < MIISELECTOR_USERMII_SLOTS; i ++)
conf->mii_whitelist[i] = 1;
}
Result miiSelectorLaunch(const MiiSelectorConf *conf, MiiSelectorReturn *returnbuf) Result miiSelectorLaunch(const MiiSelectorConf *conf, MiiSelectorReturn *returnbuf)
{ {
union { union {