diff --git a/libctru/include/3ds/mii.h b/libctru/include/3ds/mii.h index 76898279e..38e2674a8 100644 --- a/libctru/include/3ds/mii.h +++ b/libctru/include/3ds/mii.h @@ -170,3 +170,11 @@ typedef struct u16 author_name[10]; ///< Name of Mii's author (Encoded using UTF16) } CTR_PACKED MiiData; + +/// Mii CFLStoreData (CTR Face Library Store Data) structure +typedef struct +{ + MiiData miiData; ///< Common shared Mii data structure. + u8 pad[2]; ///< Padding (usually left as zeros) + u16 crc16; ///< CRC16 over the previous 0x5E of data +} CFLStoreData; \ No newline at end of file diff --git a/libctru/include/3ds/services/act.h b/libctru/include/3ds/services/act.h index dbfc6843b..e0aee41ef 100644 --- a/libctru/include/3ds/services/act.h +++ b/libctru/include/3ds/services/act.h @@ -150,14 +150,6 @@ typedef struct #pragma pack(push, 1) -/// Mii CFLStoreData (CTR Face Library Store Data) structure -typedef struct -{ - MiiData miiData; - u8 pad[2]; - u16 crc16; -} CFLStoreData; - /// Birth date structure typedef struct { diff --git a/libctru/include/3ds/services/frd.h b/libctru/include/3ds/services/frd.h index 1d1436a57..b511e638d 100644 --- a/libctru/include/3ds/services/frd.h +++ b/libctru/include/3ds/services/frd.h @@ -92,16 +92,6 @@ typedef struct u8 pad; } FriendPresence; -/// Friend Mii data -typedef struct -{ - bool profanityFlag; ///< Whether or not the Mii contains profanity. - u8 characterSet; ///< The character set for text data. - bool dirtyFlag; ///< Whether or not the Mii is marked as "dirty" (needs to be uploaded to the server). - u8 pad; - MiiData mii; ///< The actual Mii data. -} FriendMii; - /// Friend playing game structure typedef struct { @@ -109,6 +99,8 @@ typedef struct FriendGameModeDescription gameModeDescription; } FriendPlayingGame; +typedef CFLStoreData FriendMii; + /// Friend info structure typedef struct { @@ -420,9 +412,9 @@ Result FRD_GetMyPassword(char *password, u32 bufsize); * @param friendKeyList Pointer to write the friend key list to. * @param num Stores the number of friend keys obtained. * @param offset The index of the friend key to start with. - * @param size Size of the friend key list. (FRIEND_LIST_SIZE) + * @param count Number of friend keys to retrieve. Max: FRIEND_LIST_SIZE */ -Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 size); +Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 count); /** * @brief Gets friend presence data for the current user's friends. diff --git a/libctru/source/services/frd.c b/libctru/source/services/frd.c index f0d452cfa..2f3035134 100644 --- a/libctru/source/services/frd.c +++ b/libctru/source/services/frd.c @@ -285,7 +285,7 @@ Result FRD_GetMyPassword(char *password, u32 bufsize) return (Result)cmdbuf[1]; } -Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 size) +Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 count) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); @@ -296,9 +296,9 @@ Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 cmdbuf[0] = IPC_MakeHeader(0x11,2,0); // 0x110080 cmdbuf[1] = offset; - cmdbuf[2] = size; + cmdbuf[2] = count; - staticbufs[0] = IPC_Desc_StaticBuffer(size, 0); + staticbufs[0] = IPC_Desc_StaticBuffer(count * sizeof(FriendKey), 0); staticbufs[1] = (u32)friendKeyList; ret = svcSendSyncRequest(frdHandle); @@ -1253,4 +1253,4 @@ Result FRDA_IncrementMoveCount() return (Result)cmdbuf[1]; } -#undef MIN \ No newline at end of file +#undef MIN