Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libctru/include/3ds/mii.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
8 changes: 0 additions & 8 deletions libctru/include/3ds/services/act.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
16 changes: 4 additions & 12 deletions libctru/include/3ds/services/frd.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,15 @@ 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
{
GameKey game; ///< Game key of the game.
FriendGameModeDescription gameModeDescription;
} FriendPlayingGame;

typedef CFLStoreData FriendMii;

/// Friend info structure
typedef struct
{
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions libctru/source/services/frd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -1253,4 +1253,4 @@ Result FRDA_IncrementMoveCount()
return (Result)cmdbuf[1];
}

#undef MIN
#undef MIN