Guest User

Untitled

a guest
Jul 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <3ds.h>
  5.  
  6. int main()
  7. {
  8. gfxInitDefault(); // Init graphic stuff
  9. consoleInit(GFX_TOP, NULL);
  10.  
  11. printf("FRD_Init() %08lX\n", frdInit());
  12.  
  13. Result ret = 0;
  14.  
  15. Handle event;
  16. bool state;
  17.  
  18. printf("FRD_LogOut %08lx\n", FRD_Logout());
  19.  
  20. printf("FrdLogin() %08lX\n", FRD_Login(&event));
  21. printf("Waiting on Handle...");
  22. svcWaitSynchronization(event, U64_MAX);
  23. printf("Wait done.\n");
  24. printf("FRD_HasLoggedIn %08lx\n", FRDU_HasLoggedIn(&state));
  25. printf("Logged In: %d\n", state);
  26.  
  27. FriendKey key[1];
  28. u64 friend_code;
  29. size_t num;
  30. printf("FRD_GetFriendKeyList %08lX\n", FRD_GetFriendKeyList(key, &num, 0, 1));
  31. printf("PrincipalID : %lX : %lld\n", key[0].principalId, key[0].localFriendCode);
  32.  
  33. printf("FRD_PrincipalIdToFriendCode() %08lX\n", FRD_PrincipalIdToFriendCode(key[0].principalId, &friend_code));
  34. printf("FRD_IsValidFriendCode %08lx\n", FRD_IsValidFriendCode(friend_code, &state));
  35. printf("Valid : %d\n", state);
  36.  
  37. printf("FRD_COnvertFriendCodeToPrincipalId %08lx\n", FRD_FriendCodeToPrincipalId(friend_code, &key[0].principalId));
  38. printf("PrincipalID : %lX : %lld\n", key[0].principalId, friend_code);
  39.  
  40. Profile profile;
  41. printf("FRD_GetFriendProfile %08lx\n", FRD_GetFriendProfile(&profile, key, 1));
  42. printf("region %d, country %d, language %d\n", profile.region, profile.country, profile.language);
  43.  
  44. MiiData mii;
  45. printf("FRD_GetFriendMii %08lx\n", FRD_GetFriendMii(&mii, key, 1));
  46. printf("mii_id : %ld\n", mii.mii_id);
  47.  
  48. GameDescription desc;
  49. printf("FRD_GetFriendFavouriteGame %08lX\n", FRD_GetFriendFavouriteGame(&desc, key, 1));
  50. printf("Game TID %llX", desc.data.tid);
  51. /*
  52. u8 screenName[FRIENDS_SCREEN_NAME_SIZE];
  53. u8 comment[FRIENDS_COMMENT_SIZE];
  54.  
  55. printf("FRD_GetMyScreenName %08lx\n", FRD_GetMyScreenName(screenName));
  56. printf("FRD_GetMyComment %08lx\n", FRD_GetMyComment(comment));
  57. printf("FRD_UpdateGAmeModeDesc %08lx\n", FRD_UpdateGameModeDescription(comment));
  58. for(int i = 0; i <= 14; i++)
  59. {
  60. printf("SreenName %X %c\n", screenName[i], screenName[i]);
  61. }
  62. printf(L"Collected %s", screenName);
  63. printf("Printed");
  64. u8 buf[300];
  65. size_t size = utf16_to_utf8((uint8_t*)buf, (uint16_t*)screenName, FRIENDS_SCREEN_NAME_SIZE);
  66. buf[size] = '\0';
  67. printf("SreenName %s\n", screenName);
  68. printf("COmment %s", comment);
  69. */
  70. // Loop as long as the status is not exit
  71. while(aptMainLoop())
  72. {
  73. // Scan hid shared memory for input events
  74. hidScanInput();
  75.  
  76. if(hidKeysDown() & KEY_START) // If the A button got pressed, start the app launch
  77. {
  78. break;
  79. }
  80.  
  81. // Flush + swap framebuffers and wait for VBlank. Not really needed in this example
  82. gfxFlushBuffers();
  83. gfxSwapBuffers();
  84. gspWaitForVBlank();
  85. }
  86.  
  87. gfxExit();
  88.  
  89. return 0;
  90. }
Add Comment
Please, Sign In to add comment