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

Function titleSelectUpdate

source/ui/titleselect.c:61–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void titleSelectUpdate(void)
62{
63 u32 kDown = hidKeysDown();
64
65 if (s_curTitle < 0)
66 {
67 s_curTitle = 0;
68 s_move = 1;
69 workerSchedule(loadTitleData, NULL);
70 return;
71 }
72
73 u64 curTime = osGetTime();
74 if ((curTime-s_lastUpdate) > UPDATE_FREQUENCY)
75 {
76 s_lastUpdate = curTime;
77 if (titlesCheckUpdate(true, UI_STATE_TITLESELECT))
78 {
79 s_curTitle = -1;
80 return;
81 }
82 }
83
84 if ((kDown & KEY_A) || (kDown & KEY_B))
85 {
86 // Free entry.
87 menuEntryFree(&s_iconEntry);
88 uiExitState();
89 if (kDown & KEY_A)
90 {
91 s_launchEntry->titleSelected = true;
92 s_launchEntry->titleId = s_curTitleID;
93 s_launchEntry->titleMediatype = s_curMediatype;
94 workerSchedule(launchEntry, NULL);
95 }
96 return;
97 }
98
99 s_move = 0;
100 if (kDown & KEY_RIGHT) s_move++;
101 if (kDown & KEY_LEFT) s_move--;
102
103 int tgt = s_curTitle+s_move;
104 int cnt = titlesCount();
105 if (tgt < 0) tgt += cnt;
106 if (tgt >= cnt) tgt -= cnt;
107
108 if (tgt != s_curTitle)
109 {
110 s_curTitle = tgt;
111 workerSchedule(loadTitleData, NULL);
112 return;
113 }
114}
115
116void titleSelectDrawBot(void)
117{

Callers

nothing calls this directly

Calls 5

workerScheduleFunction · 0.85
titlesCheckUpdateFunction · 0.85
menuEntryFreeFunction · 0.85
uiExitStateFunction · 0.85
titlesCountFunction · 0.85

Tested by

no test coverage detected