MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / titlesUpdate

Function titlesUpdate

source/titles.c:64–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64static void titlesUpdate(void* pnewState)
65{
66 int i, j;
67 UIState newState = (UIState)pnewState;
68 for (i = 0; i < 3; i ++)
69 {
70 titleList_s* tl = &s_titles[i];
71 if (tl->totalNum == 0) goto _fail;
72 u64* new_list = (u64*)realloc(tl->ids, tl->totalNum*sizeof(u64));
73 if (!new_list) goto _fail;
74 tl->ids = new_list;
75 u32 temp;
76 Result ret = AM_GetTitleList(&temp, i, tl->totalNum, tl->ids);
77 if (R_FAILED(ret)) goto _fail;
78 tl->filteredNum = 0;
79 for (j = 0; j < tl->totalNum; j ++)
80 {
81 u64 tid = tl->ids[j];
82 tl->ids[tl->filteredNum] = tid;
83 u32 tid_high = tid >> 32;
84 if (tid_high == 0x00040010 || tid_high == 0x00040000 || tid_high == 0x00040002)
85 tl->filteredNum ++;
86 }
87 continue;
88
89 _fail:
90 titleListClear(tl);
91 }
92
93 if (newState > UI_STATE_NULL)
94 uiEnterState(newState);
95}
96
97bool titlesCheckUpdate(bool async, UIState newState)
98{

Callers 1

titlesCheckUpdateFunction · 0.85

Calls 2

titleListClearFunction · 0.85
uiEnterStateFunction · 0.85

Tested by

no test coverage detected