@@ -142,9 +142,9 @@ Result FRD_GetMyPreference(bool *isPublicMode, bool *isShowGameName, bool *isSho
142142
143143 if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
144144
145- * isPublicMode = cmdbuf [2 ] & 0x1 ; // Public mode
146- * isShowGameName = cmdbuf [3 ] & 0x1 ; // Show current game
147- * isShowPlayedGame = cmdbuf [4 ] & 0x1 ; // Show game history.
145+ * isPublicMode = cmdbuf [2 ] & 0xFF ; // Public mode
146+ * isShowGameName = cmdbuf [3 ] & 0xFF ; // Show current game
147+ * isShowPlayedGame = cmdbuf [4 ] & 0xFF ; // Show game history.
148148
149149 return (Result )cmdbuf [1 ];
150150}
@@ -163,7 +163,7 @@ Result FRD_GetMyProfile(FriendProfile *profile)
163163 return (Result )cmdbuf [1 ];
164164}
165165
166- Result FRD_GetMyScreenName (char * name , u32 max_size )
166+ Result FRD_GetMyScreenName (char * name , size_t max_size )
167167{
168168 Result ret = 0 ;
169169 u32 * cmdbuf = getThreadCommandBuffer ();
@@ -219,7 +219,7 @@ Result FRD_GetMyFavoriteGame(u64 *titleId)
219219 return (Result )cmdbuf [1 ];
220220}
221221
222- Result FRD_GetMyComment (char * comment , u32 max_size )
222+ Result FRD_GetMyComment (char * comment , size_t max_size )
223223{
224224 Result ret = 0 ;
225225 u32 * cmdbuf = getThreadCommandBuffer ();
@@ -233,15 +233,15 @@ Result FRD_GetMyComment(char *comment, u32 max_size)
233233 return (Result )cmdbuf [1 ];
234234}
235235
236- Result FRD_GetFriendKeyList (FriendKey * friendKeyList , u32 * num , u32 offset , u32 count )
236+ Result FRD_GetFriendKeyList (FriendKey * friendKeyList , u32 * num , u32 offset , u32 size )
237237{
238238 Result ret = 0 ;
239239 u32 * cmdbuf = getThreadCommandBuffer ();
240240
241241 cmdbuf [0 ] = IPC_MakeHeader (0x11 ,2 ,0 ); // 0x110080
242242 cmdbuf [1 ] = offset ;
243- cmdbuf [2 ] = count ;
244- cmdbuf [64 ] = (count << 18 ) | 2 ;
243+ cmdbuf [2 ] = size ;
244+ cmdbuf [64 ] = (size << 18 ) | 2 ;
245245 cmdbuf [65 ] = (u32 )friendKeyList ;
246246
247247 if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
@@ -251,91 +251,91 @@ Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32
251251 return (Result )cmdbuf [1 ];
252252}
253253
254- Result FRD_GetFriendMii (MiiData * miis , const FriendKey * keys , u32 offset , u32 count )
254+ Result FRD_GetFriendMii (MiiData * miiDataList , const FriendKey * friendKeyList , size_t size )
255255{
256256 Result ret = 0 ;
257257 u32 * cmdbuf = getThreadCommandBuffer ();
258258
259259 cmdbuf [0 ] = IPC_MakeHeader (0x14 ,1 ,4 ); // 0x140044
260- cmdbuf [1 ] = offset ;
261- cmdbuf [2 ] = (count << 18 ) | 2 ;
262- cmdbuf [3 ] = (u32 )keys ;
263- cmdbuf [4 ] = IPC_Desc_Buffer (count * sizeof (MiiData ), IPC_BUFFER_W );
264- cmdbuf [5 ] = (u32 )miis ;
260+ cmdbuf [1 ] = size ;
261+ cmdbuf [2 ] = (size << 18 ) | 2 ;
262+ cmdbuf [3 ] = (u32 )friendKeyList ;
263+ cmdbuf [4 ] = IPC_Desc_Buffer (size * sizeof (MiiData ), IPC_BUFFER_W );
264+ cmdbuf [5 ] = (u32 )miiDataList ;
265265
266- if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
266+ if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
267267
268268 return (Result )cmdbuf [1 ];
269269}
270270
271- Result FRD_GetFriendProfile (FriendProfile * profile , const FriendKey * keys , u32 offset , u32 count )
271+ Result FRD_GetFriendProfile (FriendProfile * profile , const FriendKey * friendKeyList , size_t size )
272272{
273273 Result ret = 0 ;
274274 u32 * cmdbuf = getThreadCommandBuffer ();
275275
276276 cmdbuf [0 ] = IPC_MakeHeader (0x15 ,1 ,2 ); // 0x150042
277- cmdbuf [1 ] = offset ;
278- cmdbuf [2 ] = (count << 18 ) | 2 ;
279- cmdbuf [3 ] = (u32 )keys ;
277+ cmdbuf [1 ] = size ;
278+ cmdbuf [2 ] = (size << 18 ) | 2 ;
279+ cmdbuf [3 ] = (u32 )friendKeyList ;
280280
281281 u32 * staticbuf = getThreadStaticBuffers ();
282- staticbuf [0 ] = (count << 17 ) | 2 ;
282+ staticbuf [0 ] = (size << 17 )| 2 ;
283283 staticbuf [1 ] = (u32 )profile ;
284284
285- if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
285+ if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
286286
287287 return (Result )cmdbuf [1 ];
288288}
289289
290- Result FRD_GetFriendPlayingGame (GameDescription * desc , const FriendKey * keys , u32 offset , u32 count )
290+ Result FRD_GetFriendPlayingGame (GameDescription * desc , const FriendKey * friendKeyList , size_t size )
291291{
292292 Result ret = 0 ;
293293 u32 * cmdbuf = getThreadCommandBuffer ();
294294
295295 cmdbuf [0 ] = IPC_MakeHeader (0x18 ,1 ,4 ); // 0x180044
296- cmdbuf [1 ] = offset ;
297- cmdbuf [2 ] = (count << 18 ) | 2 ;
298- cmdbuf [3 ] = (u32 )keys ;
299- cmdbuf [4 ] = IPC_Desc_Buffer (count * sizeof (GameDescription ), IPC_BUFFER_W );
296+ cmdbuf [1 ] = size ;
297+ cmdbuf [2 ] = (size << 18 ) | 2 ;
298+ cmdbuf [3 ] = (u32 )friendKeyList ;
299+ cmdbuf [4 ] = IPC_Desc_Buffer (size * sizeof (GameDescription ), IPC_BUFFER_W );
300300 cmdbuf [5 ] = (u32 )desc ;
301301
302302 if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
303303
304304 return (Result )cmdbuf [1 ];
305305}
306306
307- Result FRD_GetFriendFavouriteGame (GameDescription * desc , const FriendKey * keys , u32 offset , u32 count )
307+ Result FRD_GetFriendFavouriteGame (GameDescription * desc , const FriendKey * friendKeyList , u32 count )
308308{
309309 Result ret = 0 ;
310310 u32 * cmdbuf = getThreadCommandBuffer ();
311311
312312 cmdbuf [0 ] = IPC_MakeHeader (0x19 ,1 ,2 ); // 0x190042
313- cmdbuf [1 ] = offset ;
313+ cmdbuf [1 ] = count ;
314314 cmdbuf [2 ] = (count << 18 ) | 2 ;
315- cmdbuf [3 ] = (u32 )keys ;
315+ cmdbuf [3 ] = (u32 )friendKeyList ;
316316
317317 u32 * staticbuf = getThreadStaticBuffers ();
318318
319319 staticbuf [0 ] = (count << 18 ) | 2 ;
320320 staticbuf [1 ] = (u32 )desc ;
321321
322- if (R_FAILED (svcSendSyncRequest (frdHandle ))) return ret ;
322+ if (R_FAILED (svcSendSyncRequest (frdHandle ))) return ret ;
323323
324324 return (Result )cmdbuf [1 ];
325325}
326326
327- Result FRD_IsIncludedInFriendList ( u64 friendCode , bool * isFromList )
327+ Result FRD_IsInFriendList ( FriendKey * friendKeyList , bool * isFromList )
328328{
329329 Result ret = 0 ;
330330 u32 * cmdbuf = getThreadCommandBuffer ();
331331
332332 cmdbuf [0 ] = IPC_MakeHeader (0x1B ,2 ,0 ); // 0x1B0080
333- cmdbuf [1 ] = (u32 )(friendCode & 0xFFFFFFFF );
334- cmdbuf [2 ] = (u32 )(friendCode >> 32 );
333+ cmdbuf [1 ] = (u32 )(friendKeyList -> localFriendCode & 0xFFFFFFFF );
334+ cmdbuf [2 ] = (u32 )(friendKeyList -> localFriendCode >> 32 );
335335
336336 if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
337337
338- * isFromList = cmdbuf [2 ] & 0x1 ;
338+ * isFromList = cmdbuf [2 ] & 0xFF ;
339339
340340 return (Result )cmdbuf [1 ];
341341}
@@ -367,24 +367,24 @@ Result FRD_AttachToEventNotification(Handle event)
367367 cmdbuf [1 ] = 0 ;
368368 cmdbuf [2 ] = (u32 )event ;
369369
370- if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
370+ if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
371371
372372 return (Result )cmdbuf [1 ];
373373}
374374
375- Result FRD_GetEventNotification (NotificationEvent * event , u32 size , u32 * recievedNotifCount )
375+ Result FRD_GetEventNotification (NotificationEvent * event , u32 count , u32 * recievedNotifCount )
376376{
377377 Result ret = 0 ;
378378
379379 u32 * cmdbuf = getThreadCommandBuffer ();
380380 cmdbuf [0 ] = IPC_MakeHeader (0x22 ,1 ,0 ); //0x220040
381- cmdbuf [1 ] = size ;
381+ cmdbuf [1 ] = count ;
382382
383383 u32 * staticbuf = getThreadStaticBuffers ();
384- staticbuf [0 ] = 0x60000 * size | 2 ;
384+ staticbuf [0 ] = 0x60000 * count | 2 ;
385385 staticbuf [1 ] = (u32 )event ;
386386
387- if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
387+ if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
388388
389389 * recievedNotifCount = cmdbuf [3 ];
390390
@@ -461,7 +461,7 @@ Result FRD_AddFriendOnline(Handle event, u32 principalId)
461461 cmdbuf [2 ] = 0 ;
462462 cmdbuf [3 ] = (u32 )event ;
463463
464- if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
464+ if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
465465
466466 return (Result )cmdbuf [1 ];
467467}
@@ -475,7 +475,7 @@ Result FRD_RemoveFriend(u32 principalId, u64 localFriendCode)
475475 cmdbuf [2 ] = localFriendCode & 0xffffffff ;
476476 cmdbuf [3 ] = (localFriendCode >> 32 ) & 0xffffffff ;
477477
478- if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
478+ if (R_FAILED (ret = svcSendSyncRequest (frdHandle ))) return ret ;
479479
480480 return cmdbuf [1 ];
481481}
0 commit comments