Split arguments to miiSelectorLaunch
This commit is contained in:
parent
452fddc658
commit
c2c3cc8d16
@ -84,21 +84,13 @@ _assert_struct_size(MiiSelectorReturn, 0x84);
|
|||||||
|
|
||||||
#undef _assert_struct_size
|
#undef _assert_struct_size
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Mii selector context
|
|
||||||
*
|
|
||||||
* Configure how to launch the applet in @ref MiiSelectorContext.config. After
|
|
||||||
* returning, the applet has written data to @ref MiiSelectorContext.ret.
|
|
||||||
*/
|
|
||||||
typedef union {
|
|
||||||
MiiSelectorConf config; ///< Configuration passed to applet
|
|
||||||
MiiSelectorReturn ret; ///< Data written by applet after return
|
|
||||||
} MiiSelectorContext;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Launch the Mii selector library applet
|
* @brief Launch the Mii selector library applet
|
||||||
|
*
|
||||||
|
* @param conf Configuration determining how the applet should behave
|
||||||
|
* @param returnbuf Data returned by the applet
|
||||||
*/
|
*/
|
||||||
Result miiSelectorLaunch(MiiSelectorContext *ctx);
|
Result miiSelectorLaunch(const MiiSelectorConf *conf, MiiSelectorReturn* returnbuf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Verifies that the Mii data returned from the applet matches its
|
* @brief Verifies that the Mii data returned from the applet matches its
|
||||||
|
@ -1,12 +1,27 @@
|
|||||||
#include <3ds/types.h>
|
#include <3ds/types.h>
|
||||||
|
#include <3ds/result.h>
|
||||||
#include <3ds/services/apt.h>
|
#include <3ds/services/apt.h>
|
||||||
|
|
||||||
#include <3ds/applets/miiselector.h>
|
#include <3ds/applets/miiselector.h>
|
||||||
|
|
||||||
Result miiSelectorLaunch(MiiSelectorContext *ctx)
|
#include <string.h> // for memcpy
|
||||||
|
|
||||||
|
Result miiSelectorLaunch(const MiiSelectorConf *conf, MiiSelectorReturn *returnbuf)
|
||||||
{
|
{
|
||||||
ctx->config.magic = MIISELECTOR_MAGIC;
|
union {
|
||||||
return aptLaunchLibraryApplet(APPID_APPLETED, &ctx->config, sizeof(MiiSelectorConf), 0);
|
MiiSelectorConf config;
|
||||||
|
MiiSelectorReturn ret;
|
||||||
|
} ctx;
|
||||||
|
|
||||||
|
memcpy(&ctx.config, conf, sizeof(MiiSelectorConf));
|
||||||
|
ctx.config.magic = MIISELECTOR_MAGIC;
|
||||||
|
|
||||||
|
Result ret = aptLaunchLibraryApplet(APPID_APPLETED, &ctx.config, sizeof(MiiSelectorConf), 0);
|
||||||
|
if(R_SUCCEEDED(ret) && returnbuf) {
|
||||||
|
memcpy(returnbuf, &ctx.ret, sizeof(MiiSelectorReturn));
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 crc16_ccitt(void const *buf, size_t len, uint32_t starting_val)
|
static u16 crc16_ccitt(void const *buf, size_t len, uint32_t starting_val)
|
||||||
|
Loading…
Reference in New Issue
Block a user